ironic-python-agent/imagebuild/coreos/full_trusty_build.sh
Markos Chandras 4f938e8eb8 imagebuild: coreos: Build sha256 checksum files
Commit 3c2772650e ("imagebuild: tinyipa: Build sha256 checksum files")
extended the build process to generate sha256 checksum files for all
the tinyIPA files that are uploaded to mirrors. CoreOS builds are also
uploaded to mirrors so we need to build similar sha256 checksum files
as well.

Change-Id: I5de389f14001b6957e4b0aca772edf0e93b35af8
2017-03-02 15:44:29 +00:00

56 lines
2.0 KiB
Bash
Executable File

#!/bin/bash -xe
#
# From a base-trusty node, this should build a CoreOS IPA image
# suitable for use in testing or production.
#
BRANCH_PATH=${BRANCH_PATH:-master}
# NOTE(lucasagomes): List of dependencies for Red Hat systems
REDHAT_PACKAGES="docker-io gpg"
if [ -x "/usr/bin/apt-get" ]; then
sudo -E apt-get update
# apparmor is an undeclared dependency for docker on ubuntu
# https://github.com/docker/docker/issues/9745
sudo -E apt-get install -y docker.io apparmor cgroup-lite
elif [ -x "/usr/bin/dnf" ]; then
sudo -E dnf install -y $REDHAT_PACKAGES
elif [ -x "/usr/bin/yum" ]; then
sudo -E yum install -y $REDHAT_PACKAGES
else
echo "No supported package manager installed on system. Supported: apt, yum, dnf"
exit 1
fi
imagebuild/coreos/build_coreos_image.sh
BUILD_DIR=imagebuild/coreos/UPLOAD
if [ "$BRANCH_PATH" != "master" ]; then
# add the branch name
mv $BUILD_DIR/coreos_production_pxe_image-oem.cpio.gz $BUILD_DIR/coreos_production_pxe_image-oem-$BRANCH_PATH.cpio.gz
mv $BUILD_DIR/coreos_production_pxe.vmlinuz $BUILD_DIR/coreos_production_pxe-$BRANCH_PATH.vmlinuz
else
# in the past, we published master without branch name
# copy the files in this case such that both are published
cp $BUILD_DIR/coreos_production_pxe_image-oem.cpio.gz $BUILD_DIR/coreos_production_pxe_image-oem-$BRANCH_PATH.cpio.gz
cp $BUILD_DIR/coreos_production_pxe.vmlinuz $BUILD_DIR/coreos_production_pxe-$BRANCH_PATH.vmlinuz
fi
# Generate checksum files
pushd $BUILD_DIR > /dev/null
for x in *.vmlinuz *.cpio.gz; do
sha256sum $x > $x.sha256
done
popd > /dev/null
tar czf ipa-coreos-$BRANCH_PATH.tar.gz $BUILD_DIR/coreos_production_pxe_image-oem-$BRANCH_PATH.cpio.gz $BUILD_DIR/coreos_production_pxe-$BRANCH_PATH.vmlinuz
if [ "$BRANCH_PATH" = "master" ]; then
# again, publish with and without the branch on master for historical reasons
cp ipa-coreos-$BRANCH_PATH.tar.gz ipa-coreos.tar.gz
fi
# Generate checksum files
for x in *.tar.gz; do
sha256sum $x > $x.sha256
done