Last active
November 3, 2015 23:38
-
-
Save ndelitski/e5f6710bdcfa9026c69a to your computer and use it in GitHub Desktop.
ci scripts
This file contains hidden or 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
| #!/bin/bash | |
| set -e | |
| repo=${DOCKER_REGISTRY} | |
| [ -z "${DOCKER_REGISTRY}" ] && (echo "DOCKER_REGISTRY is missing"; exit 1) | |
| image=$(node -p "$(cat <<EOF | |
| require('./package.json').name.replace('synccloud.',''); | |
| EOF | |
| )") | |
| version=$(node -p "$(cat <<EOF | |
| require('./package.json').version; | |
| EOF | |
| )") | |
| container=$(echo $image | tr '.' '-') | |
| build() { | |
| docker build --pull --rm -t ${image} ./ | |
| } | |
| push() { | |
| local version=${1:-$version} | |
| docker tag -f ${image} ${repo}/${image}:${version} | |
| docker push ${repo}/${image}:${version} | |
| } | |
| build | |
| push $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment