-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add external redis cache * add CI validation on PR * set branch * try to fix paramater error * split cachesTemplate into its own file * fix dependsOn * fix template name * fix branch for PR workflow * fix branch for PR workflow #2 * fix branch environment variables * fix branch environment variables * fix default vaule for redis connection string * try removing parameters * Revert "try removing parameters" This reverts commit 8706ae7. * remove paramters from -apim you idiot * add redis connection string * update job names to be more specific
- Loading branch information
Showing
6 changed files
with
144 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Validate_APIM_On_PR_to_Dev | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
paths: | ||
- "service/**" | ||
- ".github/workflows/apim-ci.yml" | ||
- ".github/workflows/apim-develop.yml" | ||
|
||
jobs: | ||
validate-apim: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
Environment: dev | ||
UrlEnvPrefix: dev- | ||
SubscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
resourceGroup: rg-apim-dev | ||
AZURE_CREDENTIALS: ${{ secrets.DEV_AZURE_CREDENTIALS }} | ||
ApimServiceName: apim-iati-dev | ||
ApimGatewayHostname: dev-api.iatistandard.org | ||
ApimDevPortalHostname: dev-developer.iatistandard.org | ||
ApimSKU: Developer | ||
ApimCapacity: 1 | ||
repoUrl: https://raw.githubusercontent.com/iati/apim-iati-gateway | ||
repoApimPath: service | ||
RedisConnectionString: ${{ secrets.DEV_REDIS_CONNECTION_STRING }} | ||
|
||
steps: | ||
- name: "Checkout GitHub Action" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Login to Azure" | ||
uses: azure/[email protected] | ||
with: | ||
creds: ${{ env.AZURE_CREDENTIALS }} | ||
|
||
# ARM deployment tasks | ||
- name: Validate APIM ARM Templates with what-if | ||
working-directory: ./service | ||
env: | ||
LinkedTemplatesBaseUrl: ${{ env.repoUrl }}/${{ github.HEAD_REF }}/${{ env.repoApimPath }} | ||
PolicyXMLBaseUrl: ${{ env.repoUrl }}/${{ github.HEAD_REF }}/${{ env.repoApimPath }}/policies | ||
deploymentName: --name GH_what_if_deployment_apim | ||
rg: --resource-group ${{ env.resourceGroup }} | ||
apiNamePrefix: apim-iati-dev | ||
run: | | ||
az deployment group what-if ${{env.deploymentName}} \ | ||
${{env.rg}} \ | ||
--template-file ./${{env.apiNamePrefix}}-master.template.json \ | ||
--parameters ./${{env.apiNamePrefix}}-parameters.json \ | ||
--parameters ApimServiceName=${{ env.ApimServiceName }} \ | ||
--parameters LinkedTemplatesBaseUrl=${{ env.LinkedTemplatesBaseUrl }} \ | ||
--parameters PolicyXMLBaseUrl=${{ env.PolicyXMLBaseUrl }} \ | ||
--parameters Environment=${{ env.Environment }} \ | ||
--parameters UrlEnvPrefix=${{ env.UrlEnvPrefix }} \ | ||
--parameters SubscriptionId=${{ env.SubscriptionId }} \ | ||
--parameters ApimSKU=${{ env.ApimSKU }} \ | ||
--parameters ApimCapacity=${{ env.ApimCapacity }} \ | ||
--parameters ApimGatewayHostname=${{ env.ApimGatewayHostname }} \ | ||
--parameters ApimDevPortalHostname=${{ env.ApimDevPortalHostname }} \ | ||
--parameters RedisConnectionString=${{ env.RedisConnectionString }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"ApimServiceName": { | ||
"type": "string" | ||
}, | ||
"Environment": { | ||
"type": "string" | ||
}, | ||
"RedisConnectionString": { | ||
"type": "string" | ||
}, | ||
"SubscriptionId": { | ||
"type": "string" | ||
} | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.ApiManagement/service/caches", | ||
"apiVersion": "2020-12-01", | ||
"name": "[concat(parameters('ApimServiceName'), '/uksouth')]", | ||
"properties": { | ||
"useFromLocation": "uksouth", | ||
"description": "[concat('redis-iati-',parameters('Environment'),'.redis.cache.windows.net')]", | ||
"connectionString": "[parameters('RedisConnectionString')]", | ||
"resourceId": "[concat('https://management.azure.com/subscriptions/',parameters('SubscriptionId'),'/resourceGroups/rg-sharedresources-',parameters('Environment'), '/providers/Microsoft.Cache/Redis/redis-iati-', parameters('Environment'))]" | ||
} | ||
} | ||
] | ||
} |
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
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