Skip to content

Commit

Permalink
Hc 70 skip publish (#9)
Browse files Browse the repository at this point in the history
* HC-70 add switch for publishing and gzip image

* update README.md
  • Loading branch information
anaerobia authored Aug 19, 2019
1 parent 90a252a commit 73f1f52
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ These files are fully documented as part of the adapter Wiki pages: https://wiki
These scripts can be automatically generated using the scripts in hysds_cluster_setup, however; provided here is an example setup script
annotated with comments to give the user a basic understanding.

The SKIP_PUBLISH flag enable the user to optionally skip the step where it saves out the built image to disk, gzips it, and publishes it. This could be used in cases where a Jenkins job can use this feature for Pull Requests to verify a successful build. If its value is "noskip" then the image will be saved, otherwise the image will not be saved.

```
#!/bin/bash
#Pull the tag out from the provided GIT_BRANCH environment variable
Expand All @@ -36,8 +38,25 @@ REPO="${REPO//\//_}"
#Configure where the storage for containers lives, allowing us to upload the container product
STORAGE="s3://s3-us-west-2.amazonaws.com/my-code-bucket/"
export GIT_OAUTH_TOKEN="<GIT OAUTH TOKEN>"
export MOZART_REST_URL="<MOZART_REST_URL>"
export GRQ_REST_URL="<GRQ_REST_URL>"
export CONTAINER_REGISTRY="localhost:5050"
export CONTAINER_REGISTRY_BUCKET="container-registry-bucket"
export SKIP_PUBLISH="noskip"
#Run the container-builder
~/verdi/ops/container-builder/build-container.bash ${REPO} ${TAG} ${STORAGE} --build-arg id=1001 --build-arg gid=1001
if [ -z "$SKIP_PUBLISH" ]
then
export SKIP_PUBLISH="noskip";
fi
if [ ! -z "$CONTAINER_REGISTRY" -a ! -z "$CONTAINER_REGISTRY_BUCKET" ]
then
~/verdi/ops/verdi/ops/container-builder/build-container.bash \
${REPO} ${TAG} ${STORAGE} ${MOZART_REST_URL} ${GRQ_REST_URL} ${SKIP_PUBLISH} ${CONTAINER_REGISTRY} --build-arg GIT_OAUTH_TOKEN=${GIT_OAUTH_TOKEN} --build-arg BRANCH=${TAG}
else
~/verdi/ops/verdi/ops/container-builder/build-container.bash \
${REPO} ${TAG} ${STORAGE} ${MOZART_REST_URL} ${GRQ_REST_URL} ${SKIP_PUBLISH} "" --build-arg GIT_OAUTH_TOKEN=${GIT_OAUTH_TOKEN} --build-arg BRANCH=${TAG}
fi
```

## Extra features
Expand Down

0 comments on commit 73f1f52

Please sign in to comment.