Skip to content

Commit

Permalink
Merge pull request #3160 from gleidi-suse/fix_auto_freeze
Browse files Browse the repository at this point in the history
gocd: slfo-stagings: Fix osc staging plugin setup.
  • Loading branch information
gleidi-suse committed Sep 11, 2024
2 parents 44779bb + 422a0e1 commit 239a205
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion gocd/slfo-stagings.gocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,24 @@ pipelines:
- script: |-
set -eu
export PYTHONPATH=$PWD/scripts
## Setup osc staging plugin
tempdir=$(mktemp -d)
mkdir -p $tempdir/.osc-plugins
ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
ln -s $PWD/osclib $tempdir/.osc-plugins
export HOME=$tempdir
for letter in A B C D E F G H S V Y ; do
## if the staging was frozen today, skip it
if ! osc -A $STAGING_API meta attribute "${SLFO_PROJECT}:Staging:${letter}" --attribute OSRT:FreezeTime | grep $(date +%Y-%m-%d); then
osc -A $STAGING_API staging freeze -p $SLFO_PROJECT $letter
else
echo Skipping "${SLFO_PROJECT}:Staging:${letter}"
echo "${SLFO_PROJECT}:Staging:${letter}" was frozen today, skipping it...
fi
done
## Tear down osc staging plugin
rm -rf $tempdir
SUSE.SLFO.Main.Staging.A:
environment_variables:
Expand Down
12 changes: 11 additions & 1 deletion gocd/slfo-stagings.gocd.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,24 @@ pipelines:
- script: |-
set -eu
export PYTHONPATH=$PWD/scripts

## Setup osc staging plugin
tempdir=$(mktemp -d)
mkdir -p $tempdir/.osc-plugins
ln -s $PWD/osc-staging.py $tempdir/.osc-plugins
ln -s $PWD/osclib $tempdir/.osc-plugins
export HOME=$tempdir

for letter in <% stagings.each do |letter| %><%= letter %> <% end -%>; do
## if the staging was frozen today, skip it
if ! osc -A $STAGING_API meta attribute "${SLFO_PROJECT}:Staging:${letter}" --attribute OSRT:FreezeTime | grep $(date +%Y-%m-%d); then
osc -A $STAGING_API staging freeze -p $SLFO_PROJECT $letter
else
echo Skipping "${SLFO_PROJECT}:Staging:${letter}"
echo "${SLFO_PROJECT}:Staging:${letter}" was frozen today, skipping it...
fi
done
## Tear down osc staging plugin
rm -rf $tempdir
<% stagings.each do |letter| %>
SUSE.SLFO.Main.Staging.<%= letter %>:
environment_variables:
Expand Down

0 comments on commit 239a205

Please sign in to comment.