This pipe is used to deploy Aligent Azure Microservice application.
Create an Azure Service Principal with Contributor role, and store its login details with the below names:
appIdpasswordtenantCreate pipeline environment variables to use while deploy:
bicep/main.bicepbicep/main.parameters.jsondevAustralia SoutheastSample bitbucket-pipelines.yml:
image:
name: aligent/azure-microservice-deploy-pipe:latest
definitions:
steps:
- step: &test
name: Test
script:
- npm ci
# - npm run lint
# - npm run test
- step: &deploy
script:
- az login --service-principal -u '${ARM_CLIENT_ID}' -p '${ARM_CLIENT_SECRET}' --tenant '${ARM_TENANT_ID}'
- DEPLOYMENT_NAME=pipe-$(date +%s)
- az deployment sub create --name ${DEPLOYMENT_NAME} --location ${LOCATION} --template-file '${BICEP_MAIN_PATH}' --parameters '${BICEP_DEFAULT_PARAMETERS_PATH}' --parameters env='${ENVIRONMENT} --output none'
- DEPLOYMENT_OUTPUTS=$(az deployment sub show --name ${DEPLOYMENT_NAME} --query properties.outputs)
# The outputs are defined in `main.bicep` file.
# The line below assume that we defined an output named `function_app_name`
- FUNCTION_APP_NAME=$(echo ${DEPLOYMENT_OUTPUTS} | jq -r '.function_app_name.value')
# Run!
- npm ci && npm run deploy ${FUNCTION_APP_NAME} -- --typescript
pipelines:
pull-requests:
'**':
- step: *test
branches:
staging:
- step:
<<: *deploy
name: 'Deploy Staging'
deployment: Staging
master:
- step:
<<: *deploy
name: 'Deploy master'
deployment: Production
Content type
Image
Digest
sha256:80749f2ea…
Size
328.2 MB
Last updated
23 days ago
docker pull aligent/azure-microservice-deploy-pipe