2015-03-31 03:26:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Jenkins build steps
|
|
|
|
VERSION=$(git describe --always --abbrev=6)
|
|
|
|
ESCAPED_BRANCH_NAME=$(echo $sourceBranch | sed 's/[^a-z0-9A-Z_.-]/-/g')
|
|
|
|
|
2015-07-31 16:01:36 +00:00
|
|
|
# Try pulling the old build first for caching purposes.
|
|
|
|
docker pull resin/${ARCH}-supervisor:${ESCAPED_BRANCH_NAME} || docker pull resin/${ARCH}-supervisor:master || true
|
2016-09-30 19:57:57 +00:00
|
|
|
# Also pull the intermediate images, if possible, to improve caching
|
|
|
|
docker pull registry.resinstaging.io/resin/node-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} || docker pull registry.resinstaging.io/resin/node-supervisor-${ARCH}:master || true
|
|
|
|
docker pull registry.resinstaging.io/resin/go-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} || docker pull registry.resinstaging.io/resin/go-supervisor-${ARCH}:master || true
|
2015-07-31 16:01:36 +00:00
|
|
|
|
2015-07-23 21:14:50 +00:00
|
|
|
# Test the gosuper
|
2015-07-28 21:10:17 +00:00
|
|
|
make SUPERVISOR_VERSION=${VERSION} JOB_NAME=${JOB_NAME} test-gosuper
|
2015-07-23 21:14:50 +00:00
|
|
|
|
2016-04-14 13:04:46 +00:00
|
|
|
MAKE_ARGS="ARCH=${ARCH} \
|
|
|
|
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
|
|
|
|
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
|
|
|
|
MIXPANEL_TOKEN=${MIXPANEL_TOKEN}"
|
|
|
|
|
|
|
|
make ${MAKE_ARGS} \
|
|
|
|
SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
|
|
|
|
DEPLOY_REGISTRY= \
|
|
|
|
deploy
|
|
|
|
|
2016-09-30 19:57:57 +00:00
|
|
|
# Try to push the intermediate images to improve caching in future builds
|
2016-10-05 19:28:42 +00:00
|
|
|
docker tag -f resin/node-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} registry.resinstaging.io/resin/node-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} || true
|
|
|
|
docker tag -f resin/go-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} registry.resinstaging.io/resin/go-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} || true
|
2016-09-30 19:57:57 +00:00
|
|
|
docker push registry.resinstaging.io/resin/node-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} || true
|
|
|
|
docker push registry.resinstaging.io/resin/go-supervisor-${ARCH}:${ESCAPED_BRANCH_NAME} || true
|
|
|
|
|
2016-04-14 13:04:46 +00:00
|
|
|
make ${MAKE_ARGS} \
|
|
|
|
SUPERVISOR_VERSION=${VERSION} \
|
|
|
|
DEPLOY_REGISTRY= \
|
|
|
|
deploy
|
|
|
|
|
|
|
|
make ${MAKE_ARGS} \
|
|
|
|
SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
|
|
|
|
DEPLOY_REGISTRY=registry.resinstaging.io/ \
|
|
|
|
deploy
|
|
|
|
|
|
|
|
make ${MAKE_ARGS} \
|
|
|
|
SUPERVISOR_VERSION=${VERSION} \
|
|
|
|
DEPLOY_REGISTRY=registry.resinstaging.io/ \
|
|
|
|
deploy
|