Skip to content

Commit

Permalink
Merge pull request #5 from buildkite/release-to-github
Browse files Browse the repository at this point in the history
Release to github
  • Loading branch information
lox authored Feb 26, 2019
2 parents 551a403 + daccf2b commit cbb9149
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
12 changes: 9 additions & 3 deletions .buildkite/pipeline.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ steps:
agents:
queue: "deploy"
concurrency: 1
concurrency_group: 'release_s3'


concurrency_group: 'release'

- wait
- label: ":github:"
command: ".buildkite/steps/github-release.sh"
branches: master
agents:
queue: "deploy"
concurrency: 1
concurrency_group: 'release'
2 changes: 2 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ steps:
- wait
- name: ":lambda:"
command: .buildkite/steps/build-lambda.sh
artifact_paths:
- handler.zip

- wait
- label: ":s3:"
Expand Down
5 changes: 4 additions & 1 deletion .buildkite/steps/build-lambda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
set -eux

make handler.zip
buildkite-agent artifact upload handler.zip

# set a version for later steps
buildkite-agent meta-data set version \
"$(awk -F\" '/const Version/ {print $2}' version/version.go)"
13 changes: 13 additions & 0 deletions .buildkite/steps/github-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

if [[ "$GITHUB_RELEASE_ACCESS_TOKEN" == "" ]]; then
echo "Error: Missing \$GITHUB_RELEASE_ACCESS_TOKEN"
exit 1
fi

VERSION=$(buildkite-agent meta-data get "version")
buildkite-agent artifact download "handler.zip" .

echo "--- 🚀 Releasing $VERSION"
github-release "v$VERSION" handler.zip "$(git rev-parse HEAD)"
2 changes: 1 addition & 1 deletion .buildkite/steps/upload-release-steps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail

export VERSION=$(awk -F\" '/const Version/ {print $2}' version/version.go)
VERSION=$(buildkite-agent meta-data get "version")

git fetch --prune origin "+refs/tags/*:refs/tags/*"

Expand Down
2 changes: 1 addition & 1 deletion .buildkite/steps/upload-to-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ EXTRA_REGIONS=(
sa-east-1
)

VERSION=$(awk -F\" '/const Version/ {print $2}' version/version.go)
VERSION=$(buildkite-agent meta-data get "version")
BASE_BUCKET=buildkite-lambdas
BUCKET_PATH="buildkite-agent-scaler"

Expand Down

0 comments on commit cbb9149

Please sign in to comment.