Fabian Vogt 84450d10f6 Attempt to publish BCI repos more often
The goal is to publish the repo at most daily. Previously this was ensured
by simply running the bot only once a day. However, due to OBS and openQA
timing this was frequently attempted when either of those wasn't done yet,
which happened several times in a row. To not miss times when they align,
attempt publishing more often but skip a build if the previous publish was
recent enough.
2023-09-12 09:03:17 +02:00

477 lines
16 KiB
YAML

format_version: 3
pipelines:
BCI.RelPkgs:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Create.Release.Packages:
approval: manual
resources:
- repo-checker
tasks:
- script: ./pkglistgen.py -A https://api.opensuse.org update_and_solve -p devel:BCI -s target --only-release-packages --force
Pkglistgen.BCI:
group: BCI
lock_behavior: unlockWhenFinished
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
stages:
- pkglistgen:
approval:
type: manual
jobs:
BCI_target:
resources:
- repo-checker
tasks:
- script: python3 ./pkglistgen.py -d -A https://api.opensuse.org update_and_solve -p devel:BCI -s target
SLE_BCI_15SP3.RelPkgs:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Create.Release.Packages:
approval: manual
resources:
- repo-checker
tasks:
- script: ./pkglistgen.py -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP3:Update:BCI -s target --only-release-packages --force
Pkglistgen.SLE_BCI_15SP3:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
destination: repos
whitelist:
- SUSE:SLE-15-SP3:Update_-_standard.yaml
scripts:
auto_update: true
git: https://github.com/openSUSE/openSUSE-release-tools.git
whitelist:
- DO_NOT_TRIGGER
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- pkglistgen:
approval:
type: manual
jobs:
BCI_target:
resources:
- repo-checker
tasks:
- script: ./scripts/pkglistgen.py -d -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP3:Update:BCI -s target
- Expect.Images.To.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:SLE-15-SP3:Update:BCI -r images
- Release.Images.to.Product:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
resources:
- staging-bot
tasks:
# can't use osc command due to https://github.com/openSUSE/osc/issues/1194
- script: |-
SPRJ=SUSE:SLE-15-SP3:Update:BCI
for arch in aarch64 ppc64le s390x x86_64 ; do
PKG="000product:SLE_BCI-ftp-POOL-$arch"
PRJ="SUSE:Products:SLE-BCI:15-SP3:$arch"
curl -X POST -H "Authorization: Token $BCI_TOKEN" "https://api.suse.de/trigger/release?project=${SPRJ}&package=${PKG}&targetproject=${PRJ}&targetrepository=images&filter_source_repository=images"
done
for arch in aarch64 ppc64le s390x x86_64 ; do
sleep 600
while (osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep -v 'code="published" state="published">'); do
echo PENDING
sleep 600
done
osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
done
SLE_BCI_15SP3.RepoPublisher:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 23 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
stages:
- Run:
approval: manual
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/bci_repo_publish.py -A https://api.suse.de --verbose --debug run "--token=$BCI_TOKEN" 15-SP3
SLE_BCI_15SP4.RelPkgs:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Create.Release.Packages:
approval: manual
resources:
- repo-checker
tasks:
- script: ./pkglistgen.py -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP4:Update:BCI -s target --only-release-packages --force
Pkglistgen.SLE_BCI_15SP4:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
destination: repos
whitelist:
- SUSE:SLE-15-SP4:Update_-_standard.yaml
scripts:
auto_update: true
git: https://github.com/openSUSE/openSUSE-release-tools.git
whitelist:
- DO_NOT_TRIGGER
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- pkglistgen:
approval:
type: manual
jobs:
BCI_target:
resources:
- repo-checker
tasks:
- script: ./scripts/pkglistgen.py -d -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP4:Update:BCI -s target
- Expect.Images.To.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:SLE-15-SP4:Update:BCI -r images
- Release.Images.to.Product:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
resources:
- staging-bot
tasks:
# can't use osc command due to https://github.com/openSUSE/osc/issues/1194
- script: |-
SPRJ=SUSE:SLE-15-SP4:Update:BCI
for arch in aarch64 ppc64le s390x x86_64 ; do
PKG="000product:SLE_BCI-ftp-POOL-$arch"
PRJ="SUSE:Products:SLE-BCI:15-SP4:$arch"
curl -X POST -H "Authorization: Token $BCI_TOKEN" "https://api.suse.de/trigger/release?project=${SPRJ}&package=${PKG}&targetproject=${PRJ}&targetrepository=images&filter_source_repository=images"
done
for arch in aarch64 ppc64le s390x x86_64 ; do
sleep 600
while (osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep -v 'code="published" state="published">'); do
echo PENDING
sleep 600
done
osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
done
SLE_BCI_15SP4.RepoPublisher:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 23 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
stages:
- Run:
approval: manual
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/bci_repo_publish.py -A https://api.suse.de --verbose --debug run "--token=$BCI_TOKEN" 15-SP4
SLE_BCI_15SP5.RelPkgs:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Create.Release.Packages:
approval: manual
resources:
- repo-checker
tasks:
- script: ./pkglistgen.py -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP5:Update:BCI -s target --only-release-packages --force
Pkglistgen.SLE_BCI_15SP5:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
destination: repos
whitelist:
- SUSE:SLE-15-SP5:Update_-_standard.yaml
scripts:
auto_update: true
git: https://github.com/openSUSE/openSUSE-release-tools.git
whitelist:
- DO_NOT_TRIGGER
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- pkglistgen:
approval:
type: manual
jobs:
BCI_target:
resources:
- repo-checker
tasks:
- script: ./scripts/pkglistgen.py -d -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP5:Update:BCI -s target
- Expect.Images.To.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:SLE-15-SP5:Update:BCI -r images
- Release.Images.to.Product:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
resources:
- staging-bot
tasks:
# can't use osc command due to https://github.com/openSUSE/osc/issues/1194
- script: |-
SPRJ=SUSE:SLE-15-SP5:Update:BCI
for arch in aarch64 ppc64le s390x x86_64 ; do
PKG="000product:SLE_BCI-ftp-POOL-$arch"
PRJ="SUSE:Products:SLE-BCI:15-SP5:$arch"
curl -X POST -H "Authorization: Token $BCI_TOKEN" "https://api.suse.de/trigger/release?project=${SPRJ}&package=${PKG}&targetproject=${PRJ}&targetrepository=images&filter_source_repository=images"
done
for arch in aarch64 ppc64le s390x x86_64 ; do
sleep 600
while (osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep -v 'code="published" state="published">'); do
echo PENDING
sleep 600
done
osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
done
SLE_BCI_15SP5.RepoPublisher:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 23 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
stages:
- Run:
approval: manual
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/bci_repo_publish.py -A https://api.suse.de --verbose --debug run "--token=$BCI_TOKEN" 15-SP5
SLE_BCI_15SP6.RelPkgs:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Create.Release.Packages:
approval: manual
resources:
- repo-checker
tasks:
- script: ./pkglistgen.py -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP6:Update:BCI -s target --only-release-packages --force
Pkglistgen.SLE_BCI_15SP6:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 10 * ? * *
only_on_changes: false
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
destination: repos
whitelist:
- SUSE:SLE-15-SP6:Update_-_standard.yaml
scripts:
auto_update: true
git: https://github.com/openSUSE/openSUSE-release-tools.git
whitelist:
- DO_NOT_TRIGGER
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- pkglistgen:
approval:
type: manual
jobs:
BCI_target:
resources:
- repo-checker
tasks:
- script: ./scripts/pkglistgen.py -d -A https://api.suse.de update_and_solve -p SUSE:SLE-15-SP6:Update:BCI -s target
- Expect.Images.To.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:SLE-15-SP6:Update:BCI -r images
- Release.Images.to.Product:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
resources:
- staging-bot
tasks:
# can't use osc command due to https://github.com/openSUSE/osc/issues/1194
- script: |-
SPRJ=SUSE:SLE-15-SP6:Update:BCI
for arch in aarch64 ppc64le s390x x86_64 ; do
PKG="000product:SLE_BCI-ftp-POOL-$arch"
PRJ="SUSE:Products:SLE-BCI:15-SP6:$arch"
curl -X POST -H "Authorization: Token $BCI_TOKEN" "https://api.suse.de/trigger/release?project=${SPRJ}&package=${PKG}&targetproject=${PRJ}&targetrepository=images&filter_source_repository=images"
done
for arch in aarch64 ppc64le s390x x86_64 ; do
sleep 600
while (osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep -v 'code="published" state="published">'); do
echo PENDING
sleep 600
done
osc -A https://api.suse.de/ api "/build/$PRJ/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
done
SLE_BCI_15SP6.RepoPublisher:
group: BCI
lock_behavior: unlockWhenFinished
timer:
spec: 0 23 * ? * *
only_on_changes: false
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
BCI_TOKEN: '{{SECRET:[opensuse.secrets][BCI_TOKEN]}}'
stages:
- Run:
approval: manual
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/bci_repo_publish.py -A https://api.suse.de --verbose --debug run "--token=$BCI_TOKEN" 15-SP6