Commit 3a9db618ae654d4f6600531b4414781bec6ec464
1 parent
153143b5
Exists in
master
and in
17 other branches
Add a release script
Showing
2 changed files
with
22 additions
and
0 deletions
Show diff stats
.gitignore
| @@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
| 1 | +#!/bin/bash | ||
| 2 | +PROJECT=gitlab | ||
| 3 | +RELEASE_BUCKET=downloads-packages | ||
| 4 | +RELEASE_BUCKET_REGION=eu-west-1 | ||
| 5 | + | ||
| 6 | +function error_exit | ||
| 7 | +{ | ||
| 8 | + echo "$0: fatal error: $1" 1>&2 | ||
| 9 | + exit 1 | ||
| 10 | +} | ||
| 11 | + | ||
| 12 | +git diff --quiet HEAD || error_exit 'uncommited changes' | ||
| 13 | +git describe --exact-match || error_exit 'HEAD is not tagged' | ||
| 14 | +bin/omnibus clean --purge ${PROJECT} || error_exit 'clean failed' | ||
| 15 | +touch build.txt | ||
| 16 | +OMNIBUS_APPEND_TIMESTAMP=0 bin/omnibus build project ${PROJECT} || error_exit 'build failed' | ||
| 17 | +release_package=$(find pkg/ -mnewer build.txt -type f -not -name '*.json') | ||
| 18 | +if [[ -z ${release_package} ]]; then | ||
| 19 | + error_exit 'Could not find the release package' | ||
| 20 | +fi | ||
| 21 | +aws s3 cp ${release_package} s3://#{RELEASE_BUCKET} --acl public-read --region ${RELEASE_BUCKET_REGION} |