acr/piranha/README.md #89
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
on: | |
schedule: | |
- cron: '0 8 * * 5' | |
workflow_dispatch: | |
name: 'acr/piranha/README.md' | |
jobs: | |
validate: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: 'azure/login@v1' | |
with: | |
allow-no-subscriptions: 'true' | |
creds: '${{ secrets.AZURE_CREDENTIALS }}' | |
- uses: 'actions/checkout@v3' | |
- run: | | |
if [[ -z $REGION ]]; then | |
export REGION=westus | |
fi | |
if [[ -z $REGION ]]; then | |
export REGION=westus | |
fi | |
if [[ -z $RESOURCE_GROUP ]]; then | |
export RESOURCE_GROUP=joaz-rg-$RANDOM | |
echo "Using '"$RESOURCE_GROUP"' as resource group" | |
fi | |
az group create --name $RESOURCE_GROUP --location $REGION | |
if [[ -z $ACR_NAME ]]; then | |
export ACR_NAME=joazacr$RANDOM | |
fi | |
az acr create \ | |
--name $ACR_NAME \ | |
--resource-group $RESOURCE_GROUP \ | |
--sku Basic \ | |
--admin-enabled true | |
cd acr/piranha | |
mvn package | |
export ACR_PIRANHA_IMAGE=piranha:latest | |
az acr build --registry $ACR_NAME --resource-group $RESOURCE_GROUP --image $ACR_PIRANHA_IMAGE . | |
cd ../.. | |
export RESULT=$(az acr repository show --name $ACR_NAME --image $ACR_PIRANHA_IMAGE) | |
az group delete --name $RESOURCE_GROUP --yes || true | |
if [[ -z $RESULT ]]; then | |
echo "Unable to find $ACR_PIRANHA_IMAGE image" | |
exit 1 | |
fi |