dist/ci/deploy: automatically detect target project and package.

This commit is contained in:
Jimmy Berry 2017-10-06 17:48:39 -05:00
parent a99faac2ba
commit ace27a9385
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,5 @@
env:
global:
- OBS_TARGET_PROJECT="openSUSE:Factory"
- OBS_PACKAGE="openSUSE:Tools/openSUSE-release-tools"
- OBS_USER="jberry"
# OBS_PASS
@ -37,7 +36,7 @@ matrix:
deploy:
provider: script
script: docker run -it -e OBS_TARGET_PROJECT="$OBS_TARGET_PROJECT" -e OBS_PACKAGE="$OBS_PACKAGE" -e OBS_USER="$OBS_USER" -e OBS_PASS="$OBS_PASS" -e OBS_EMAIL="$OBS_EMAIL" spec ./dist/ci/deploy.obs.sh
script: docker run -it -e OBS_PACKAGE="$OBS_PACKAGE" -e OBS_USER="$OBS_USER" -e OBS_PASS="$OBS_PASS" -e OBS_EMAIL="$OBS_EMAIL" spec ./dist/ci/deploy.obs.sh
on:
branch: master
condition: $TEST_SUITE = distribution

View File

@ -19,7 +19,10 @@ osc addremove
osc commit -m "$(grep -oP 'version: \K.*' *.obsinfo)"
# Create submit request if none currently exists.
if osc request list "$OBS_TARGET_PROJECT" "$(cat .osc/_package)" | grep 'No results for package' ; then
OBS_TARGET_PROJECT="$(osc info | grep -oP "Link info: project \K[^\s,]+")"
OBS_TARGET_PACKAGE="$(osc info | grep -oP "Link info: .*, package \K[^\s,]+")"
echo "checking for existing requests to $OBS_TARGET_PROJECT/$OBS_TARGET_PACKAGE..."
if osc request list "$OBS_TARGET_PROJECT" "$OBS_TARGET_PACKAGE" | grep 'No results for package' ; then
osc service wait
osc sr --diff
osc sr --yes -m "automatic update"