From 800aece1804174a6251f0c0603bf0541422f2ae5 Mon Sep 17 00:00:00 2001 From: Jeremy Mordkoff Date: Wed, 11 May 2016 20:43:28 -0400 Subject: [PATCH] fix mkvmimage Signed-off-by: Jeremy Mordkoff --- .gitignore | 1 - scripts/packaging/getbuild | 60 ++++++++++++++++++++++++++++++++++++++ scripts/vm_image/mkvmimg | 8 +++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100755 scripts/packaging/getbuild diff --git a/.gitignore b/.gitignore index b80a90a..791a558 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 0000000..b728031 --- /dev/null +++ b/scripts/packaging/getbuild @@ -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 + diff --git a/scripts/vm_image/mkvmimg b/scripts/vm_image/mkvmimg index 60bc1d2..97dd415 100755 --- a/scripts/vm_image/mkvmimg +++ b/scripts/vm_image/mkvmimg @@ -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 -- 2.25.1