Use a temporary directory for staging plugin

This way we don't rely on installed plugin (to avoid the deployment
cycle) and we don't need to install into the real home of the go user
to avoid risking that a broken plugin breaks all future jobs of the
agent
This commit is contained in:
Stephan Kulow 2019-05-30 21:48:48 +02:00
parent b2243b8b5f
commit f1c0d07f74
3 changed files with 58 additions and 22 deletions

View File

@ -17,4 +17,10 @@ pipelines:
resources: resources:
- staging-bot - staging-bot
tasks: tasks:
- script: osc staging -p openSUSE:Factory check_duplicate_binaries --save - script: |-
tempdir=$(mktemp -d)
mkdir -p $tempdir/.osc-plugins
ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
ln -s $PWD/osclib $tempdir/.osc-plugins
HOME=$tempdir osc staging -p openSUSE:Factory check_duplicate_binaries --save
rm -rf $tempdir

View File

@ -23,7 +23,7 @@ pipelines:
- repo-checker - repo-checker
tasks: tasks:
- script: |- - script: |-
python3 ./scripts/staging-installcheck.py -A https://api.opensuse.org -p openSUSE:Factory ./scripts/staging-installcheck.py -A https://api.opensuse.org -p openSUSE:Factory
SBot.Regular.Factory: SBot.Regular.Factory:
group: Factory.pkglistgen group: Factory.pkglistgen
lock_behavior: unlockWhenFinished lock_behavior: unlockWhenFinished
@ -44,12 +44,22 @@ pipelines:
resources: resources:
- staging-bot - staging-bot
tasks: tasks:
- script: osc -A https://api.opensuse.org staging -p openSUSE:Factory rebuild - script: |-
- script: osc -A https://api.opensuse.org staging -p openSUSE:Factory list --supersede set -e
- script: osc -A https://api.opensuse.org staging -p openSUSE:Factory adi --by-develproject tempdir=$(mktemp -d)
- script: osc -A https://api.opensuse.org staging -p openSUSE:Factory select --non-interactive --merge --try-strategies mkdir -p $tempdir/.osc-plugins
- script: osc -A https://api.opensuse.org staging -p openSUSE:Factory unselect --cleanup ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
- script: osc -A https://api.opensuse.org staging -p openSUSE:Factory repair --cleanup ln -s $PWD/osclib $tempdir/.osc-plugins
export HOME=$tempdir
osc -A https://api.opensuse.org staging -p openSUSE:Factory rebuild
osc -A https://api.opensuse.org staging -p openSUSE:Factory list --supersede
osc -A https://api.opensuse.org staging -p openSUSE:Factory adi --by-develproject
osc -A https://api.opensuse.org staging -p openSUSE:Factory select --non-interactive --merge --try-strategies
osc -A https://api.opensuse.org staging -p openSUSE:Factory unselect --cleanup
osc -A https://api.opensuse.org staging -p openSUSE:Factory repair --cleanup
rm -rf $tempdir
AdiChecker.Leap.15.1: AdiChecker.Leap.15.1:
group: openSUSE.Checkers group: openSUSE.Checkers
lock_behavior: unlockWhenFinished lock_behavior: unlockWhenFinished
@ -73,7 +83,7 @@ pipelines:
- repo-checker - repo-checker
tasks: tasks:
- script: |- - script: |-
python3 ./scripts/staging-installcheck.py -A https://api.opensuse.org -p openSUSE:Leap:15.1 ./scripts/staging-installcheck.py -A https://api.opensuse.org -p openSUSE:Leap:15.1
SBot.Regular.Leap.15.1: SBot.Regular.Leap.15.1:
group: Leap.15.1.pkglistgen group: Leap.15.1.pkglistgen
lock_behavior: unlockWhenFinished lock_behavior: unlockWhenFinished
@ -94,12 +104,22 @@ pipelines:
resources: resources:
- staging-bot - staging-bot
tasks: tasks:
- script: osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 rebuild - script: |-
- script: osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 list --supersede set -e
- script: osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 adi --by-develproject tempdir=$(mktemp -d)
- script: osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 select --non-interactive --merge --try-strategies mkdir -p $tempdir/.osc-plugins
- script: osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 unselect --cleanup ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
- script: osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 repair --cleanup ln -s $PWD/osclib $tempdir/.osc-plugins
export HOME=$tempdir
osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 rebuild
osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 list --supersede
osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 adi --by-develproject
osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 select --non-interactive --merge --try-strategies
osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 unselect --cleanup
osc -A https://api.opensuse.org staging -p openSUSE:Leap:15.1 repair --cleanup
rm -rf $tempdir
Project.Only: Project.Only:
group: openSUSE.Checkers group: openSUSE.Checkers
lock_behavior: unlockWhenFinished lock_behavior: unlockWhenFinished

View File

@ -25,7 +25,7 @@ pipelines:
- repo-checker - repo-checker
tasks: tasks:
- script: |- - script: |-
python3 ./scripts/staging-installcheck.py -A https://api.opensuse.org -p openSUSE:<%= project %> ./scripts/staging-installcheck.py -A https://api.opensuse.org -p openSUSE:<%= project %>
SBot.Regular.<%= nickname %>: SBot.Regular.<%= nickname %>:
group: <%= nickname %>.pkglistgen group: <%= nickname %>.pkglistgen
lock_behavior: unlockWhenFinished lock_behavior: unlockWhenFinished
@ -46,12 +46,22 @@ pipelines:
resources: resources:
- staging-bot - staging-bot
tasks: tasks:
- script: osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> rebuild - script: |-
- script: osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> list --supersede set -e
- script: osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> adi --by-develproject tempdir=$(mktemp -d)
- script: osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> select --non-interactive --merge --try-strategies mkdir -p $tempdir/.osc-plugins
- script: osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> unselect --cleanup ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
- script: osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> repair --cleanup ln -s $PWD/osclib $tempdir/.osc-plugins
export HOME=$tempdir
osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> rebuild
osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> list --supersede
osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> adi --by-develproject
osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> select --non-interactive --merge --try-strategies
osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> unselect --cleanup
osc -A https://api.opensuse.org staging -p openSUSE:<%= project %> repair --cleanup
rm -rf $tempdir
<% end -%> <% end -%>
Project.Only: Project.Only:
group: openSUSE.Checkers group: openSUSE.Checkers