Skip to content

Commit

Permalink
Committing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
49081 committed Nov 11, 2023
1 parent e5e7428 commit 7a665a8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
- uses: 'actions/checkout@v2'
- run: |
if [[ -z $REGION ]]; then
export REGION=westus
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand All @@ -37,29 +42,8 @@ jobs:
--resource-group $RESOURCE_GROUP \
--sku Basic \
--admin-enabled true
if [[ -z $ACR_PULL_SERVICE_PRINCIPAL_NAME ]]; then
export ACR_PULL_SERVICE_PRINCIPAL_NAME=acr-pull-$RANDOM
export ACR_ID=`az acr show --name $ACR_NAME --query id --output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_PASSWORD=`az ad sp create-for-rbac \
--name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--scopes $ACR_ID \
--role acrpull \
--query password \
--output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_ID=`az ad sp list \
--display-name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--query [].appId \
--output tsv`
else
export ACR_PULL_SERVICE_PRINCIPLE_KEEP=true
fi
az group delete --name $RESOURCE_GROUP --yes || true
if [[ -z $ACR_PULL_SERVICE_PRINCIPLE_KEEP ]]; then
az ad sp delete --id $ACR_PULL_SERVICE_PRINCIPAL_ID || true
fi
if [[ -z $ACR_PULL_SERVICE_PRINCIPAL_PASSWORD ]]; then
echo "ACR 'acrpull' service principal password was not found"
exit 1
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/container_quarkus_README_md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
export REGION=westus
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand All @@ -42,23 +47,6 @@ jobs:
--resource-group $RESOURCE_GROUP \
--sku Basic \
--admin-enabled true
if [[ -z $ACR_PULL_SERVICE_PRINCIPAL_NAME ]]; then
export ACR_PULL_SERVICE_PRINCIPAL_NAME=acr-pull-$RANDOM
export ACR_ID=`az acr show --name $ACR_NAME --query id --output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_PASSWORD=`az ad sp create-for-rbac \
--name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--scopes $ACR_ID \
--role acrpull \
--query password \
--output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_ID=`az ad sp list \
--display-name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--query [].appId \
--output tsv`
else
export ACR_PULL_SERVICE_PRINCIPLE_KEEP=true
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/container_tomcat_README_md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
export REGION=westus
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand All @@ -42,23 +47,6 @@ jobs:
--resource-group $RESOURCE_GROUP \
--sku Basic \
--admin-enabled true
if [[ -z $ACR_PULL_SERVICE_PRINCIPAL_NAME ]]; then
export ACR_PULL_SERVICE_PRINCIPAL_NAME=acr-pull-$RANDOM
export ACR_ID=`az acr show --name $ACR_NAME --query id --output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_PASSWORD=`az ad sp create-for-rbac \
--name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--scopes $ACR_ID \
--role acrpull \
--query password \
--output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_ID=`az ad sp list \
--display-name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--query [].appId \
--output tsv`
else
export ACR_PULL_SERVICE_PRINCIPLE_KEEP=true
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/container_wildfly_README_md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
export REGION=westus
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand All @@ -42,23 +47,6 @@ jobs:
--resource-group $RESOURCE_GROUP \
--sku Basic \
--admin-enabled true
if [[ -z $ACR_PULL_SERVICE_PRINCIPAL_NAME ]]; then
export ACR_PULL_SERVICE_PRINCIPAL_NAME=acr-pull-$RANDOM
export ACR_ID=`az acr show --name $ACR_NAME --query id --output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_PASSWORD=`az ad sp create-for-rbac \
--name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--scopes $ACR_ID \
--role acrpull \
--query password \
--output tsv`
export ACR_PULL_SERVICE_PRINCIPAL_ID=`az ad sp list \
--display-name $ACR_PULL_SERVICE_PRINCIPAL_NAME \
--query [].appId \
--output tsv`
else
export ACR_PULL_SERVICE_PRINCIPLE_KEEP=true
fi
if [[ -z $REGION ]]; then
export REGION=westus
fi
Expand Down

0 comments on commit 7a665a8

Please sign in to comment.