openSUSE-release-tools/gocd/dolomite.target.gocd.yaml

249 lines
9.5 KiB
YAML
Raw Normal View History

2023-06-02 10:45:41 +02:00
format_version: 3
pipelines:
2023-07-17 13:49:17 +02:00
Dolomite.Images:
2023-06-02 10:45:41 +02:00
group: ALP.Target
lock_behavior: unlockWhenFinished
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
whitelist:
2023-07-17 13:49:17 +02:00
- SUSE:ALP:Products:Dolomite:1.0_-_images.yaml
2023-06-02 10:45:41 +02:00
destination: repos
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:
- Expect.Images.To.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
set -e
2023-07-17 13:49:17 +02:00
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:ALP:Products:Dolomite:1.0 -r images
2023-06-02 10:45:41 +02:00
- Release.Images.To.Test:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
resources:
- staging-bot
tasks:
- script: |-
set -e
2023-07-21 12:19:29 +02:00
PRODUCTS=$(osc -A https://api.suse.de ls SUSE:ALP:Products:Dolomite:1.0 | grep "^ALP-Dolomite" | grep -v release | grep -v : ||:)
2023-06-02 10:45:41 +02:00
if [ -z "${PRODUCTS}" ]; then
echo "[WARNNING] There is no image to be released"
fi
for product in 000product $PRODUCTS; do
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de release SUSE:ALP:Products:Dolomite:1.0 $product
2023-06-02 10:45:41 +02:00
done
sleep 600
2023-07-17 13:49:17 +02:00
while (osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:ToTest/_result?view=summary&repository=images" | grep "result project" | grep -v 'code="published" state="published">'); do
2023-06-02 10:45:41 +02:00
echo PENDING
sleep 600
done
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:ToTest/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
2023-06-02 10:45:41 +02:00
- Release.Images.To.Publish:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
resources:
- staging-bot
tasks:
- script: |-
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de release SUSE:ALP:Products:Dolomite:1.0:ToTest
2023-06-02 10:45:41 +02:00
sleep 600
2023-07-17 13:49:17 +02:00
while (osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=containers" | grep "result project" | grep -v 'code="published" state="published">'); do
2023-06-02 10:45:41 +02:00
echo PENDING
sleep 600
done
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=containers" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
while (osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=images" | grep "result project" | grep -v 'code="published" state="published">'); do
2023-06-02 10:45:41 +02:00
echo PENDING
sleep 600
done
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
2023-06-02 10:45:41 +02:00
2023-07-17 13:49:17 +02:00
Dolomite.Images.NEW:
2023-06-02 10:45:41 +02:00
group: ALP.Target
lock_behavior: unlockWhenFinished
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
whitelist:
2023-07-17 13:49:17 +02:00
- SUSE:ALP:Products:Dolomite:1.0_-_images.yaml
2023-06-02 10:45:41 +02:00
destination: repos
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:
- Expect.Images.To.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
set -e
2023-07-17 13:49:17 +02:00
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:ALP:Products:Dolomite:1.0 -r containerfile
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:ALP:Products:Dolomite:1.0 -r images
2023-06-02 10:45:41 +02:00
- Release.Images.To.Test:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
JIRA_PAT: /home/go/config/jira-pat
JIRA_INSTANCE: /home/go/config/jira-instance
resources:
- staging-bot
tasks:
- script: |-
2023-07-17 13:49:17 +02:00
sle-prjmgr-tools --jira-instance $JIRA_INSTANCE --osc-config $OSC_CONFIG ibs_to_jira --jira-pat $JIRA_PAT -p SUSE:ALP:Products:Dolomite:1.0
2023-06-02 10:45:41 +02:00
- Release.Images.To.Publish:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
resources:
- staging-bot
tasks:
- script: |-
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de release SUSE:ALP:Products:Dolomite:1.0:ToTest
2023-06-02 10:45:41 +02:00
sleep 600
2023-07-17 13:49:17 +02:00
while (osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=containers" | grep "result project" | grep -v 'code="published" state="published">'); do
2023-06-02 10:45:41 +02:00
echo PENDING
sleep 600
done
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=containers" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
while (osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=images" | grep "result project" | grep -v 'code="published" state="published">'); do
2023-06-02 10:45:41 +02:00
echo PENDING
sleep 600
done
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Dolomite:1.0:PUBLISH/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
2023-06-02 10:45:41 +02:00
2023-07-17 13:49:17 +02:00
Dolomite.ImagesManual:
2023-06-02 10:45:41 +02:00
group: ALP.Target
lock_behavior: unlockWhenFinished
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
whitelist:
2023-07-17 13:49:17 +02:00
- SUSE:ALP:Products:Dolomite:1.0_-_images.yaml
2023-06-02 10:45:41 +02:00
destination: repos
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:
- Relase.Images.To.Test:
approval: manual
roles:
- SLE
jobs:
Check.Images.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
2023-07-17 13:49:17 +02:00
while (! ./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:ALP:Products:Dolomite:1.0 -r images); do
2023-06-02 10:45:41 +02:00
sleep 300
done
Release.To.Test:
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
resources:
- staging-bot
tasks:
- script: |-
set -e
2023-07-21 12:19:29 +02:00
PRODUCTS=$(osc -A https://api.suse.de ls SUSE:ALP:Products:Dolomite:1.0 | grep "^ALP-Dolomite" | grep -v release)
2023-06-02 10:45:41 +02:00
for product in 000product $PRODUCTS; do
2023-07-17 13:49:17 +02:00
osc -A https://api.suse.de release SUSE:ALP:Products:Dolomite:1.0 $product
2023-06-02 10:45:41 +02:00
done
- Release.Images.To.Publish:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
resources:
- staging-bot
tasks:
2023-07-17 13:49:17 +02:00
- script: osc -A https://api.suse.de release SUSE:ALP:Products:Dolomite:1.0:ToTest
2023-06-02 10:45:41 +02:00
2023-07-17 13:49:17 +02:00
Dolomite.ReleaseScc:
2023-06-02 10:45:41 +02:00
group: ALP.Target
parameters:
2023-07-17 13:49:17 +02:00
product: dolomite-1.0
2023-06-02 10:45:41 +02:00
target: MyTarget
build: "0.0"
materials:
scripts:
auto_update: true
git: https://github.com/openSUSE/openSUSE-release-tools.git
whitelist:
- DO_NOT_TRIGGER
destination: scripts
stages:
# "ratt" is an alias for the internal IP of the API, only available on botmaster.
- Release.Images.Update:
approval: manual
roles:
- SLE
resources:
- staging-bot
tasks:
- script: curl --verbose --max-time 3600 "http://ratt:5000/update?product=#{product}&target=#{target}&build=#{build}"
- Release.Images.Rename:
approval: manual
roles:
- SLE
resources:
- staging-bot
tasks:
- script: curl --verbose --max-time 3600 "http://ratt:5000/rename?product=#{product}&target=#{target}"
- Release.Images.Sync:
approval: manual
roles:
- SLE
resources:
- staging-bot
tasks:
- script: curl --verbose --max-time 3600 "http://ratt:5000/sync?product=#{product}&target=#{target}"
- Release.Images.Release:
approval: manual
roles:
- SLE
resources:
- staging-bot
tasks:
- script: curl --verbose --max-time 3600 "http://ratt:5000/release?product=#{product}"