openSUSE-release-tools/dist/ci/obs-build-target
Jimmy Berry 4bc92ac0c1 dist/ci: rework spec.sh as obs-build-target using osc build.
Instead of performing a slim rpm build and check directly inside the
container a proper build is performed using `osc build`. The target
package is checked out the _service file pointed at the local copy
and then `osc service disabledrun` before building.
2017-10-19 21:58:49 -05:00

24 lines
445 B
Bash
Executable File

#!/bin/bash
set -x
SOURCE_DIR="${SOURCE_DIR:-/usr/src/target}"
repo="${1:-openSUSE_Tumbleweed}"
arch="${2:-x86_64}"
osc-init
osc checkout "$OBS_PACKAGE"
cd "$OBS_PACKAGE"
# point _service file to SOURCE_DIR instead of remote
sed -i "s|$(cd "$SOURCE_DIR" && git remote get-url origin)|$SOURCE_DIR|" _service
rm *.obscpio
osc service disabledrun
# skip interactive
osc diff | cat
osc build --trust-all-projects --no-verify "$repo" "$arch"