From eb9d185b49a5a7a334e0062145e6c11e4c6c4ba5 Mon Sep 17 00:00:00 2001 From: Geronimo Orozco Date: Thu, 18 May 2017 12:32:31 -0500 Subject: [PATCH] build: Update cc-oci-runtime automation with latest commits This commit adds improvements to the OBS automation tooling for cc-oci-runtime and updated changelog sent to the OBS builds. Signed-off-by: Geronimo Orozco --- data/obs-packaging/cc-oci-runtime/README.md | 9 ++++--- .../cc-oci-runtime/debian.changelog | 12 +++++++++ .../cc-oci-runtime/update_runtime.sh | 26 ++++++++++++------- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/data/obs-packaging/cc-oci-runtime/README.md b/data/obs-packaging/cc-oci-runtime/README.md index f8de3a93..1a222b5c 100644 --- a/data/obs-packaging/cc-oci-runtime/README.md +++ b/data/obs-packaging/cc-oci-runtime/README.md @@ -8,10 +8,13 @@ With these files we generated Fedora and Ubuntu packages for this component. ``./update_runtime.sh [VERSION]`` +The ``VERSION`` parameter is optional. The parameter can be a tag, a branch, +or a GIT hash. + +If the ``VERSION`` parameter is not specified, the top-level ``configure.ac`` +file will determine its value automatically. + This script will update the sources to create ``cc-oci-runtime`` packages. * cc-oci-runtime.dsc * cc-oci-runtime.spec - -By default, the script will get VERSION specified in the ``versions.txt`` file -found at the the repository's root. diff --git a/data/obs-packaging/cc-oci-runtime/debian.changelog b/data/obs-packaging/cc-oci-runtime/debian.changelog index 04d62ba1..de51ba7a 100644 --- a/data/obs-packaging/cc-oci-runtime/debian.changelog +++ b/data/obs-packaging/cc-oci-runtime/debian.changelog @@ -1,3 +1,15 @@ +cc-oci-runtime (f57a266) stable; urgency=medium + + * Update cc-oci-runtime f57a266 f57a266 + + -- Geronimo Orozco Fri, 19 May 2017 13:39:58 -0600 + +cc-oci-runtime (2.1.8) stable; urgency=medium + + * Update cc-oci-runtime 2.1.8 33f88c8 + + -- Geronimo Orozco Mon, 15 May 2017 14:57:15 -0600 + cc-oci-runtime (2.1.7) stable; urgency=medium * Update cc-oci-runtime 2.1.7 a1005b9 diff --git a/data/obs-packaging/cc-oci-runtime/update_runtime.sh b/data/obs-packaging/cc-oci-runtime/update_runtime.sh index 6988736c..944657cc 100755 --- a/data/obs-packaging/cc-oci-runtime/update_runtime.sh +++ b/data/obs-packaging/cc-oci-runtime/update_runtime.sh @@ -1,18 +1,20 @@ #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh - +# # Automation script to create specs to build cc-oci-runtime -# Default image to build is the one specified in file configure.ac +# Default: Build is the one specified in file configure.ac # located at the root of the repository. -# set -x +set -x AUTHOR=${AUTHOR:-$(git config user.name)} AUTHOR_EMAIL=${AUTHOR_EMAIL:-$(git config user.email)} CC_VERSIONS_FILE="../../../configure.ac" -DEFAULT_VERSION=$(cat ${CC_VERSIONS_FILE} | grep cc-oci-runtime | grep AC_INIT | tr -d '[](),' | awk '{print $2}') +DEFAULT_VERSION=$(sed -n -e 's/AC_INIT(.*,[ ]*\[\(.*\)\])/\1/p' ${CC_VERSIONS_FILE}) VERSION=${1:-$DEFAULT_VERSION} -hash_tag=`git log --oneline --pretty="%H %d" --decorate --tags --no-walk | grep $VERSION| awk '{print $1}'` +hash_tag=$(git log --oneline --pretty="%H %d" --decorate --tags --no-walk | grep $VERSION| awk '{print $1}') +# If there is no tag matching $VERSION we'll get $VERSION as the reference +[ -z "$hash_tag" ] && hash_tag=$VERSION || : OBS_PUSH=${OBS_PUSH:-false} @@ -21,6 +23,7 @@ echo "Update cc-oci-runtime $VERSION: ${hash_tag:0:7}" function changelog_update { d=`date +"%a, %d %b %Y %H:%M:%S"` + git checkout debian.changelog cp debian.changelog debian.changelog-bk cat <<< "cc-oci-runtime ($VERSION) stable; urgency=medium @@ -31,7 +34,6 @@ function changelog_update { cat debian.changelog-bk >> debian.changelog rm debian.changelog-bk } - changelog_update $VERSION sed "s/@VERSION@/$VERSION/g;" cc-oci-runtime.spec-template > cc-oci-runtime.spec @@ -42,11 +44,14 @@ sed "s/@HASH_TAG@/$hash_tag/g;" update_commit_id.patch-template > update_commit_ # Update and package OBS if [ "$OBS_PUSH" = true ] then - osc co home:clearlinux:preview:clear-containers-staging/cc-oci-runtime + temp=$(basename $0) + TMPDIR=$(mktemp -d -t ${temp}.XXXXXXXXXXX) || exit 1 + osc co home:clearlinux:preview:clear-containers-staging/cc-oci-runtime -o $TMPDIR mv cc-oci-runtime.spec \ cc-oci-runtime.dsc \ _service \ - home\:clearlinux\:preview\:clear-containers-staging/cc-oci-runtime/ + $TMPDIR + rm $TMPDIR/*.patch cp debian.changelog \ debian.rules \ debian.compat \ @@ -54,7 +59,8 @@ then debian.postinst \ debian.series \ *.patch \ - home\:clearlinux\:preview\:clear-containers-staging/cc-oci-runtime/ - cd home\:clearlinux\:preview\:clear-containers-staging/cc-oci-runtime/ + $TMPDIR + cd $TMPDIR + osc addremove osc commit -m "Update cc-oci-runtime $VERSION: ${hash_tag:0:7}" fi