Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #919 from gorozco1/obs-cc-oci-runtime-2.1.8
Browse files Browse the repository at this point in the history
build: Update cc-oci-runtime obs builds with master
  • Loading branch information
jcvenegas authored May 19, 2017
2 parents f57a266 + eb9d185 commit 72d3a59
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
9 changes: 6 additions & 3 deletions data/obs-packaging/cc-oci-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
12 changes: 12 additions & 0 deletions data/obs-packaging/cc-oci-runtime/debian.changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
cc-oci-runtime (f57a266) stable; urgency=medium

* Update cc-oci-runtime f57a266 f57a266

-- Geronimo Orozco <[email protected]> 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 <[email protected]> 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
Expand Down
26 changes: 16 additions & 10 deletions data/obs-packaging/cc-oci-runtime/update_runtime.sh
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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
Expand All @@ -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
Expand All @@ -42,19 +44,23 @@ 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 \
debian.control \
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

0 comments on commit 72d3a59

Please sign in to comment.