mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 20:08:54 +00:00
This commit adds the necessary spec files and scripts in order to be able to create packages in OBS (Open Build System) and locally. Fixes #15 Signed-off-by: Erick Cardona <erick.cardona.ruiz@intel.com> Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
61 lines
1.2 KiB
Bash
Executable File
61 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2018 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
set -e
|
|
|
|
script_dir=$(dirname "$0")
|
|
#Note:Lets update qemu and the kernel first, they take longer to build.
|
|
#Note: runtime is build at the end to get the version from all its dependencies.
|
|
projects=(
|
|
qemu-lite
|
|
qemu-vanilla
|
|
kernel
|
|
kata-containers-image
|
|
proxy
|
|
shim
|
|
ksm-throttler
|
|
runtime
|
|
)
|
|
|
|
OSCRC="${HOME}/.oscrc"
|
|
PUSH=${PUSH:-""}
|
|
|
|
export BUILD_DISTROS=${BUILD_DISTROS:-xUbuntu_16.04}
|
|
# Packaging use this variable instead of use git user value
|
|
# On CI git user is not set
|
|
export AUTHOR="${AUTHOR:-user}"
|
|
export AUTHOR_EMAIL="${AUTHOR_EMAIL:-user@example.com}"
|
|
|
|
cd "$script_dir"
|
|
|
|
OBS_API="https://api.opensuse.org"
|
|
|
|
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 [ -n "${PUSH}" ]; then
|
|
# push to obs
|
|
PUSH_TO_OBS="-p"
|
|
else
|
|
# local build
|
|
PUSH_TO_OBS="-l"
|
|
fi
|
|
|
|
for p in "${projects[@]}"; do
|
|
pushd "$p" >> /dev/null
|
|
echo "update ${p}"
|
|
bash ./update.sh "${PUSH_TO_OBS}" -v
|
|
popd >> /dev/null
|
|
done
|