29 lines
834 B
Bash
Raw Normal View History

#! /bin/sh
set -e
2022-11-17 12:58:09 +01:00
version=0.13.0
if ! test -f yaml-config-plugin-$version.jar; then
wget https://github.com/tomzo/gocd-yaml-config-plugin/releases/download/$version/yaml-config-plugin-$version.jar
fi
2022-11-17 12:58:09 +01:00
sha1sum -c yaml-config-plugin-$version.jar.sha1
for file in *.erb; do
erb -T - $file > $(basename $file .erb)
done
grep group: *.yaml | cut -d: -f3 | sort -u | while read group; do
2023-01-02 15:34:10 +01:00
case $group in
BCI|Factory|Leap|Admin|MicroOS|Monitors|openSUSE.Checkers|SLE15.Stagings|SLE15.Target|SLE.Checkers|ALP.Stagings|ALP.Checkers|SLFO.Stagings|SLFO.Target|SLFO.Checkers|openSUSE.Legal|SUSE.Legal|SLES)
2023-01-02 15:34:10 +01:00
;;
*)
echo "Do not create new groups without being admin and knowing the consequences - found $group"
exit 1
esac
done
for file in *.gocd.yaml; do
2022-11-17 12:58:09 +01:00
java -jar yaml-config-plugin-$version.jar syntax $file
done