]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
extract_storage_kernel+modules: add support for feature branches
authorDongsu Park <dongsu.park@profitbricks.com>
Wed, 17 Apr 2013 12:05:44 +0000 (14:05 +0200)
committerDongsu Park <dongsu.park@profitbricks.com>
Wed, 17 Apr 2013 12:05:44 +0000 (14:05 +0200)
Now extract_storage_kernel+modules is able to copy kernel images
from feature branches. Output tar.gz file will be stored under
/srv/storage-kernels/$DISTRIBUTION/, where $DISTRIBUTION indicates
target name for a feature branch. (e.g. dev-feature-ssdcache-all)

extract_storage_kernel+modules.sh

index 885f4faf68558151dc468d16bb1444e43b705ea4..50b1cccc82ed5796cf27c10325389d5aeecae7a9 100755 (executable)
@@ -18,8 +18,15 @@ if [ "$DISTRIBUTION" = "production-proposed-updates" ] ; then
        export TARGET_NAME=master
 elif [ "$DISTRIBUTION" = "pre-staging" ] ; then
        export TARGET_NAME=develop
+elif [[ "$DISTRIBUTION" = dev-feature* ]] ; then
+       export TARGET_NAME=$DISTRIBUTION
+       FEATURE_APTCMD="
+       echo \"deb http://alexandria.pb.local/dev-repository $DISTRIBUTION main contrib non-free\" \
+       > /etc/apt/sources.list.d/profitbricks-linux-image-storage-$DISTRIBUTION.list
+       "
 else
-       echo "DISTRIBUTION must be 'production-proposed-updates' or 'pre-staging', exiting."
+       echo "DISTRIBUTION must be 'production-proposed-updates', 'pre-staging', or 'dev-feature*'."
+       echo "exiting."
        figlet "FAIL"
        exit 1
 fi
@@ -32,10 +39,12 @@ cat > $BUILD_SCRIPT <<-EOF
 #/bin/bash
 set -e
 set -x
+$FEATURE_APTCMD
 apt-get update
 # grub is needed in the postinst...
 apt-get install -y grub2 
-apt-get -y install profitbricks-andbd-modules-storage profitbricks-linux-image-storage || true
+apt-get -y install profitbricks-andbd-modules-storage || true
+apt-get -t $DISTRIBUTION -y install profitbricks-linux-image-storage || true
 mkdir -p $TARGET_DIR
 export KERNEL_VERSION=###(ls /boot/vmlinu* | cut -d "-" -f2-)
 export GENTOO_KERNEL_VERSION="###(ls /boot/vmlinu* | cut -d "-" -f2).$BUILD_NUMBER"