This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf "\n\n**** Setting up AZ DEVOPS env vars *****\n\n" | |
az login | |
read -p "- Type the project name: " PROJECT | |
read -p "- Type the group name: " GROUP_NAME | |
read -p "- Type the name of the comma separated file with envs and values: " FILE_NAME | |
az devops configure -d project=$PROJECT | |
GROUP_ID=$(az pipelines variable-group list --group-name $GROUP_NAME --query '[0].id') | |
awk -v GROUP_ID=$GROUP_ID -v PROJECT=$PROJECT --field-separator="," '{ print "az pipelines variable-group variable create --group-id ",GROUP_ID," --project",PROJECT," --name ",$1,"--value ",$2,";" }' $FILE_NAME >> command.sh | |
printf "\n**** Done! Commands saved at commands.sh****\n\n" |