File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -o errexit -o pipefail
3
3
4
- : " ${AZURE_DEVOPS_EXT_PAT:? } "
4
+ # Create a variable group called $AZURE_VARIABLE_GROUP_NAME (if it doesn't exist)
5
+ # and set all the variables needed for the RHTAP pipeline.
6
+ #
7
+ # If you have the Azure CLI (az) installed and don't mind running the commands
8
+ # in this script on your machine, you can execute this script directly. Otherwise,
9
+ # run this in a container via hack/azure-set-vars.sh
10
+ #
11
+ # Before running this script, source your .env or .envrc file.
12
+
13
+ : " ${AZURE_DEVOPS_EXT_PAT:? } " # the 'az' commands use this variable automatically
5
14
: " ${AZURE_VARIABLE_GROUP_NAME:? } "
6
15
: " ${AZURE_ORGANIZATION:? } "
7
16
: " ${AZURE_PROJECT:? } "
@@ -37,10 +46,18 @@ get_or_create_vargroup() {
37
46
echo " $group_id "
38
47
}
39
48
40
- VARGROUP_ID=$( get_or_create_vargroup " $AZURE_VARIABLE_GROUP_NAME " )
41
- if [[ -z $VARGROUP_ID ]]; then
42
- echo " Variable group creation sometimes fails despite succeeding, trying again..." >&2
49
+ for _ in {1..3}; do
43
50
VARGROUP_ID=$( get_or_create_vargroup " $AZURE_VARIABLE_GROUP_NAME " )
51
+ if [[ -n $VARGROUP_ID ]]; then
52
+ break
53
+ fi
54
+
55
+ echo " Variable group creation sometimes fails despite succeeding, trying again..." >&2
56
+ done
57
+
58
+ if [[ -z $VARGROUP_ID ]]; then
59
+ echo " Failed to get the variable group ID" >&2
60
+ exit 1
44
61
fi
45
62
46
63
set_var () {
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -o errexit -o nounset -o pipefail
3
3
4
+ # Run a script in the azure-cli container to set Azure variables.
5
+ # See the header in hack/_azure-set-vars.sh for more details.
6
+
4
7
SCRIPTDIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) "
5
8
6
9
# Find available versions with
You can’t perform that action at this time.
0 commit comments