Fix full_trusty_build once and for all

After finally being able to test this locally, I've found that the
'cgroup-lite' package is what we were missing, not lxc.

Additionally, the output is written by root, not the current user, so
use sudo when modifying/writing files in imagebuild/coreos/UPLOAD.

Change-Id: I8cf5ce5bd5345ccea5e8869f2628f8616d0fe758
Closes-Bug: #1559383
This commit is contained in:
Jim Rollenhagen 2016-03-29 13:06:45 -07:00
parent 57d94f8a50
commit 473b6b4661

View File

@ -12,7 +12,7 @@ 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 lxc
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
@ -27,17 +27,17 @@ 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
sudo mv $BUILD_DIR/coreos_production_pxe_image-oem.cpio.gz $BUILD_DIR/coreos_production_pxe_image-oem-$BRANCH_PATH.cpio.gz
sudo 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
sudo cp $BUILD_DIR/coreos_production_pxe_image-oem.cpio.gz $BUILD_DIR/coreos_production_pxe_image-oem-$BRANCH_PATH.cpio.gz
sudo cp $BUILD_DIR/coreos_production_pxe.vmlinuz $BUILD_DIR/coreos_production_pxe-$BRANCH_PATH.vmlinuz
fi
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
sudo 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
sudo cp ipa-coreos-$BRANCH_PATH.tar.gz ipa-coreos.tar.gz
fi