Merge pull request #197 from bergwolf/fix-release

release: fix release scripts issues found in 1.3.0 and bump package versions
This commit is contained in:
Graham Whaley 2018-10-02 10:41:41 +01:00 committed by GitHub
commit d3e3d9c32a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 60 additions and 47 deletions

View File

@ -26,9 +26,6 @@ source "${script_dir}/scripts/obs-docker.sh"
GO_ARCH=$(go env GOARCH) GO_ARCH=$(go env GOARCH)
export GO_ARCH export GO_ARCH
OSCRC="${HOME}/.oscrc"
OBS_API="https://api.opensuse.org"
usage() { usage() {
msg="${1:-}" msg="${1:-}"
exit_code=$"${2:-0}" exit_code=$"${2:-0}"
@ -52,21 +49,6 @@ main() {
popd >>/dev/null popd >>/dev/null
#Build all kata packages #Build all kata packages
make -f "${script_dir}/Makefile" clean make -f "${script_dir}/Makefile" clean
if [ -n "${OBS_USER:-}" ] && [ -n "${OBS_PASS:-}" ] && [ ! -e "${OSCRC}" ]; then
echo "Creating ${OSCRC} with user $OBS_USER"
cat <<eom >"${OSCRC}"
[general]
apiurl = ${OBS_API}
[${OBS_API}]
user = ${OBS_USER}
pass = ${OBS_PASS}
eom
fi
if [ ! -e "${OSCRC}" ]; then
echo "${OSCRC}, please do 'export OBS_USER=your_user ; export OBS_PASS=your_pass' to configure osc for first time."
exit 1
fi
docker_run "${packaging_repo_dir}/obs-packaging/build_all.sh ${branch}" docker_run "${packaging_repo_dir}/obs-packaging/build_all.sh ${branch}"
} }

View File

@ -1,2 +1 @@
usr/share/Kata-containers usr/share/Kata-containers

View File

@ -8,11 +8,7 @@
%global DEFAULT_QEMU qemu-lite-system-x86_64 %global DEFAULT_QEMU qemu-lite-system-x86_64
%if 0%{?suse_version} %define LIBEXECDIR /usr/libexec
%define LIBEXECDIR %{_libdir}
%else
%define LIBEXECDIR %{_libexecdir}
%endif
%undefine _missing_build_ids_terminate_build %undefine _missing_build_ids_terminate_build
%define debug_package %{nil} %define debug_package %{nil}
@ -98,6 +94,9 @@ sed -i -e '/^initrd =/d' %{buildroot}/usr/share/defaults/kata-containers/configu
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/bin/kata-runtime /usr/bin/kata-runtime
%{LIBEXECDIR}
%{LIBEXECDIR}/kata-containers
%{LIBEXECDIR}/kata-containers/kata-netmon
/usr/bin/kata-collect-data.sh /usr/bin/kata-collect-data.sh
/usr/share/defaults/ /usr/share/defaults/
/usr/share/defaults/kata-containers/ /usr/share/defaults/kata-containers/

View File

@ -7,12 +7,38 @@
_obs_docker_packaging_repo_dir=$(cd $(dirname "${BASH_SOURCE[0]}") && cd ../.. && pwd) _obs_docker_packaging_repo_dir=$(cd $(dirname "${BASH_SOURCE[0]}") && cd ../.. && pwd)
GO_ARCH=$(go env GOARCH) GO_ARCH=$(go env GOARCH)
setup_oscrc() {
# oscrc exists at different places on different distros
[ -f "${HOME}/.config/osc/oscrc" ] && OSCRC="${HOME}/.config/osc/oscrc"
OSCRC=${OSCRC:-"${HOME}/.oscrc"}
OBS_API="https://api.opensuse.org"
if [ -n "${OBS_USER:-}" ] && [ -n "${OBS_PASS:-}" ] && [ ! -e "${OSCRC}" ]; then
echo "Creating ${OSCRC} with user $OBS_USER"
mkdir -p $(dirname $OSCRC)
cat <<eom >"${OSCRC}"
[general]
apiurl = ${OBS_API}
[${OBS_API}]
user = ${OBS_USER}
pass = ${OBS_PASS}
eom
fi
if [ ! -e "${OSCRC}" ]; then
echo "${OSCRC}, please do 'export OBS_USER=your_user ; export OBS_PASS=your_pass' to configure osc for first time."
exit 1
fi
}
docker_run() { docker_run() {
local cmd="$*" local cmd="$*"
local obs_image="obs-kata" local obs_image="obs-kata"
#where results will be stored #where results will be stored
local host_datadir="${PWD}/pkgs" local host_datadir="${PWD}/pkgs"
local cache_dir=${PWD}/obs-cache local cache_dir=${PWD}/obs-cache
setup_oscrc
sudo docker build \ sudo docker build \
--quiet \ --quiet \
--build-arg http_proxy="${http_proxy:-}" \ --build-arg http_proxy="${http_proxy:-}" \
@ -32,7 +58,7 @@ docker_run() {
-v "${cache_dir}":/var/tmp/osbuild-packagecache/ \ -v "${cache_dir}":/var/tmp/osbuild-packagecache/ \
-v "${_obs_docker_packaging_repo_dir}":"${_obs_docker_packaging_repo_dir}" \ -v "${_obs_docker_packaging_repo_dir}":"${_obs_docker_packaging_repo_dir}" \
-v "${host_datadir}":/var/packaging \ -v "${host_datadir}":/var/packaging \
-v "${HOME}/.oscrc":/root/.oscrc \ -v "${OSCRC}":/root/.oscrc \
-v "${PWD}":"${PWD}" \ -v "${PWD}":"${PWD}" \
-w "${PWD}" \ -w "${PWD}" \
-ti "${obs_image}" bash -c "${cmd}" -ti "${obs_image}" bash -c "${cmd}"

View File

@ -9,7 +9,7 @@
OBS_PKGS_PROJECTS=( OBS_PKGS_PROJECTS=(
qemu-lite qemu-lite
qemu-vanilla qemu-vanilla
kernel linux-container
kata-containers-image kata-containers-image
proxy proxy
shim shim

View File

@ -1,23 +1,23 @@
# This is a generated file from gen_versions_txt.sh # This is a generated file from gen_versions_txt.sh
kata_runtime_version=1.3.0~rc1 kata_runtime_version=1.3.0
kata_runtime_hash=22aedc4fb6b9a78a59f59df06f1b8d48021b952e kata_runtime_hash=a786643d0b3c0195deeb6ef5d4c2a161009a80aa
kata_proxy_version=1.3.0~rc1 kata_proxy_version=1.3.0
kata_proxy_hash=981fef4774ba15cf94a3a9013629d0ab60668348 kata_proxy_hash=6ddb006ad3f709cab018af9dc0bf9e756c3ce2cd
kata_shim_version=1.3.0~rc1 kata_shim_version=1.3.0
kata_shim_hash=9b2891cfb153967fa4a65e44b2928255c889f643 kata_shim_hash=5fbf1f0919ce0bb1f2b7e85692cdf3058023926f
kata_agent_version=1.3.0~rc1 kata_agent_version=1.3.0
kata_agent_hash=1ee972176ae437bcace0a37227818c506bb64ba9 kata_agent_hash=042c3ebd71c2ca425aa0c70fadcbf6370116659b
kata_ksm_throttler_version=1.3.0~rc1 kata_ksm_throttler_version=1.3.0
kata_ksm_throttler_hash=48a9568e0e9e134c4409f767a870b422ad31ff16 kata_ksm_throttler_hash=6e903fb19378a1a6132f8d3a43b65ee9c1643673
# Dependencies # Dependencies
kata_osbuilder_version=1.3.0~rc1 kata_osbuilder_version=1.3.0
qemu_lite_version=2.11.0 qemu_lite_version=2.11.0
qemu_lite_hash=f88622805677163b04498dcba35ceca0183b1318 qemu_lite_hash=f88622805677163b04498dcba35ceca0183b1318

View File

@ -128,12 +128,16 @@ install_kata_components() {
libexecdir="libexec" libexecdir="libexec"
if [ "$p" == "shim" ]; then if [ "$p" == "shim" ]; then
libexecdir="/${destdir}/${prefix}/libexec/" libexecdir="/${destdir}/${prefix}/libexec/"
fi
echo "Install"
make PREFIX="${prefix}" \ make PREFIX="${prefix}" \
DESTDIR="${destdir}" \ DESTDIR="${destdir}" \
LIBEXECDIR="${libexecdir}" \ LIBEXECDIR="${libexecdir}" \
install install
else
echo "Install"
make PREFIX="${prefix}" \
DESTDIR="${destdir}" \
install
fi
popd >>/dev/null popd >>/dev/null
done done
sed -i -e '/^initrd =/d' "${destdir}/${prefix}/share/defaults/${project}/configuration.toml" sed -i -e '/^initrd =/d' "${destdir}/${prefix}/share/defaults/${project}/configuration.toml"

View File

@ -144,10 +144,14 @@ create_github_release() {
repo_dir=${1:-} repo_dir=${1:-}
tag=${2:-} tag=${2:-}
[ -d "${repo_dir}" ] || die "No repository directory" [ -d "${repo_dir}" ] || die "No repository directory"
[ -n "${tag}" ] || die "No repository directory" [ -n "${tag}" ] || die "No tag specified"
if ! "${hub_bin}" release | grep "${tag}"; then if ! "${hub_bin}" release | grep -q "^${tag}$"; then
info "Creating Github release" info "Creating Github release"
"${hub_bin}" -C "${repo_dir}" release create -m "${PROJECT} ${tag}" "${tag}" if [[ "$tag" =~ "-rc" ]]; then
rc_args="-p"
fi
rc_args=${rc_args:-}
"${hub_bin}" -C "${repo_dir}" release create ${rc_args} -m "${PROJECT} ${tag}" "${tag}"
else else
info "Github release already created" info "Github release already created"
fi fi

View File

@ -42,7 +42,6 @@ ADD configure-hypervisor.sh /root/configure-hypervisor.sh
RUN PREFIX=/opt/kata /root/configure-hypervisor.sh -s kata-qemu | xargs ./configure \ RUN PREFIX=/opt/kata /root/configure-hypervisor.sh -s kata-qemu | xargs ./configure \
--with-pkgversion=kata-static --with-pkgversion=kata-static
RUN make clean
RUN make -j$(nproc) RUN make -j$(nproc)
RUN make install DESTDIR=/tmp/qemu-static RUN make install DESTDIR=/tmp/qemu-static
RUN cd /tmp/qemu-static && tar -czvf kata-qemu-static.tar.gz * RUN cd /tmp/qemu-static && tar -czvf kata-qemu-static.tar.gz *