-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
150b4bf
commit 88301f3
Showing
5 changed files
with
48 additions
and
77 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
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
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 |
---|---|---|
@@ -1,50 +1,38 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
# build / lint agent in a container | ||
find . -name "goroot" -type d | xargs rm -rf | ||
mkdir goroot | ||
|
||
docker build -f Dockerfile.git -t golang-git:1.14-alpine . | ||
docker run --user $(id -u ${USER}):$(id -g ${USER}) -v ${PWD}/goroot:/go/ --rm golang-git:1.14-alpine /bin/sh -c 'go get github.com/signalsciences/tlstext && go get github.com/tinylib/msgp && go get github.com/alecthomas/gometalinter' | ||
./scripts/build-docker.sh | ||
|
||
# run module tests | ||
./scripts/test.sh | ||
|
||
BASE=$PWD | ||
## setup our package properties by distro | ||
PKG_NAME="sigsci-module-golang" | ||
DEST_BUCKET="package-build-artifacts" | ||
DEST_KEY="${PKG_NAME}/${GITHUB_RUN_NUMBER}" | ||
VERSION=$(cat ./VERSION) | ||
|
||
cd ${BASE} | ||
echo "DONE" | ||
|
||
# Main package | ||
aws s3api put-object \ | ||
--bucket "${DEST_BUCKET}" \ | ||
--cache-control="max-age=300" \ | ||
--content-type="application/octet-stream" \ | ||
--body "./artifacts/${PKG_NAME}.tar.gz" \ | ||
--key "${DEST_KEY}/${PKG_NAME}_${VERSION}.tar.gz" \ | ||
--grant-full-control id="${PROD_ID}" | ||
|
||
# Metadata files | ||
aws s3api put-object \ | ||
--bucket "${DEST_BUCKET}" \ | ||
--cache-control="max-age=300" \ | ||
--content-type="text/plain; charset=UTF-8" \ | ||
--body "VERSION" \ | ||
--key "${DEST_KEY}/VERSION" \ | ||
--grant-full-control id="${PROD_ID}" | ||
|
||
aws s3api put-object \ | ||
--bucket "${DEST_BUCKET}" \ | ||
--cache-control="max-age=300" \ | ||
--content-type="text/plain; charset=UTF-8" \ | ||
--body "CHANGELOG.md" \ | ||
--key "${DEST_KEY}/CHANGELOG.md" \ | ||
--grant-full-control id="${PROD_ID}" | ||
./scripts/build.sh | ||
|
||
if [ -n "${PROD_ID}" ]; then | ||
## setup our package properties by distro | ||
PKG_NAME="sigsci-module-golang" | ||
DEST_BUCKET="package-build-artifacts" | ||
DEST_KEY="${PKG_NAME}/${GITHUB_RUN_NUMBER}" | ||
VERSION=$(cat ./VERSION) | ||
|
||
# Main package | ||
aws s3api put-object \ | ||
--bucket "${DEST_BUCKET}" \ | ||
--cache-control="max-age=300" \ | ||
--content-type="application/octet-stream" \ | ||
--body "./artifacts/${PKG_NAME}.tar.gz" \ | ||
--key "${DEST_KEY}/${PKG_NAME}_${VERSION}.tar.gz" \ | ||
--grant-full-control id="${PROD_ID}" | ||
|
||
# Metadata files | ||
aws s3api put-object \ | ||
--bucket "${DEST_BUCKET}" \ | ||
--cache-control="max-age=300" \ | ||
--content-type="text/plain; charset=UTF-8" \ | ||
--body "VERSION" \ | ||
--key "${DEST_KEY}/VERSION" \ | ||
--grant-full-control id="${PROD_ID}" | ||
|
||
aws s3api put-object \ | ||
--bucket "${DEST_BUCKET}" \ | ||
--cache-control="max-age=300" \ | ||
--content-type="text/plain; charset=UTF-8" \ | ||
--body "CHANGELOG.md" \ | ||
--key "${DEST_KEY}/CHANGELOG.md" \ | ||
--grant-full-control id="${PROD_ID}" | ||
fi |
This file was deleted.
Oops, something went wrong.
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