Skip to content

Commit

Permalink
OBS: add dependencies' versions
Browse files Browse the repository at this point in the history
This commit adds new entries in the versions.txt for indicating the
versions of the OBS packages in the stable repository. These are
added to the spec/dsc files in the "Requires" section and in order
to support the upgrade path when updating the runtime.

Fixes intel#1043

Signed-off-by: Erick Cardona <[email protected]>
  • Loading branch information
Erick Cardona committed Jul 25, 2017
1 parent 19b0afa commit 2c13fb1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ DEBTRANSFORM-RELEASE: 1

Package: cc-oci-runtime
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, qemu-lite, clear-containers-image, linux-container
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, qemu-lite (>=@qemu_lite_version@), clear-containers-image (>=@cc_image_version@), linux-container (>=@linux_container_version@)
Description: An Open Containers Initiative (OCI) "runtime" that launches an Intel VT-x secured Clear Containers 2.1 hypervisor, rather than a standard Linux container.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ BuildRequires : autoconf-archive
BuildRequires : autoconf
BuildRequires : automake
%endif
Requires: clear-containers-image
Requires: clear-containers-selinux
Requires: qemu-lite
Requires: linux-container
Requires: clear-containers-image >= @cc_image_version@
Requires: clear-containers-selinux >= @cc_selinux_version@
Requires: qemu-lite >= @qemu_lite_version@
Requires: linux-container >= @linux_container_version@
Patch1: update_commit_id.patch

%description
Expand Down
23 changes: 20 additions & 3 deletions data/obs-packaging/cc-oci-runtime/update_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ hash_tag=$(git log --oneline --pretty="%H %d" --decorate --tags --no-walk | grep
# If there is no tag matching $VERSION we'll get $VERSION as the reference
[ -z "$hash_tag" ] && hash_tag=$VERSION || :

# load versions
source ../../../versions.txt

OBS_PUSH=${OBS_PUSH:-false}
OBS_RUNTIME_REPO=${OBS_RUNTIME_REPO:-home:clearlinux:preview:clear-containers-staging/cc-oci-runtime}

Expand All @@ -37,8 +40,22 @@ function changelog_update {
}
changelog_update $VERSION

sed "s/@VERSION@/$VERSION/g;" cc-oci-runtime.spec-template > cc-oci-runtime.spec
sed "s/@VERSION@/$VERSION/g;" cc-oci-runtime.dsc-template > cc-oci-runtime.dsc
sed -e "s/@VERSION@/$VERSION/" \
-e "s/@qemu_lite_version@/$qemu_lite_fedora_obs_version/" \
-e "s/@cc_image_version@/$cc_image_fedora_obs_version/" \
-e "s/@cc_selinux_version@/$cc_selinux_fedora_obs_version/" \
-e "s/@linux_container_version@/$linux_container_fedora_obs_version/" cc-oci-runtime.spec-template > cc-oci-runtime.spec

sed -e "s/@VERSION@/$VERSION/" \
-e "s/@qemu_lite_version@/$qemu_lite_ubuntu_obs_version/" \
-e "s/@cc_image_version@/$cc_image_ubuntu_obs_version/" \
-e "s/@linux_container_version@/$linux_container_ubuntu_obs_version/" cc-oci-runtime.dsc-template > cc-oci-runtime.dsc

sed -e "s/@VERSION@/$VERSION/" \
-e "s/@qemu_lite_version@/$qemu_lite_ubuntu_obs_version/" \
-e "s/@cc_image_version@/$cc_image_ubuntu_obs_version/" \
-e "s/@linux_container_version@/$linux_container_ubuntu_obs_version/" debian.control-template > debian.control

sed "s/@VERSION@/$VERSION/g;" _service-template > _service
sed "s/@HASH_TAG@/$hash_tag/g;" update_commit_id.patch-template > update_commit_id.patch

Expand All @@ -50,13 +67,13 @@ then
osc co "$OBS_RUNTIME_REPO" -o $TMPDIR
mv cc-oci-runtime.spec \
cc-oci-runtime.dsc \
debian.control \
_service \
$TMPDIR
rm $TMPDIR/*.patch
cp debian.changelog \
debian.rules \
debian.compat \
debian.control \
debian.postinst \
debian.series \
*.patch \
Expand Down
11 changes: 11 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ qemu_lite_version=741f430a960b5b67745670e8270db91aeb083c5f
mpfr_version=3.1.4
gmp_version=6.1.0
mpc_version=1.0.3

# OBS Fedora package versions
cc_image_fedora_obs_version=16180-29.1
cc_selinux_fedora_obs_version=0.1-2.1
linux_container_fedora_obs_version=4.9.35-65.1
qemu_lite_fedora_obs_version=2.7.1+git.741f430-5.1

# OBS Ubuntu package versions
cc_image_ubuntu_obs_version=16180-22
linux_container_ubuntu_obs_version=4.9.35-62
qemu_lite_ubuntu_obs_version=2.7.1+git.741f430-5.1

0 comments on commit 2c13fb1

Please sign in to comment.