Additing execute permission to cloud-nightly.sh

Signed-off-by: Mohan Boddu <mboddu@redhat.com>
This commit is contained in:
Mohan Boddu 2017-02-17 18:51:47 -05:00
parent ca9bd37059
commit 1f7752e499

18
cloud-nightly.sh Normal file → Executable file
View File

@ -1,7 +1,11 @@
#!/bin/sh #!/bin/sh
#set -x #set -x
export LC_ALL=C export LC_ALL=C
LABEL=$1 LABEL=$1
CONFIG="fedora-cloud.conf" CONFIG="fedora-cloud.conf"
TARGET_DIR="/mnt/koji/compose/" TARGET_DIR="/mnt/koji/compose/"
#OLD_COMPOSES_DIR="--old-composes=/mnt/fedora_koji/compose/f23 --old-composes=$TARGET_DIR" #OLD_COMPOSES_DIR="--old-composes=/mnt/fedora_koji/compose/f23 --old-composes=$TARGET_DIR"
@ -24,6 +28,7 @@ ATOMICDEST="/mnt/koji/atomic/$BRANCHED/"
OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-24/COMPOSE_ID) OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-24/COMPOSE_ID)
# uncomment and edit for resuming a failed compose # uncomment and edit for resuming a failed compose
#COMPOSE_ID="Fedora-23-20150530.n.0" #COMPOSE_ID="Fedora-23-20150530.n.0"
# assume a releng dir is a git checkout of the releng repo # assume a releng dir is a git checkout of the releng repo
# if it does not exist clone it # if it does not exist clone it
if [ -d releng ]; then if [ -d releng ]; then
@ -33,14 +38,17 @@ if [ -d releng ]; then
else else
git clone https://pagure.io/releng.git git clone https://pagure.io/releng.git
fi fi
# Set up our fedmsg function, using the releng repo definition # Set up our fedmsg function, using the releng repo definition
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH") fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH") fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
FEDMSG_MODNAME="compose" FEDMSG_MODNAME="compose"
FEDMSG_CERTPREFIX="releng" FEDMSG_CERTPREFIX="releng"
. ./releng/scripts/fedmsg-functions.sh . ./releng/scripts/fedmsg-functions.sh
# Announce that we are starting, even though we don't know the compose_id yet.. # Announce that we are starting, even though we don't know the compose_id yet..
send_fedmsg "${fedmsg_json_start}" ${DIST} start send_fedmsg "${fedmsg_json_start}" ${DIST} start
pushd $TMPDIR pushd $TMPDIR
git clone https://pagure.io/fedora-comps.git && { git clone https://pagure.io/fedora-comps.git && {
pushd fedora-comps pushd fedora-comps
@ -49,31 +57,41 @@ git clone https://pagure.io/fedora-comps.git && {
popd popd
} }
popd popd
CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification --config=$CONFIG --old-composes=$TARGET_DIR $OLD_COMPOSES_DIR $NIGHTLY $SKIP_PHASES --label=$LABEL" CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification --config=$CONFIG --old-composes=$TARGET_DIR $OLD_COMPOSES_DIR $NIGHTLY $SKIP_PHASES --label=$LABEL"
if [ -z "$COMPOSE_ID" ]; then if [ -z "$COMPOSE_ID" ]; then
CMD="$CMD --target-dir=$TARGET_DIR" CMD="$CMD --target-dir=$TARGET_DIR"
else else
CMD="$CMD --debug-mode --compose-dir=$TARGET_DIR/$COMPOSE_ID" CMD="$CMD --debug-mode --compose-dir=$TARGET_DIR/$COMPOSE_ID"
fi fi
time $CMD "$@" time $CMD "$@"
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
export mail=0 export mail=0
fi fi
NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-24/COMPOSE_ID) NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-24/COMPOSE_ID)
SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g')
# Set this to use later for a few items include depcheck # Set this to use later for a few items include depcheck
DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID
$RSYNCPREFIX mkdir -p $DESTDIR $RSYNCPREFIX mkdir -p $DESTDIR
# Tell interested persons that the rsync is starting (zomg!) # Tell interested persons that the rsync is starting (zomg!)
send_fedmsg "${fedmsg_json_start}" ${DIST} rsync.start send_fedmsg "${fedmsg_json_start}" ${DIST} rsync.start
#for dir in CloudImage metadata ; #for dir in CloudImage metadata ;
# do # do
# $RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/$dir/ ; # $RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/$dir/ ;
# done # done
# Tell interested persons that the rsync is done. # Tell interested persons that the rsync is done.
#send_fedmsg "${fedmsg_json_done}" ${DIST} rsync.complete #send_fedmsg "${fedmsg_json_done}" ${DIST} rsync.complete
# Tell everyone by fedmsg about the compose # Tell everyone by fedmsg about the compose
send_fedmsg "${fedmsg_json_done}" ${DIST} complete send_fedmsg "${fedmsg_json_done}" ${DIST} complete
# Tell everyone by email about the compose # Tell everyone by email about the compose
SUBJECT='Fedora '$DIST' compose report: '$SHORTCOMPOSE_ID' changes' SUBJECT='Fedora '$DIST' compose report: '$SHORTCOMPOSE_ID' changes'
#if [ "$mail" = "0" ]; then #if [ "$mail" = "0" ]; then