Skip to content

Instantly share code, notes, and snippets.

@mandre
Last active January 5, 2016 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mandre/79a3cac0c6da9e713cfb to your computer and use it in GitHub Desktop.
Save mandre/79a3cac0c6da9e713cfb to your computer and use it in GitHub Desktop.
#!/bin/bash
TMPDIR=$(mktemp -d /tmp/tripleo-docker-patches.XXXXXXXXXX) || exit 1
INSTACK_UNDERCLOUD_PATCHES=(
# Disable auto activation of all volumes - https://review.openstack.org/#/c/248174/
https://review.openstack.org/changes/248174/revisions/c418409557607af245c7036df587686f8203bf75/
)
IRONIC_PATCHES=(
# Fix iPXE template for whole disk image - https://review.openstack.org/#/c/255362/
# NOT YET MERGED
https://review.openstack.org/changes/255362/revisions/952d5c5a06f35181768e52dd660afe548bc6fa60/
)
THT_PATCHES=(
# Docker compute role configured via Puppet - https://review.openstack.org/#/c/209505/
https://review.openstack.org/changes/209505/revisions/65958395f4ff4de30ccc927df855555cbe014be2/
# Change the Atomic image name so its less specific - https://review.openstack.org/#/c/243764/
https://review.openstack.org/changes/243764/revisions/266d123286e91bb733102ae20f607caeead520f2/
# Update docker compute environment to use json config - https://review.openstack.org/#/c/234313/
https://review.openstack.org/changes/234313/revisions/3a9186d6585d13528bf904a40556242c02ba4233/
# Add local docker registry support - https://review.openstack.org/#/c/237071/
https://review.openstack.org/changes/237071/revisions/092bcd9283db3379cc2ccc50499e7904d9647c25/
# Nova-libvirt needs to bind to /sys/fs/cgroup - https://review.openstack.org/#/c/241369/
https://review.openstack.org/changes/241369/revisions/1264b1bba2b7528b00d745533768a30896e064d7/
# Point registry at tripleoupstream - https://review.openstack.org/#/c/248214/
https://review.openstack.org/changes/248214/revisions/0eafa814d53cb3f0ed9f2db526c7eb58aa2e2f2f/
# Convert JSON generations from bash to python - https://review.openstack.org/#/c/253135/
# NOT YET MERGED
https://review.openstack.org/changes/253135/revisions/fbf77a28c9e13dc3b6caccc66da8587b54056c31/
# Network Isolation support for containerized compute - https://review.openstack.org/#/c/254304/
# NOT YET MERGED
https://review.openstack.org/changes/254304/revisions/d0191de349b191a70bfd4c05651961ee94f8c0e1/
# Use new heat docker agents image - https://review.openstack.org/#/c/253515/
# NOT YET MERGED
https://review.openstack.org/changes/253515/revisions/c49bfef8d46880fe23f4fd32ad194026c2b9806b/
# Remove hack the pulls latest docker - https://review.openstack.org/#/c/256129/
# NOT YET MERGED
https://review.openstack.org/changes/256129/revisions/3258256bae3b2f14dbe528f016cca585e964c02b/
)
fail() {
echo $1
rm -rf $TMPDIR
exit 1
}
apply_patch() {
local patch_url=$1
local patch_strip=$2
local target_dir=$3
# reviews.openstack.org has broken base64 support, see https://code.google.com/p/gerrit/issues/detail?id=3312
#curl -s ${patch_url}/patch?download | base64 -d > ${TMPDIR}/patch_to_apply.diff
curl -s ${patch_url}/patch?zip > ${TMPDIR}/patch.zip
unzip ${TMPDIR}/patch.zip -d ${TMPDIR}/patch_to_apply
patch -p $patch_strip -d $target_dir < ${TMPDIR}/patch_to_apply/*.diff || fail "failed to apply patch"
rm -rf ${TMPDIR}/patch.zip ${TMPDIR}/patch_to_apply
}
for p in ${THT_PATCHES[@]}; do
apply_patch $p 1 /usr/share/openstack-tripleo-heat-templates/
done
for p in ${INSTACK_UNDERCLOUD_PATCHES[@]}; do
apply_patch $p 2 /usr/share/instack-undercloud/
done
for p in ${IRONIC_PATCHES[@]}; do
apply_patch $p 1 /usr/lib/python2.7/site-packages/
done
rm -rf $TMPDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment