From 8c6ed7d0eb9b8420a7dc82a8fa1c03f32f05ab02 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Mon, 25 Aug 2014 15:34:38 -0700 Subject: [PATCH] Clean up image build script This change allows the image build script to support the existing jobs that build images for distribution, as well as future jobs that build the image within devstack for testing. Change-Id: I6cae0ce336fde872678fafe6ba2b31af465944a1 --- coreos/build_coreos_image.sh | 24 ++++++++++++++++++++++++ coreos/full_trusty_build.sh | 12 +++++------- 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100755 coreos/build_coreos_image.sh diff --git a/coreos/build_coreos_image.sh b/coreos/build_coreos_image.sh new file mode 100755 index 0000000..aa4c520 --- /dev/null +++ b/coreos/build_coreos_image.sh @@ -0,0 +1,24 @@ +#!/bin/bash -xe +# +# This builds a CoreOS IPA image, assuming dependencies are installed +# +# The system this runs on needs these binaries available, most of which +# are installed by default on Ubuntu Trusty: +# - docker +# - gzip / gunzip +# - uuidgen +# - cpio +# - find (gnu) +# - grep +# - gpg (to validate key of downloaded CoreOS image) +# +# Alternatively, run full_trusty_build.bash which will install +# all requirements then perform the build. + +if [[ -x /usr/bin/docker.io ]]; then + sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker +fi +cd imagebuild/coreos +sudo pip install -r requirements.txt +sudo make clean +sudo make diff --git a/coreos/full_trusty_build.sh b/coreos/full_trusty_build.sh index 9c3363f..5610b68 100755 --- a/coreos/full_trusty_build.sh +++ b/coreos/full_trusty_build.sh @@ -5,10 +5,8 @@ # sudo apt-get update sudo apt-get install -y docker.io -sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker -sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io -cd imagebuild/coreos/ -pwd -sudo pip install -r requirements.txt -sudo make -tar czf ../../ipa-coreos.tar.gz UPLOAD/coreos_production_pxe_image-oem.cpio.gz UPLOAD/coreos_production_pxe.vmlinuz + +imagebuild/coreos/build_coreos_image.sh + +BUILD_DIR=imagebuild/coreos/UPLOAD +tar czf ipa-coreos.tar.gz $BUILD_DIR/coreos_production_pxe_image-oem.cpio.gz $BUILD_DIR/coreos_production_pxe.vmlinuz