fix mkvmimage v0.0
authorJeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Thu, 12 May 2016 00:43:28 +0000 (20:43 -0400)
committerJeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Thu, 12 May 2016 00:43:28 +0000 (20:43 -0400)
Signed-off-by: Jeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
.gitignore
scripts/packaging/getbuild [new file with mode: 0755]
scripts/vm_image/mkvmimg

index b80a90a..791a558 100644 (file)
@@ -29,7 +29,6 @@ scripts/env/
 scripts/install
 scripts/ldap
 scripts/nagios
-scripts/packaging/
 scripts/rift-scripts.sh.in
 scripts/rpm/
 scripts/system
diff --git a/scripts/packaging/getbuild b/scripts/packaging/getbuild
new file mode 100755 (executable)
index 0000000..b728031
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+#    Copyright 2016 RIFT.IO Inc
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+
+if [ -z "$RIFT_ROOT" ]; then
+    echo RIFT_ROOT not set. please load rift-shell
+    exit 1
+fi
+
+if ! which wget >/dev/null; then
+       echo "wget not found, install it with: sudo yum install wget"
+       exit 1;
+fi
+
+cd $RIFT_ROOT
+release=$(cat RELEASE)
+if [ -f ".build/BUILD" ]; then 
+    build=$(cat .build/BUILD)
+elif [ -z "$JOB_NAME" ]; then
+    echo "No Jenkins JOB_NAME"
+    printenv
+    ALT_JOB_NAME=${ENV, var="JOB_NAME"}
+    echo "ALT_JOB_NAME=${ALT_JOB_NAME}"
+    # not in Jenkins
+    build=1
+else
+    githash=$(git rev-parse  HEAD)
+    branch=$(git rev-parse --abbrev-ref HEAD)
+    username=$USER
+    hostname=$(hostname -s)
+    workspace=$RIFT_ROOT
+    jobname=$JOB_NAME
+    build=$(wget -O - -o /dev/null --post-data="githash=$githash&release=$release&branch=$branch&username=$username&hostname=$hostname&workspace=$workspace&jobname=$jobname" "http://charm:8000/postbuild/")
+    if [ -z "$build" ]; then
+        echo "Wget failed, data:githash=$githash&release=$release&branch=$branch&username=$username&hostname=$hostname&workspace=$workspace&jobname=$jobname"
+        build=1
+    fi
+fi
+
+echo build is $build
+
+# used for RPM packaging
+export RIFT_BUILD_NUMBER=$build
+mkdir -p .build
+echo -n $build >.build/BUILD
+echo -n ${release}.${build} >.build/VERSION
+
index 60bc1d2..97dd415 100755 (executable)
@@ -554,6 +554,12 @@ output_images() {
        done
 }
 
+install_host_packages() {
+
+       yum -y install nbd
+
+}
+
 RIFTROOT=$(dirname $(dirname $(dirname $(realpath $0))))
 BUILDDIR="${RIFTROOT}/.build/vm"
 
@@ -791,6 +797,8 @@ fi
 
 SEED_PATH=${BUILDDIR}/${SEED}
 
+install_host_packages
+
 if ! ${INSTALL_ONLY}; then
        fetch_seed
        setup