Skip to content

Commit

Permalink
Merge pull request #51 from IATI/datastore-prod-prep
Browse files Browse the repository at this point in the history
deploy production flattener ACI
  • Loading branch information
nosvalds authored Nov 11, 2021
2 parents c4943c0 + ee9701e commit 04c22e2
Showing 1 changed file with 46 additions and 4 deletions.
50 changes: 46 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ env:
FILE_VALIDATION_URL: ${{ secrets.PROD_FILE_VALIDATION_URL }}
FILE_VALIDATION_KEY_NAME: ${{ secrets.PROD_FILE_VALIDATION_KEY_NAME }}
FILE_VALIDATION_KEY_VALUE: ${{ secrets.PROD_FILE_VALIDATION_KEY_VALUE }}
FLATTENER_API_URL: ${{ secrets.FLATTENER_API_URL }}
SOLR_API_URL: ${{ secrets.SOLR_API_URL }}
SOLR_USER: ${{ secrets.SOLR_USER }}
SOLR_PASSWORD: ${{ secrets.SOLR_PASSWORD }}
FLATTENER_API_URL: ${{ secrets.PROD_FLATTENER_API_URL }}
FLATTENER_KEY_NAME: ${{ secrets.PROD_FLATTENER_KEY_NAME }}
FLATTENER_KEY_VALUE: ${{ secrets.PROD_FLATTENER_API_KEY }}
SOLR_API_URL: ${{ secrets.PROD_SOLR_API_URL }}
SOLR_USER: ${{ secrets.PROD_SOLR_USER }}
SOLR_PASSWORD: ${{ secrets.PROD_SOLR_PASSWORD }}
VALIDATOR_PARALLEL: ${{ secrets.VALIDATOR_PARALLEL }}
DB_USER: ${{ secrets.PROD_DB_USER }}
DB_PASS: ${{ secrets.PROD_DB_PASS }}
Expand Down Expand Up @@ -47,6 +49,8 @@ jobs:
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/$STAGE-$NAME-refresh:$TAG
docker build . -f validate-dockerfile -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/$STAGE-$NAME-validate:$TAG
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/$STAGE-$NAME-validate:$TAG
docker build . -f flatten-dockerfile -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/$STAGE-$NAME-flatten:$TAG
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/$STAGE-$NAME-flatten:$TAG
- name: "Deploy Refresh to Azure Container Instances"
uses: "azure/CLI@v1"
with:
Expand Down Expand Up @@ -118,3 +122,41 @@ jobs:
SOLR_API_URL="${{ env.SOLR_API_URL }}" \
SOLR_USER="${{ env.SOLR_USER }}" \
SOLR_PASSWORD="${{ env.SOLR_PASSWORD }}"
- name: "Deploy Flatten to Azure Container Instances"
uses: "azure/[email protected]"
with:
azcliversion: 2.30.0
inlineScript: |
az container create \
--resource-group "${{ secrets.RESOURCE_GROUP }}" \
--image "${{ secrets.REGISTRY_LOGIN_SERVER }}/${{env.STAGE}}-${{env.NAME}}-flatten:${{ env.TAG }}" \
--registry-login-server "${{ secrets.REGISTRY_LOGIN_SERVER }}" \
--registry-username "${{ secrets.REGISTRY_USERNAME }}" \
--registry-password "${{ secrets.REGISTRY_PASSWORD }}" \
--name "${{ env.STAGE }}-${{ env.NAME }}-flatten" \
--location "uksouth" \
--restart-policy "Always" \
--ip-address "Private" \
--vnet "dev-iati-refresher" \
--subnet "default" \
--memory "2" \
--cpu "1" \
--os-type "Linux" \
--log-analytics-workspace "${{ env.LOG_WORKSPACE_ID }}" \
--log-analytics-workspace-key "${{ env.LOG_WORKSPACE_KEY }}" \
--secure-environment-variables \
AZURE_STORAGE_CONNECTION_STRING="${{ env.AZURE_STORAGE_CONNECTION_STRING }}" \
AZURE_STORAGE_CONTAINER_SOURCE="${{ env.AZURE_STORAGE_CONTAINER_SOURCE }}" \
FLATTENER_API_URL="${{ env.FLATTENER_API_URL }}" \
FLATTENER_KEY_NAME="${{ env.FLATTENER_KEY_NAME }}" \
FLATTENER_KEY_VALUE="${{ env.FLATTENER_KEY_VALUE }}" \
DB_HOST="${{ env.DB_HOST }}" \
DB_PORT="${{ env.DB_PORT }}" \
DB_USER="${{ env.DB_USER }}" \
DB_PASS="${{ env.DB_PASS }}" \
DB_NAME="${{ env.DB_NAME }}" \
SOLR_API_URL="${{ env.SOLR_API_URL }}" \
SOLR_USER="${{ env.SOLR_USER }}" \
SOLR_PASSWORD="${{ env.SOLR_PASSWORD }}"

0 comments on commit 04c22e2

Please sign in to comment.