2016-06-07 06:00:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
|
|
|
source ./scripts/version
|
|
|
|
|
2016-12-06 03:16:18 +00:00
|
|
|
BASEDOCKERFILE=./scripts/installer/BaseDockerfile.${ARCH}
|
2016-06-07 06:00:15 +00:00
|
|
|
DOCKERFILE=./scripts/installer/Dockerfile.${ARCH}
|
|
|
|
|
2016-12-04 11:27:06 +00:00
|
|
|
if [ ! -f $DOCKERFILE ] || [ ! -f dist/artifacts/vmlinuz-${KERNEL_VERSION} ] || [ ! -f dist/artifacts/initrd ]; then
|
2016-06-30 05:09:37 +00:00
|
|
|
exit 0
|
2016-06-07 06:00:15 +00:00
|
|
|
fi
|
|
|
|
|
2016-12-19 02:12:14 +00:00
|
|
|
# TODO maybe extract the cration of the syslinux cfg files
|
|
|
|
mkdir -p ${DIST}/boot/isolinux/
|
|
|
|
cat scripts/isolinux.cfg | envsubst > ${DIST}/boot/isolinux/isolinux.cfg
|
|
|
|
cat scripts/isolinux_label.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/linux-current.cfg
|
|
|
|
#cat scripts/isolinux_label.cfg | LABEL=debug APPEND="rancher.debug=true" envsubst > ${DIST}/boot/linux-previous.cfg
|
|
|
|
cat scripts/global.cfg | LABEL=${VERSION} envsubst > ${DIST}/boot/global.cfg
|
|
|
|
|
|
|
|
|
2016-06-07 06:00:15 +00:00
|
|
|
mkdir -p ./scripts/installer/build
|
2016-12-04 11:27:06 +00:00
|
|
|
cp ./dist/artifacts/initrd ./scripts/installer/build
|
|
|
|
cp ./dist/artifacts/vmlinuz-${KERNEL_VERSION} ./scripts/installer/build
|
2016-12-01 03:55:19 +00:00
|
|
|
cp ./bin/ros ./scripts/installer/build
|
2016-12-19 02:12:14 +00:00
|
|
|
cp -r ${DIST}/boot/* ./scripts/installer/build/
|
2016-06-07 06:00:15 +00:00
|
|
|
trap "rm -rf ./scripts/installer/build" EXIT
|
|
|
|
|
2016-12-06 03:16:18 +00:00
|
|
|
# installer base image - can be included in iso
|
|
|
|
# TODO: fix the fullinstaller Dockerfile to use the ${VERSION}${SUFFIX}
|
|
|
|
docker build \
|
|
|
|
-t ${OS_REPO}/os-installer \
|
2016-12-19 02:12:14 +00:00
|
|
|
--build-arg VERSION=${VERSION} \
|
|
|
|
--build-arg KERNEL_VERSION=${KERNEL_VERSION} \
|
2016-12-06 03:16:18 +00:00
|
|
|
-f $BASEDOCKERFILE \
|
|
|
|
./scripts/installer
|
|
|
|
docker save -o dist/artifacts/installer.tar ${OS_REPO}/os-installer
|
|
|
|
|
|
|
|
# Full installer image with initrd - used for pulling from network
|
2016-12-04 11:27:06 +00:00
|
|
|
docker build \
|
|
|
|
-t ${OS_REPO}/os:${VERSION}${SUFFIX} \
|
|
|
|
-f $DOCKERFILE \
|
|
|
|
./scripts/installer
|
2016-12-06 03:16:18 +00:00
|
|
|
|
|
|
|
docker save -o dist/artifacts/fullinstaller.tar ${OS_REPO}/os:${VERSION}${SUFFIX}
|
2016-11-24 01:35:27 +00:00
|
|
|
echo ${OS_REPO}/os:${VERSION}${SUFFIX} >> dist/images
|
2016-06-07 06:00:15 +00:00
|
|
|
echo Built ${OS_REPO}/os:${VERSION}${SUFFIX}
|