From f258efab3959d7374588f39bde32e1c421460e4f Mon Sep 17 00:00:00 2001 From: Eugenio Paolantonio Date: Tue, 11 Jun 2024 10:57:50 +0200 Subject: [PATCH] gocd: slfo-stagings: wait for product to be built before enabling images During image testing, the artifacts built inside the 'product' repository are used. Let's ensure that the repository is fully built before attempting to enable images. Signed-off-by: Eugenio Paolantonio --- gocd/slfo-stagings.gocd.yaml | 121 +++++++++++++++++++++++++++++++ gocd/slfo-stagings.gocd.yaml.erb | 11 +++ 2 files changed, 132 insertions(+) diff --git a/gocd/slfo-stagings.gocd.yaml b/gocd/slfo-stagings.gocd.yaml index 7f80d4a9..3fc86bfc 100644 --- a/gocd/slfo-stagings.gocd.yaml +++ b/gocd/slfo-stagings.gocd.yaml @@ -59,6 +59,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -128,6 +139,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -197,6 +219,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -266,6 +299,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -335,6 +379,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -404,6 +459,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -473,6 +539,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -542,6 +619,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -611,6 +699,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -680,6 +779,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot @@ -749,6 +859,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot diff --git a/gocd/slfo-stagings.gocd.yaml.erb b/gocd/slfo-stagings.gocd.yaml.erb index b9b75c45..42e882e4 100644 --- a/gocd/slfo-stagings.gocd.yaml.erb +++ b/gocd/slfo-stagings.gocd.yaml.erb @@ -60,6 +60,17 @@ pipelines: exit 1 fi + - Build.product: + resources: + - staging-bot + tasks: + - script: |- + osc -A $STAGING_API api -X POST "/source/$STAGING_PROJECT?cmd=remove_flag&repository=product&flag=build" + export PYTHONPATH=$PWD/scripts + while ! ./scripts/gocd/verify-repo-built-successful.py -A $STAGING_API -p $STAGING_PROJECT -r product; do + sleep 60 + done + - Enable.images.repo: resources: - staging-bot