balena-supervisor/base-image/automation/jenkins-build.sh

26 lines
490 B
Bash
Raw Normal View History

#!/bin/bash
set -o errexit
set -o pipefail
date=$(date +'%Y%m%d' -u)
REPO='resin/amd64-supervisor-base'
git submodule update --init --recursive
rm -rf dest
mkdir dest
docker build -t supervisor-base-builder .
docker run --rm \
-v `pwd`:/source \
-v `pwd`/dest:/dest \
supervisor-base-builder
2016-07-02 01:07:27 +00:00
if [ -f dest/rootfs.tar.gz ]; then
cat dest/rootfs.tar.gz | docker import - $REPO:$date
docker tag -f $REPO:$date $REPO:latest
docker push $REPO
else
echo "rootfs is missing!"
exit 1
fi