This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
forked from hashicorp/terraform-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust ghr parameters to the correct values to post to github.
- Loading branch information
David Swift
committed
Jan 26, 2018
1 parent
2bc91af
commit b70f738
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
version: 2 | ||
jobs: | ||
build-job: | ||
docker: | ||
- image: circleci/golang:latest | ||
environment: | ||
- SRC_ROOT: "src/github.com/terraform-providers" | ||
working_directory: ~/terraform-provider-aws | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- golang-cache-1-9-2 | ||
- run: echo 'export GOPATH=$HOME/go' >> $BASH_ENV | ||
- checkout | ||
- run: | ||
name: Using Golang 1.9.2 | ||
command: | | ||
sudo rm -rf /usr/local/go | ||
if [ ! -e ~/go1.9.2.linux-amd64.tar.gz ]; then curl -o ~/go1.9.2.linux-amd64.tar.gz https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz; fi | ||
sudo tar -C /usr/local -xzf ~/go1.9.2.linux-amd64.tar.gz | ||
- run: | ||
name: Setting up Go workspace | ||
command: | | ||
rm -rf $GOPATH/$SRC_ROOT | ||
mkdir -p $GOPATH/$SRC_ROOT | ||
go get -u github.com/tcnksm/ghr | ||
go get -u github.com/golang/dep/cmd/dep | ||
go get -u github.com/hashicorp/terraform/plugin | ||
ln -s ~/terraform-provider-aws $GOPATH/$SRC_ROOT/terraform-provider-aws | ||
- run: | ||
name: Make and run basic tests on Linux | ||
command: cd $GOPATH/$SRC_ROOT/terraform-provider-aws && make && make test | ||
- run: | ||
name: Create MacOS package | ||
command: ./scripts/package.sh ${CIRCLE_TAG} | ||
- run: | ||
name: Move assets for deploy step | ||
command: mv $GOPATH/bin ~/terraform-provider-aws | ||
- save_cache: | ||
key: golang-cache-1-9-2 | ||
paths: | ||
- ~/go1.9.2.linux-amd64.tar.gz | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- ./bin | ||
- ./.git | ||
|
||
deploy-job: | ||
docker: | ||
- image: circleci/golang:latest | ||
environment: | ||
- SRC_ROOT: "src/github.com/terraform-providers" | ||
working_directory: ~/terraform-provider-aws | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
- run: echo 'export GOPATH=$HOME/go' >> $BASH_ENV | ||
- run: | ||
name: Release package to github | ||
command: bin/ghr -u "ValiMail" -r "terraform-provider-aws" "${CIRCLE_TAG}" "bin/darwin_amd64/terraform-provider-aws_${CIRCLE_TAG}" | ||
|
||
workflows: | ||
version: 2 | ||
build-deploy: | ||
jobs: | ||
- build-job: | ||
filters: | ||
tags: | ||
only: /^v.*_valimail.*/ | ||
branches: | ||
only: integration/valimail_aws_provider | ||
- deploy-job: | ||
requires: | ||
- build-job | ||
filters: | ||
tags: | ||
only: /^v.*_valimail.*/ | ||
branches: | ||
ignore: /.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
REV=$(git rev-parse HEAD | cut -c1-6) | ||
DEST="${GOPATH}/bin/darwin_amd64" | ||
|
||
BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%S%z) | ||
BUILD_FLAGS="-X main.Version=${REV} -X main.BuildDate='${BUILD_DATE}'" | ||
|
||
# | ||
# We follow the naming convention at https://www.terraform.io/docs/configuration/providers.html#third-party-plugins, | ||
# appending a '_valimail.#' string in github as part of the version tag for clarity | ||
# | ||
cd "${GOPATH}/${SRC_ROOT}" | ||
mkdir -p "${DEST}" | ||
|
||
GOOS=darwin GOARCH=amd64 go build -o "${DEST}/terraform-provider-aws_${CIRCLE_TAG}" terraform-provider-aws/main.go | ||
|