2019-05-01 07:50:57 -04:00
|
|
|
defaults: &golang
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.12
|
|
|
|
working_directory: /go/src/github.com/hashicorp/packer
|
|
|
|
steps:
|
|
|
|
- checkout
|
2019-05-10 04:24:04 -04:00
|
|
|
- run: go build -ldflags="-s -w" -o ./pkg/packer_$(go env GOOS)_$(go env GOARCH) .
|
2019-05-09 10:08:24 -04:00
|
|
|
- run: zip ./pkg/packer_$(go env GOOS)_$(go env GOARCH).zip ./pkg/packer_$(go env GOOS)_$(go env GOARCH)
|
2019-05-09 04:28:55 -04:00
|
|
|
- run: rm ./pkg/packer_$(go env GOOS)_$(go env GOARCH)
|
2019-05-09 04:40:57 -04:00
|
|
|
- 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
|
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
2019-05-01 07:50:57 -04:00
|
|
|
<<: *golang
|
2018-11-14 12:37:31 -05:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-02-26 09:25:22 -05:00
|
|
|
- run: make ci
|
2019-04-10 09:56:04 -04:00
|
|
|
check-vendor-vs-mod:
|
2019-05-01 07:50:57 -04:00
|
|
|
<<: *golang
|
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-01 07:50:57 -04:00
|
|
|
build_linux:
|
|
|
|
<<: *golang
|
|
|
|
environment:
|
|
|
|
GOOS: linux
|
|
|
|
build_windows:
|
|
|
|
<<: *golang
|
|
|
|
environment:
|
|
|
|
GOOS: windows
|
|
|
|
build_darwin:
|
|
|
|
<<: *golang
|
|
|
|
environment:
|
|
|
|
GOOS: darwin
|
|
|
|
build_freebsd:
|
|
|
|
<<: *golang
|
|
|
|
environment:
|
|
|
|
GOOS: freebsd
|
|
|
|
build_solaris:
|
|
|
|
<<: *golang
|
|
|
|
environment:
|
|
|
|
GOOS: solaris
|
|
|
|
build_openbsd:
|
|
|
|
<<: *golang
|
|
|
|
environment:
|
|
|
|
GOOS: openbsd
|
2019-05-09 04:40:57 -04:00
|
|
|
store_artifacts:
|
|
|
|
<<: *golang
|
|
|
|
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
|
|
|
|
build_and_check_vendor_vs_module:
|
|
|
|
jobs:
|
|
|
|
- build
|
2019-05-01 07:50:57 -04:00
|
|
|
- check-vendor-vs-mod
|
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
|