-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add release script * add gitlab workflow * remove VERSION, the script use the VERSION file * install zip in the before_script * set VERSION var to the file content * PLINT-259 * apply suggestions
- Loading branch information
1 parent
8632cac
commit cf133e3
Showing
2 changed files
with
61 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,22 @@ | ||
variables: | ||
RELEASE_BUCKET: | ||
value: "cloudfoundry.datadoghq.com/datadog-cloudfoundry-buildpack" | ||
description: "Bucket where the buildpack release will be stored" | ||
DRY_RUN: | ||
value: "true" | ||
description: "Set to true to do a dry run" | ||
REPO_BRANCH: | ||
value: "master" | ||
description: "The branch to use" | ||
|
||
|
||
buildpack-prod-release: | ||
stage: deploy | ||
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/gitlab_agent_deploy:v6554890-8eae026 | ||
tags: ["runner:main"] | ||
when: manual | ||
before_script: | ||
- apt-get update -y && apt-get install -y zip | ||
script: | ||
- 'export PRODUCTION=true' | ||
- ./scripts/release.sh |
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,39 @@ | ||
#!/bin/bash -l | ||
|
||
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | ||
IFS=$'\n\t' | ||
set -euxo pipefail | ||
|
||
# Make sure variables are set | ||
PRODUCTION=${PRODUCTION:-"false"} | ||
STAGING=${STAGING:-"false"} | ||
DRY_RUN=${DRY_RUN:-"true"} | ||
RELEASE_BUCKET=${RELEASE_BUCKET:-"false"} | ||
REPO_BRANCH=${REPO_BRANCH:-"master"} | ||
|
||
|
||
VERSION=$(cat VERSION) | ||
|
||
git checkout $REPO_BRANCH | ||
|
||
echo "Preparing the buildpack" | ||
REFRESH_ASSETS=1 ./scripts/prepare.sh | ||
|
||
echo "Building the buildpack version $VERSION" | ||
./scripts/build.sh | ||
|
||
if [ "$DRY_RUN" == "true" ]; then | ||
exit 0 | ||
fi | ||
|
||
|
||
echo "publishing the buildpack artifact" | ||
|
||
if [ "$RELEASE_BUCKET" -a "$RELEASE_BUCKET" != "false" ]; then | ||
if [ "$PRODUCTION" = "true" ]; then | ||
# the production release bucket is cloudfoundry.datadoghq.com/datadog-cloudfoundry-buildpack | ||
aws s3 cp datadog-cloudfoundry-buildpack-$VERSION.zip s3://$RELEASE_BUCKET/datadog-cloudfoundry-buildpack-$VERSION.zip --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=id=3a6e02b08553fd157ae3fb918945dd1eaae5a1aa818940381ef07a430cf25732 | ||
|
||
aws s3 cp datadog-cloudfoundry-buildpack-$VERSION.zip s3://$RELEASE_BUCKET/datadog-cloudfoundry-buildpack-latest.zip --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=id=3a6e02b08553fd157ae3fb918945dd1eaae5a1aa818940381ef07a430cf25732 | ||
fi | ||
fi |