balena-supervisor/automation/jenkins_build.sh
Petros Angelatos 488ca41621 build: implement multi-Dockerfile build process
This build strategy lends itself to how Rockerfiles work. In the build
Dockerfile all the build utilities (e.g gcc, python) are installed and
run the build process to produce some build artifacts. There are two
build Dockerfiles, one for the nodejs part and one for the golang part.
The build artifacts of these are combined into the runtime Dockerfile.
For all this to work there is some minimal glue implemented in the
Makefile.

Part of this commit is a switch of the base image the runtime is based
on to the minimal OpenEmbedded one produced by #198

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2016-09-14 01:38:35 +00:00

41 lines
1.1 KiB
Bash
Executable File

#!/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')
# Try pulling the old build first for caching purposes.
docker pull resin/${ARCH}-supervisor:${ESCAPED_BRANCH_NAME} || docker pull resin/${ARCH}-supervisor:master || true
# Test the gosuper
make SUPERVISOR_VERSION=${VERSION} JOB_NAME=${JOB_NAME} test-gosuper
MAKE_ARGS="ARCH=${ARCH} \
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
MIXPANEL_TOKEN=${MIXPANEL_TOKEN}"
# Disabled until this is merged in npm https://github.com/npm/npm/pull/13257
# make ${MAKE_ARGS} lint
make ${MAKE_ARGS} \
SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
DEPLOY_REGISTRY= \
deploy
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