- public
# trigger obs build for master branch
-obs:
+obs:devel:
stage: deploy
only:
- master
dependencies: []
script:
+ - scripts/make-archive.sh
- scripts/make-distrofiles.sh
- echo -e "[general]\napiurl = https://api.opensuse.org\n\n[https://api.opensuse.org]\nuser = CZ-NIC\npass = $OBS_PASSWORD" > /root/.oscrc
- - scripts/build-in-obs.sh knot-devel
+ - scripts/build-in-obs.sh knot-dns-devel
- scripts/build-in-obs.sh knot-resolver-devel
#arm_build:
#!/bin/bash -e
# Example usage:
-# scripts/make-distrofiles.sh
-# scripts/build-in-obs.sh knot-resolver-devel
+# 1. place tarball to be released in git root dir
+# 2. scripts/make-distrofiles.sh
+# 3. scripts/build-in-obs.sh knot-resolver-latest
-repo=home:CZ-NIC:$1
+project=home:CZ-NIC:$1
+package=knot-resolver
-osc co "$repo" knot-resolver
-cd "$repo/knot-resolver"
-osc del *
+osc co "${project}" "${package}"
+pushd "${project}/${package}"
+osc del * ||:
cp ../../*.tar.xz ./
cp -rL ../../distro/fedora/* ./
cp -rL ../../distro/arch/* ./
cp ../../distro/debian/*.debian.tar.xz ./
-cp ../../distro/debian/knot-resolver.dsc ./
+cp "../../distro/debian/${package}.dsc" ./
osc addremove
osc ci -n
+popd
#!/bin/sh -e
# Create a distribution tarball, like 'make dist' from autotools.
cd "$(git rev-parse --show-toplevel)"
-ver="$(scripts/show-version.sh)"
+ver=$(git describe | sed 's/^v//' | sed 's/-/\./g')
test 0 -ne $(git status --porcelain | wc -l) && \
echo "Git working tree is dirty, make it clean first" && \
exit 1
#!/bin/bash -e
-scripts/make-archive.sh
+package=knot-resolver
cd "$(git rev-parse --show-toplevel)"
-VERSION=$(scripts/show-version.sh)
+version=$(ls ${package}*.tar.xz | sed "s/${package}-\(.*\).tar.xz/\1/")
+
+# Check version for invalid characters
+if [[ $(echo "${version}" | grep '^[[:alnum:].]$') -ne 0 ]]; then
+ echo "Invalid version number: may contain only alphanumeric characters and dots"
+ exit 1
+fi
# Fill in VERSION field in distribution specific files
-files='distro/fedora/knot-resolver.spec distro/arch/PKGBUILD distro/debian/debian/changelog distro/debian/knot-resolver.dsc'
-for file in $files; do
- sed -i "s/__VERSION__/$VERSION/g" "$file"
+files="distro/fedora/${package}.spec distro/debian/debian/changelog distro/debian/${package}.dsc distro/arch/PKGBUILD"
+for file in ${files}; do
+ sed -i "s/__VERSION__/${version}/g" "${file}"
done
# Rename archive to debian format
-mv knot-resolver-$VERSION.tar.xz knot-resolver_$VERSION.orig.tar.xz
+mv "${package}-${version}.tar.xz" "${package}_${version}.orig.tar.xz"
# Create debian archive and dsc
pushd distro/debian
-tar -chaf knot-resolver_$VERSION-1.debian.tar.xz debian
-archive=knot-resolver_$VERSION-1.debian.tar.xz
-echo " $(md5sum $archive | cut -d' ' -f1) $(wc -c $archive)" >> knot-resolver.dsc
+tar -chaf "${package}_${version}-1.debian.tar.xz" debian
+archive=${package}_${version}-1.debian.tar.xz
+echo " $(md5sum ${archive} | cut -d' ' -f1) $(wc -c ${archive})" >> ${package}.dsc
popd
-archive=knot-resolver_$VERSION.orig.tar.xz
-echo " $(md5sum $archive | cut -d' ' -f1) $(wc -c $archive)" >> distro/debian/knot-resolver.dsc
+archive=${package}_${version}.orig.tar.xz
+echo " $(md5sum ${archive} | cut -d' ' -f1) $(wc -c ${archive})" >> distro/debian/${package}.dsc
# Create a source rpm for Fedora/EPEL
cd "$(git rev-parse --show-toplevel)"
+scripts/make-archive.sh
scripts/make-distrofiles.sh
mv knot-resolver_*.orig.tar.xz distro/fedora/
cd distro/fedora
+++ /dev/null
-#!/bin/bash -e
-git describe | sed 's/^v//' | sed 's/-/\./g'