build by Make
This commit is contained in:
parent
23ce26e82c
commit
c6e97fe887
|
@ -72,7 +72,7 @@ object Build : BuildType({
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
name = "Build"
|
name = "Build"
|
||||||
scriptContent = "./build.sh"
|
scriptContent = "make build -j 3"
|
||||||
dockerImage = golangImage
|
dockerImage = golangImage
|
||||||
dockerPull = true
|
dockerPull = true
|
||||||
}
|
}
|
||||||
|
@ -84,15 +84,7 @@ object Build : BuildType({
|
||||||
|
|
||||||
script {
|
script {
|
||||||
name = "Test"
|
name = "Test"
|
||||||
scriptContent = """
|
scriptContent = "make test | go-test-teamcity"
|
||||||
set -eux
|
|
||||||
|
|
||||||
go test -c ./driver
|
|
||||||
go test -c ./iso
|
|
||||||
go test -c ./clone
|
|
||||||
|
|
||||||
./test.sh | go-test-teamcity
|
|
||||||
""".trimIndent()
|
|
||||||
dockerImage = golangImage
|
dockerImage = golangImage
|
||||||
dockerPull = true
|
dockerPull = true
|
||||||
dockerRunParameters = "--network=container:vpn"
|
dockerRunParameters = "--network=container:vpn"
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
GOOPTS := GOARCH=amd64 CGO_ENABLED=0
|
||||||
|
|
||||||
|
build: iso clone
|
||||||
|
|
||||||
|
iso: iso-linux iso-windows iso-macos
|
||||||
|
clone: clone-linux clone-windows clone-macos
|
||||||
|
|
||||||
|
iso-linux: modules bin
|
||||||
|
$(GOOPTS) GOOS=linux go build -o bin/packer-builder-vsphere-iso.linux ./cmd/iso
|
||||||
|
|
||||||
|
iso-windows: modules bin
|
||||||
|
$(GOOPTS) GOOS=windows go build -o bin/packer-builder-vsphere-iso.exe ./cmd/iso
|
||||||
|
|
||||||
|
iso-macos: modules bin
|
||||||
|
$(GOOPTS) GOOS=darwin go build -o bin/packer-builder-vsphere-iso.macos ./cmd/iso
|
||||||
|
|
||||||
|
clone-linux: modules bin
|
||||||
|
$(GOOPTS) GOOS=linux go build -o bin/packer-builder-vsphere-clone.linux ./cmd/clone
|
||||||
|
|
||||||
|
clone-windows: modules bin
|
||||||
|
$(GOOPTS) GOOS=windows go build -o bin/packer-builder-vsphere-clone.exe ./cmd/clone
|
||||||
|
|
||||||
|
clone-macos: modules bin
|
||||||
|
$(GOOPTS) GOOS=darwin go build -o bin/packer-builder-vsphere-clone.macos ./cmd/clone
|
||||||
|
|
||||||
|
modules:
|
||||||
|
go mod download
|
||||||
|
|
||||||
|
bin:
|
||||||
|
mkdir -p bin
|
||||||
|
rm -f bin/*
|
||||||
|
|
||||||
|
test:
|
||||||
|
PACKER_ACC=1 go test -v -count 1 ./driver ./iso ./clone
|
||||||
|
|
||||||
|
.PHONY: bin test
|
16
build.sh
16
build.sh
|
@ -1,16 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
export CGO_ENABLED=0
|
|
||||||
export GOARCH=amd64
|
|
||||||
mkdir -p bin
|
|
||||||
rm -f bin/*
|
|
||||||
|
|
||||||
GOOS=darwin go build -o bin/packer-builder-vsphere-iso.macos ./cmd/iso
|
|
||||||
GOOS=linux go build -o bin/packer-builder-vsphere-iso.linux ./cmd/iso
|
|
||||||
GOOS=windows go build -o bin/packer-builder-vsphere-iso.exe ./cmd/iso
|
|
||||||
|
|
||||||
GOOS=darwin go build -o bin/packer-builder-vsphere-clone.macos ./cmd/clone
|
|
||||||
GOOS=linux go build -o bin/packer-builder-vsphere-clone.linux ./cmd/clone
|
|
||||||
GOOS=windows go build -o bin/packer-builder-vsphere-clone.exe ./cmd/clone
|
|
|
@ -7,7 +7,7 @@ services:
|
||||||
- modules:/go/pkg/mod
|
- modules:/go/pkg/mod
|
||||||
- cache:/root/.cache
|
- cache:/root/.cache
|
||||||
working_dir: /work
|
working_dir: /work
|
||||||
command: ./build.sh
|
command: make build -j 3
|
||||||
|
|
||||||
test:
|
test:
|
||||||
image: jetbrainsinfra/golang:1.11.4
|
image: jetbrainsinfra/golang:1.11.4
|
||||||
|
@ -20,7 +20,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
VSPHERE_USERNAME:
|
VSPHERE_USERNAME:
|
||||||
VSPHERE_PASSWORD:
|
VSPHERE_PASSWORD:
|
||||||
command: ./test.sh
|
command: make test
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
modules:
|
modules:
|
||||||
|
|
Loading…
Reference in New Issue