mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-27 20:18:57 +00:00
obs: docker-build: move osc file creation.
We need to create the osc file before enter the container. If build_all.sh is executed without a container and osc is intalled osc will ask for setup but in the container fails do to a missing tty. Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
dbe64e6461
commit
1a751c5214
@ -16,7 +16,6 @@ readonly script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
# shellcheck source=scripts/obs-docker.sh
|
# shellcheck source=scripts/obs-docker.sh
|
||||||
source "${script_dir}/scripts/obs-pkgs.sh"
|
source "${script_dir}/scripts/obs-pkgs.sh"
|
||||||
|
|
||||||
OSCRC="${HOME}/.oscrc"
|
|
||||||
PUSH=${PUSH:-""}
|
PUSH=${PUSH:-""}
|
||||||
LOCAL=${LOCAL:-""}
|
LOCAL=${LOCAL:-""}
|
||||||
PUSH_TO_OBS=""
|
PUSH_TO_OBS=""
|
||||||
@ -27,8 +26,6 @@ export BUILD_DISTROS=${BUILD_DISTROS:-xUbuntu_16.04}
|
|||||||
export AUTHOR="${AUTHOR:-user}"
|
export AUTHOR="${AUTHOR:-user}"
|
||||||
export AUTHOR_EMAIL="${AUTHOR_EMAIL:-user@example.com}"
|
export AUTHOR_EMAIL="${AUTHOR_EMAIL:-user@example.com}"
|
||||||
|
|
||||||
OBS_API="https://api.opensuse.org"
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
msg="${1:-}"
|
msg="${1:-}"
|
||||||
exit_code=$"${2:-0}"
|
exit_code=$"${2:-0}"
|
||||||
@ -43,16 +40,6 @@ EOT
|
|||||||
main() {
|
main() {
|
||||||
local branch="${1:-}"
|
local branch="${1:-}"
|
||||||
[ -n "${branch}" ] || usage "missing branch" "1"
|
[ -n "${branch}" ] || usage "missing branch" "1"
|
||||||
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
|
|
||||||
|
|
||||||
pushd "${script_dir}"
|
pushd "${script_dir}"
|
||||||
for p in "${OBS_PKGS_PROJECTS[@]}"; do
|
for p in "${OBS_PKGS_PROJECTS[@]}"; do
|
||||||
|
@ -26,6 +26,9 @@ 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}"
|
||||||
@ -49,6 +52,21 @@ 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}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user