1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

Refactor build scripts

This commit is contained in:
Darren Shepherd
2016-05-06 10:12:09 -07:00
parent acc2ee297a
commit ec410addb9
103 changed files with 1310 additions and 632 deletions

38
scripts/build-images Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
set -e
export ARCH=${ARCH:-"amd64"}
BASE=images
source $(dirname $0)/version
cd $(dirname $0)/..
DO_PUSH="$1"
if [ "${DO_PUSH}" == "--push" ]; then
for i in $BASE/[0-9]*; do
name="os-$(echo ${i} | cut -f2 -d-)"
tag="${OS_REPO}/${name}:${VERSION}${SUFFIX}"
echo Pushing ${tag}
docker push ${tag} || :
done
else
for i in $BASE/[0-9]*; do
name="os-$(echo ${i} | cut -f2 -d-)"
tag="${OS_REPO}/${name}:${VERSION}${SUFFIX}"
echo Building ${tag}
if [ -x ${i}/prebuild.sh ]; then
if ${i}/prebuild.sh; then
dapper -d --build -f ${i}/Dockerfile -- -t rancher/${name} ${i}
docker tag rancher/${name} ${tag}
elif [ "$?" != "42" ]; then
exit 1
else
echo "WARN: Skipping ${tag}"
fi
else
dapper -d --build -f ${i}/Dockerfile -- -t rancher/${name} ${i}
docker tag rancher/${name} ${tag}
fi
done
fi