diff --git a/_service b/_service
index b45226e..e980792 100644
--- a/_service
+++ b/_service
@@ -27,12 +27,6 @@
%%SHORT_VERSION%%
minor
etcd
-
-
- caasp-etcd-image.kiwi
- %%SHORT_VERSION%%
- minor
- etcd
kubic-etcd-image.kiwi
@@ -40,10 +34,4 @@
patch
etcd
-
- caasp-etcd-image.kiwi
- %%LONG_VERSION%%
- patch
- etcd
-
diff --git a/caasp-etcd-image.changes b/caasp-etcd-image.changes
deleted file mode 100644
index 1493ac8..0000000
--- a/caasp-etcd-image.changes
+++ /dev/null
@@ -1,12 +0,0 @@
--------------------------------------------------------------------
-Fri Nov 16 10:50:18 UTC 2018 - mjura@suse.com
-
-- Commit 61f2a43 by Michal Jura mjura@suse.com
-
- Build etcd container image for kubic project
-
--------------------------------------------------------------------
-Thu Nov 14 09:10:29 UTC 2018 - mjura@suse.com
-
-- Initial etcd image build
-
diff --git a/caasp-etcd-image.kiwi b/caasp-etcd-image.kiwi
deleted file mode 100644
index 194f057..0000000
--- a/caasp-etcd-image.kiwi
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
- SUSE Containers Team
- containers@suse.com
- Etcd running on a SLES15 container guest
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 4.0.1
- zypper
- false
- true
- true
- en_US
- us.map.gz
- utc
-
-
-
-
-
-
-
-
-
diff --git a/etcd-image.kiwi.ini b/etcd-image.kiwi.ini
index 0500acd..039cfab 100644
--- a/etcd-image.kiwi.ini
+++ b/etcd-image.kiwi.ini
@@ -1,6 +1,6 @@
-
+
@@ -13,7 +13,7 @@
image="docker"
derived_from="obsrepositories:/_BASEIMAGE_">
diff --git a/pre_checkin.sh b/pre_checkin.sh
new file mode 100644
index 0000000..e0e0677
--- /dev/null
+++ b/pre_checkin.sh
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+## pre_checkin.sh script is expected to be called from
+## a local copy of the build service image after running
+## the _services file, e.g. `osc service disabledrun`
+
+log() { echo ">>> $@" ; }
+abort() { log "FATAL: $@" ; exit 1 ; }
+usage() {
+ cat < /dev/null
+ changes_log=$(git log --pretty=format:"${git_log_format}" \
+ ${previous_commit} -- pre_checkin.sh \
+ "${image}" | sed "1 s/- \(.*$\)/\1/")
+ popd 1> /dev/null
+ [ -z "${changes_log}" ] && abort "Missing new changelog entries"
+ osc vc ${changes_file} -m "${changes_log}"
+}
+
+if [ "${namespace}" == "kubic" ]; then
+ product='kubic'
+ baseimage="opensuse/tumbleweed#current"
+ distro="openSUSE Kubic"
+elif [[ "${namespace}" =~ ^caasp/.* ]]; then
+ product='caasp'
+ baseimage="suse/sle15#latest"
+ distro="SLES15"
+else
+ usage
+ abort "Unknown product. Product needs to match 'kubic|caasp/.*'"
+fi
+
+set -e
+
+for file in *kiwi.ini; do
+ image="${file%%.kiwi.ini}"
+ changes_file="${product}-${image}.changes"
+ kiwi_file="${product}-${image}.kiwi"
+ extra_packages=""
+ extra_packages_file="${product}-extra-packages"
+
+ # Create a list of extra packages
+ if [ -f "${extra_packages_file}" ]; then
+ while read -r package; do
+ extra_packages+=" \n"
+ done < "${extra_packages_file}"
+ fi
+
+ # update the changes file, mostly used for automation in Concourse CI
+ [ -n "${mkchanges}" ] && make_changes_file
+
+ # create *.kiwi file from *kiwi.ini template
+ cp "${file}" "${kiwi_file}"
+ sed -i -e "s@_BASEIMAGE_@${baseimage}@g" \
+ -e "s@_DISTRO_@${distro}@g" \
+ -e "s@_NAMESPACE_@${namespace}@g" \
+ -e "s@_PRODUCT_@${product}@g" \
+ -e "/^\n" \
+ -e "s@_EXTRA_PACKAGES_@${extra_packages}@g" "${kiwi_file}"
+ # Remove blank lines
+ sed -i "/^ *$/d" "${kiwi_file}"
+ log "${kiwi_file} has been created"
+done
diff --git a/root.obscpio b/root.obscpio
index 376a779..4582212 100644
--- a/root.obscpio
+++ b/root.obscpio
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:27bc3876588c05f815a2d314c6906d0d8f5335cd0f4e070d85ae73f2b9e92c87
+oid sha256:8dcb027d73094373b7e1453af531a9f709066452cfce140984d852cf2c15ee70
size 2057