From af2f93cebc62cd0d6f7c4b1a74fdeb65fbcf90a8 Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Mon, 13 Jun 2016 14:56:16 -0400 Subject: puppet-tripleo fork integration moving the github integration with pull requests into a function so we can continue to service opnfv-tht and also service opnfv-puppet-tripleo with the same code opnfv-puppet-tripleo-pr: 3 Change-Id: Ief2b1e7309defce9ed2029f6baade3c1371b7d96 Signed-off-by: Dan Radez --- build/undercloud.sh | 49 +++++++++---------------------------------------- 1 file changed, 9 insertions(+), 40 deletions(-) (limited to 'build/undercloud.sh') diff --git a/build/undercloud.sh b/build/undercloud.sh index 551dbd88..c1d7c3ab 100755 --- a/build/undercloud.sh +++ b/build/undercloud.sh @@ -10,57 +10,26 @@ set -e source ./cache.sh source ./variables.sh +source ./functions.sh populate_cache "$rdo_images_uri/undercloud.qcow2" if [ ! -d images ]; then mkdir images/; fi cp -f cache/undercloud.qcow2 images/undercloud_build.qcow2 -#Adding OpenStack packages to undercloud -pushd images > /dev/null - -# Use apex tripleo-heat-templates fork -PR_NUMBER="" -REF="stable/colorado" -REPO="https://github.com/trozet/opnfv-tht" - -if git log -1 | grep 'opnfv-tht-pr:' | grep -o '[0-9]*'; then - PR_NUMBER=$(git log -1 | grep 'opnfv-tht-pr:' | grep -o '[0-9]*') -fi - -if [ "$PR_NUMBER" != "" ]; then - echo "Using pull request $PR_NUMBER from $REPO" - # Source credentials since we are rate limited to 60/day - GHCREDS="" - if [ -f ~/.githubcreds ]; then - source ~/.githubcreds - GHCREDS=" -u $GHUSERNAME:$GHACCESSTOKEN" - fi - - PR=$(curl $GHCREDS https://api.github.com/repos/trozet/opnfv-tht/pulls/$PR_NUMBER) - - # Do not pull from merged branches - MERGED=$(python -c "import json; print json.loads('''$PR'''.replace('\n', '').replace('\r', ''))['merged']") - if [ "$MERGED" == "False" ]; then - REF=$(python -c "import json; print json.loads('''$PR'''.replace('\n', '').replace('\r', ''))['head']['ref']") - echo "Setting GitHub Ref to: $REF" - REPO=$(python -c "import json; print json.loads('''$PR'''.replace('\n', '').replace('\r', ''))['head']['repo']['clone_url']") - echo "Setting GitHub URL to: $REPO" - fi -fi - -rm -rf opnfv-tht -git clone $REPO -b $REF opnfv-tht - +# prep opnfv-tht for undercloud +clone_fork opnfv-tht pushd opnfv-tht > /dev/null git archive --format=tar.gz --prefix=openstack-tripleo-heat-templates/ HEAD > ../opnfv-tht.tar.gz popd > /dev/null -LIBGUESTFS_BACKEND=direct virt-customize --upload opnfv-tht.tar.gz:/usr/share \ - --run-command "cd /usr/share && rm -rf openstack-tripleo-heat-templates && tar xzf opnfv-tht.tar.gz" \ - -a undercloud_build.qcow2 -# install the packages above and enabling ceph to live on the controller +pushd images > /dev/null +# installing forked opnfv-tht +# enabling ceph OSDs to live on the controller # OpenWSMan package update supports the AMT Ironic driver for the TealBox +# seeding configuration files specific to OPNFV LIBGUESTFS_BACKEND=direct virt-customize \ + --upload ../opnfv-tht.tar.gz:/usr/share \ + --run-command "cd /usr/share && rm -rf openstack-tripleo-heat-templates && tar xzf opnfv-tht.tar.gz" \ --run-command "sed -i '/ControllerEnableCephStorage/c\\ ControllerEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \ --run-command "sed -i '/ComputeEnableCephStorage/c\\ ComputeEnableCephStorage: true' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" \ --run-command "curl http://download.opensuse.org/repositories/Openwsman/CentOS_CentOS-7/Openwsman.repo > /etc/yum.repos.d/wsman.repo" \ -- cgit 1.2.3-korg