Skip to content

Commit

Permalink
Merge pull request clearcontainers#120 from erick0z/image_service
Browse files Browse the repository at this point in the history
image: remove debtools and use _service file
  • Loading branch information
gorozco1 authored Oct 9, 2017
2 parents 0530420 + 5487107 commit 37a03cb
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 41 deletions.
7 changes: 7 additions & 0 deletions clear-containers-image/_service-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<services>
<service name="download_url">
<param name="protocol">https</param>
<param name="host">download.clearlinux.org</param>
<param name="path">/releases/@VERSION@/clear/clear-@[email protected]</param>
</service>
</services>
16 changes: 16 additions & 0 deletions clear-containers-image/clear-containers-image.dsc-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Format: 3.0 (quilt)
Source: clear-containers-image
Version: @VERSION@-@RELEASE@
Section: devel
Priority: optional
Maintainer: clear containers team <[email protected]>
Build-Depends: debhelper (>= 9), flex, bison
Standards-Version: 3.9.6
Homepage: https://clearlinux.org/features/clear-containers
DEBTRANSFORM-TAR: clear-@[email protected]

Package: clear-containers-image
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends},
Description: Clear containers image

14 changes: 7 additions & 7 deletions clear-containers-image/clear-containers-image.spec-template
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
Name: clear-containers-image
Version: @VERSION@
Release: @RELEASE@
Release: @RELEASE@.<B_CNT>
License: Artistic-1.0 BSD-3-Clause BSD-3-Clause-Clear BSD-4-Clause-UC GFDL-1.3 GPL-2.0 GPL-2.0+ GPL-3.0 GPL-3.0+ LGPL-2.0 LGPL-2.0+ LGPL-2.1 LGPL-3.0+ MIT MPL-2.0 Public-Domain
Summary: Clear Containers Image
Url: https://download.clearlinux.org/
Group: image
Source0: https://download.clearlinux.org/releases/@VERSION@/clear/clear-@VERSION@-containers.img.xz
Source0: clear-%{version}-containers.tar.xz
Source1: LICENSE

%global debug_package %{nil}

%description
Clear Containers Image

%prep
cd %{_builddir}
cp %{_sourcedir}/clear-%{version}-containers.img.xz %{_builddir}
xz -d %{_builddir}/clear-%{version}-containers.img.xz
tar -C %{_builddir} -xvJf %{_sourcedir}/clear-%{version}-containers.tar.xz

%install
ImageDir=%{buildroot}/usr/share/clear-containers

mkdir -p ${ImageDir}
install -p clear-%{version}-containers.img ${ImageDir}/clear-%{version}-containers.img

install -p containers.img ${ImageDir}/clear-%{version}-containers.img
ln -sf clear-%{version}-containers.img ${ImageDir}/clear-containers.img

%files
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions clear-containers-image/debian.rules-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/make -f
version=@VERSION@
%:
dh $@

override_dh_install:
tar -C $(CURDIR) -xvJf ../SOURCES/clear-$(version)-containers.tar.xz
echo "Installing clear-containers-image"
install containers.img $(CURDIR)/debian/clear-containers-image/usr/share/clear-containers/clear-$(version)-containers.img
ln -sf /usr/share/clear-containers/clear-$(version)-containers.img $(CURDIR)/debian/clear-containers-image/usr/share/clear-containers/clear-containers.img
10 changes: 0 additions & 10 deletions clear-containers-image/obs_working_directory/debian/rules-template

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions clear-containers-image/release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
34
43 changes: 21 additions & 22 deletions clear-containers-image/update_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,54 @@ VERSION=${1:-$clear_vm_image_version}
OBS_PUSH=${OBS_PUSH:-false}
OBS_CC_IMAGE_REPO=${OBS_CC_IMAGE_REPO:-home:clearcontainers:clear-containers-3-staging/clear-containers-image}

git checkout obs_working_directory/debian/changelog
last_release=`cat obs_working_directory/debian/changelog | head -1 | awk '{print $2}' | cut -d'-' -f2 | tr -d ')'`
git checkout debian.changelog
last_release=$(cat release)
next_release=$(( $last_release + 1 ))

echo "Running: $0 $@"
echo "Update clear-containers-image to: $VERSION-$next_release"

function changelog_update {
d=$(date +"%a, %d %b %Y %H:%M:%S %z")
cp obs_working_directory/debian/changelog obs_working_directory/debian/changelog-bk
cp debian.changelog debian.changelog-bk
cat <<< "clear-containers-image ($VERSION-$next_release) stable; urgency=medium
* Update clear-containers-image $VERSION.
-- $AUTHOR <$AUTHOR_EMAIL> $d
" > obs_working_directory/debian/changelog
cat obs_working_directory/debian/changelog-bk >> obs_working_directory/debian/changelog
rm obs_working_directory/debian/changelog-bk
" > debian.changelog
cat debian.changelog-bk >> debian.changelog
rm debian.changelog-bk
}

changelog_update $VERSION

sed "s/\@VERSION\@/$VERSION/g; s/\@RELEASE\@/$next_release/g" clear-containers-image.spec-template > clear-containers-image.spec
sed "s/\@VERSION\@/$VERSION/g" obs_working_directory/debian/rules-template > obs_working_directory/debian/rules
sed "s/\@VERSION\@/$VERSION/g; s/\@RELEASE\@/$next_release/g" clear-containers-image.dsc-template > clear-containers-image.dsc
sed "s/\@VERSION\@/$VERSION/g" debian.rules-template > debian.rules
sed "s/@VERSION@/$VERSION/g" _service-template > _service

chmod +x obs_working_directory/debian/rules
spectool -g clear-containers-image.spec
tar -cJf clear-containers-image_$VERSION.orig.tar.xz clear-$VERSION-containers.img.xz LICENSE

cd obs_working_directory
debuild -S -sa
chmod +x debian.rules

if [ $? = 0 ] && [ "$OBS_PUSH" = true ]
then
temp=$(basename $0)
TMPDIR=$(mktemp -d -t ${temp}.XXXXXXXXXXX) || exit 1
cd ..
cc_image_dir=$(pwd)
rm clear-containers-image_*_source.build \
clear-containers-image_*_source.changes
osc co "$OBS_CC_IMAGE_REPO" -o $TMPDIR
cd $TMPDIR
osc rm clear-*-containers.img.xz
osc rm clear-containers-image_*
mv $cc_image_dir/clear-*-containers.img.xz .
mv $cc_image_dir/clear-containers-image_* .
rm -rf *.img.xz \
*tar.xz \
*orig.tar.xz
mv $cc_image_dir/clear-containers-image.spec .
mv $cc_image_dir/clear-containers-image.dsc .
mv $cc_image_dir/_service .
mv $cc_image_dir/debian.rules .
cp $cc_image_dir/LICENSE .
osc add clear-*-containers.img.xz
osc add clear-containers-image_*
cp $cc_image_dir/debian.control .
cp $cc_image_dir/debian.compat .
cp $cc_image_dir/debian.changelog .
cp $cc_image_dir/debian.dirs .
osc addremove
osc commit -m "Update clear-containers-image to: $VERSION-$next_release"
fi
2 changes: 1 addition & 1 deletion versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cc_proxy_version=3.0.2
cc_runtime_version=3.0.2
cc_shim_version=3.0.2
clear_vm_kernel_version=4.9.47-77
clear_vm_image_version=17270
clear_vm_image_version=18220
qemu_lite_version=2.7.1

# OBS package versions
Expand Down

0 comments on commit 37a03cb

Please sign in to comment.