2019-09-05 09:34:05 -04:00
|
|
|
orbs:
|
|
|
|
win: circleci/windows@1.0.0
|
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
executors:
|
|
|
|
golang:
|
|
|
|
docker:
|
2019-09-05 11:06:46 -04:00
|
|
|
- image: circleci/golang:1.13
|
2019-09-05 09:34:05 -04:00
|
|
|
darwin:
|
|
|
|
macos:
|
|
|
|
xcode: "9.0"
|
|
|
|
|
|
|
|
commands:
|
|
|
|
install-go-run-tests-unix:
|
|
|
|
parameters:
|
|
|
|
GOOS:
|
|
|
|
type: string
|
|
|
|
GOVERSION:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: curl https://dl.google.com/go/go<< parameters.GOVERSION >>.<< parameters.GOOS >>-amd64.tar.gz | tar -C ~/ -xz
|
|
|
|
- run: ~/go/bin/go test ./...
|
|
|
|
install-go-run-tests-windows:
|
|
|
|
parameters:
|
|
|
|
GOVERSION:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: curl https://dl.google.com/go/go<< parameters.GOVERSION >>.windows-amd64.zip --output ~/go<< parameters.GOVERSION >>.windows-amd64.zip
|
|
|
|
- run: unzip ~/go<< parameters.GOVERSION >>.windows-amd64.zip -d ~/
|
|
|
|
- run: ~/go/bin/go test ./...
|
|
|
|
build-and-persist-packer-binary:
|
|
|
|
parameters:
|
|
|
|
GOOS:
|
|
|
|
type: string
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: GOOS=<< parameters.GOOS >> go build -ldflags="-s -w" -o ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH) .
|
|
|
|
- run: zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH).zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH)
|
|
|
|
- run: rm ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH)
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- ./pkg/
|
2018-11-14 12:37:31 -05:00
|
|
|
# Golang CircleCI 2.0 configuration file
|
|
|
|
#
|
|
|
|
# Check https://circleci.com/docs/2.0/language-go/ for more details
|
|
|
|
jobs:
|
2019-09-05 09:34:05 -04:00
|
|
|
test-linux:
|
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
2018-11-14 12:37:31 -05:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-02-26 09:25:22 -05:00
|
|
|
- run: make ci
|
2019-09-05 09:34:05 -04:00
|
|
|
test-darwin:
|
|
|
|
executor: darwin
|
|
|
|
working_directory: ~/go/src/github.com/hashicorp/packer
|
|
|
|
environment:
|
|
|
|
GO111MODULE: "off"
|
|
|
|
steps:
|
|
|
|
- install-go-run-tests-unix:
|
|
|
|
GOOS: darwin
|
|
|
|
GOVERSION: "1.13"
|
|
|
|
test-windows:
|
|
|
|
executor:
|
|
|
|
name: win/vs2019
|
|
|
|
shell: bash.exe
|
|
|
|
steps:
|
|
|
|
- install-go-run-tests-windows:
|
|
|
|
GOVERSION: "1.13"
|
2019-04-10 09:56:04 -04:00
|
|
|
check-vendor-vs-mod:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
environment:
|
|
|
|
GO111MODULE: "off"
|
2019-04-10 09:56:04 -04:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-04-12 07:15:46 -04:00
|
|
|
- run: GO111MODULE=on go run . --help
|
2019-04-10 09:56:04 -04:00
|
|
|
- run: make check-vendor-vs-mod
|
2019-05-27 09:37:03 -04:00
|
|
|
check-fmt:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
2019-05-27 09:37:03 -04:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: make fmt-check
|
2019-05-27 10:00:20 -04:00
|
|
|
check-generate:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
2019-05-27 10:00:20 -04:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: make generate-check
|
2019-05-01 07:50:57 -04:00
|
|
|
build_linux:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
steps:
|
|
|
|
- build-and-persist-packer-binary:
|
|
|
|
GOOS: linux
|
2019-05-01 07:50:57 -04:00
|
|
|
build_windows:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
steps:
|
|
|
|
- build-and-persist-packer-binary:
|
|
|
|
GOOS: windows
|
2019-05-01 07:50:57 -04:00
|
|
|
build_darwin:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
steps:
|
|
|
|
- build-and-persist-packer-binary:
|
|
|
|
GOOS: darwin
|
2019-05-01 07:50:57 -04:00
|
|
|
build_freebsd:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
steps:
|
|
|
|
- build-and-persist-packer-binary:
|
|
|
|
GOOS: freebsd
|
2019-05-01 07:50:57 -04:00
|
|
|
build_solaris:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
steps:
|
|
|
|
- build-and-persist-packer-binary:
|
|
|
|
GOOS: solaris
|
2019-05-01 07:50:57 -04:00
|
|
|
build_openbsd:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
steps:
|
|
|
|
- build-and-persist-packer-binary:
|
|
|
|
GOOS: openbsd
|
2019-05-09 04:40:57 -04:00
|
|
|
store_artifacts:
|
2019-09-05 09:34:05 -04:00
|
|
|
executor: golang
|
2019-05-09 04:40:57 -04:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- store_artifacts:
|
|
|
|
path: ./pkg/
|
2019-05-09 05:37:34 -04:00
|
|
|
destination: /
|
2019-05-09 09:04:40 -04:00
|
|
|
publish-github-tag-release:
|
|
|
|
docker:
|
|
|
|
- image: cibuilds/github:0.10
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run: |
|
2019-05-10 04:48:20 -04:00
|
|
|
ghr -prerelease -t ${GITHUB_TOKEN_AZR} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./pkg/
|
2019-04-10 09:56:04 -04:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2019-09-05 09:34:05 -04:00
|
|
|
test:
|
|
|
|
jobs:
|
|
|
|
- test-linux
|
|
|
|
- test-darwin
|
|
|
|
- test-windows
|
|
|
|
check-code:
|
2019-04-10 09:56:04 -04:00
|
|
|
jobs:
|
2019-05-01 07:50:57 -04:00
|
|
|
- check-vendor-vs-mod
|
2019-05-27 09:37:03 -04:00
|
|
|
- check-fmt
|
2019-05-27 10:00:20 -04:00
|
|
|
- check-generate
|
2019-09-05 09:34:05 -04:00
|
|
|
build_packer_binaries:
|
|
|
|
jobs:
|
2019-05-09 09:04:40 -04:00
|
|
|
- build_linux:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- build_darwin:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- build_windows:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- build_freebsd:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- build_openbsd:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
|
|
|
- build_solaris:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /.*/
|
2019-05-09 09:03:54 -04:00
|
|
|
- store_artifacts:
|
2019-05-09 04:40:57 -04:00
|
|
|
requires:
|
|
|
|
- build_linux
|
|
|
|
- build_darwin
|
|
|
|
- build_windows
|
|
|
|
- build_freebsd
|
|
|
|
- build_openbsd
|
|
|
|
- build_solaris
|
2019-05-09 09:04:40 -04:00
|
|
|
- publish-github-tag-release:
|
|
|
|
requires:
|
|
|
|
- build_linux
|
|
|
|
- build_darwin
|
|
|
|
- build_windows
|
|
|
|
- build_freebsd
|
|
|
|
- build_openbsd
|
|
|
|
- build_solaris
|
|
|
|
filters:
|
2019-05-09 10:15:03 -04:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2019-05-09 09:04:40 -04:00
|
|
|
tags:
|
|
|
|
only: nightly
|