Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release to github #5

Merged
merged 2 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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