From 63bb16732260732dd99485512dee0933f5cd7bea Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 15 Mar 2017 18:49:15 +0100 Subject: [PATCH] Initial scripts that can drive creation and removal of tags Change-Id: I71d24ae533e2131ea6690d20a5185ae47fa3b085 Signed-off-by: garciadeblas --- jenkins/release/delete-tag.sh | 25 ++++++++++++++++++ jenkins/release/new-tag.sh | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100755 jenkins/release/delete-tag.sh create mode 100755 jenkins/release/new-tag.sh diff --git a/jenkins/release/delete-tag.sh b/jenkins/release/delete-tag.sh new file mode 100755 index 00000000..358d6806 --- /dev/null +++ b/jenkins/release/delete-tag.sh @@ -0,0 +1,25 @@ +#!/bin/bash +HERE=$(realpath $(dirname $0)) +OSM_JENKINS=$(dirname $HERE) +echo $OSM_JENKINS +. $OSM_JENKINS/common/all_funcs + +[ $# -ne 1 ] && FATAL "arg1 is tag to be deleted" + +TAG="$1" + +TEMPDIR="$(mktemp -q -d --tmpdir "tagosm.XXXXXX")" +trap 'rm -rf "$TEMPDIR"' EXIT + +list="juju-charms devops descriptor-packages openvim RO SO UI" +for i in $list; do + REPO_FOLDER="$TEMPDIR/$i" + echo + echo "Cloning $i" + #git -C $TEMPDIR clone ssh://garciadeblas@osm.etsi.org:29418/osm/$i + git -C $REPO_FOLDER tag -d $TAG + git -C $REPO_FOLDER push origin :refs/tags/$TAG + sleep 2 + rm -rf $REPO_FOLDER +done + diff --git a/jenkins/release/new-tag.sh b/jenkins/release/new-tag.sh new file mode 100755 index 00000000..37c5193b --- /dev/null +++ b/jenkins/release/new-tag.sh @@ -0,0 +1,48 @@ +#!/bin/bash +HERE=$(realpath $(dirname $0)) +OSM_JENKINS=$(dirname $HERE) +echo $OSM_JENKINS +. $OSM_JENKINS/common/all_funcs + +[ $# -ne 2 ] && FATAL "arg1 is branch, arg2 is new tag" + +#CURRENT_BRANCH="v1.1" +#TAG="v1.1.0" +CURRENT_BRANCH="$1" +TAG="$2" + +#tag_header="OSM Release ONE:" +tag_header="OSM" +tag_message="$tag_header version $TAG" + +TEMPDIR="$(mktemp -q -d --tmpdir "tagosm.XXXXXX")" +trap 'rm -rf "$TEMPDIR"' EXIT +#chmod 0600 "$TEMPDIR" + +#juju-charms and devops repos have no vx.y branch yet +list="juju-charms devops" +for i in $list; do + REPO_FOLDER="$TEMPDIR/$i" + echo + echo "Cloning and tagging $i" + #git -C $TEMPDIR clone ssh://garciadeblas@osm.etsi.org:29418/osm/$i + git -C $REPO_FOLDER checkout master + git -C $REPO_FOLDER tag -a $TAG -m"$tag_message" + git -C $REPO_FOLDER push origin $TAG --follow-tags + sleep 2 + rm -rf $REPO_FOLDER +done + +list="descriptor-packages openvim RO SO UI" +for i in $list; do + REPO_FOLDER="$TEMPDIR/$i" + echo + echo "Cloning and tagging $i" + #git -C $TEMPDIR clone ssh://garciadeblas@osm.etsi.org:29418/osm/$i + git -C $REPO_FOLDER checkout $CURRENT_BRANCH + git -C $REPO_FOLDER tag -a $TAG -m"$tag_message" + git -C $REPO_FOLDER push origin $TAG --follow-tags + sleep 2 + rm -rf $REPO_FOLDER +done + -- 2.25.1