build by Make
This commit is contained in:
parent
23ce26e82c
commit
c6e97fe887
|
@ -72,7 +72,7 @@ object Build : BuildType({
|
|||
steps {
|
||||
script {
|
||||
name = "Build"
|
||||
scriptContent = "./build.sh"
|
||||
scriptContent = "make build -j 3"
|
||||
dockerImage = golangImage
|
||||
dockerPull = true
|
||||
}
|
||||
|
@ -84,15 +84,7 @@ object Build : BuildType({
|
|||
|
||||
script {
|
||||
name = "Test"
|
||||
scriptContent = """
|
||||
set -eux
|
||||
|
||||
go test -c ./driver
|
||||
go test -c ./iso
|
||||
go test -c ./clone
|
||||
|
||||
./test.sh | go-test-teamcity
|
||||
""".trimIndent()
|
||||
scriptContent = "make test | go-test-teamcity"
|
||||
dockerImage = golangImage
|
||||
dockerPull = true
|
||||
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
|
||||
- cache:/root/.cache
|
||||
working_dir: /work
|
||||
command: ./build.sh
|
||||
command: make build -j 3
|
||||
|
||||
test:
|
||||
image: jetbrainsinfra/golang:1.11.4
|
||||
|
@ -20,7 +20,7 @@ services:
|
|||
environment:
|
||||
VSPHERE_USERNAME:
|
||||
VSPHERE_PASSWORD:
|
||||
command: ./test.sh
|
||||
command: make test
|
||||
|
||||
volumes:
|
||||
modules:
|
||||
|
|
Loading…
Reference in New Issue