Test ARM Template for Community #20
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
name: Test ARM Template for Community | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- marketplace/neo4j-community/** | |
- scripts/neo4j-community/** | |
branches: | |
- main | |
jobs: | |
test-template-standalone-v5: | |
name: Test ARM (Neo4j Community Standalone) | |
runs-on: ubuntu-latest | |
env: | |
ResourceGroupLocation: northeurope | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Azure Login | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Configure Resource Group and Deployment variables | |
id: variables | |
run: | | |
DATE=`echo $(date '+%Y%m%d-%S-%2N')` | |
RGNAME=`echo ghactions-rg-$DATE` | |
DEPNAME=`echo ghactions-dep-$DATE` | |
echo "rgName=$RGNAME" >> $GITHUB_OUTPUT | |
echo "depName=$DEPNAME" >> $GITHUB_OUTPUT | |
echo "Resource Group name: $RGNAME" | |
echo "Deployment name: $DEPNAME" | |
- name: Create Resource Group | |
uses: Azure/CLI@v1 | |
id: rgCreate | |
with: | |
inlineScript: | | |
#!/bin/bash | |
az group create --name ${{ steps.variables.outputs.rgName }} --location ${{ env.ResourceGroupLocation }} | |
echo "Azure resource group created" | |
echo "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref }}/" | |
- name: Deploy ARM Template (Neo4j Standalone v5) | |
id: deployARM | |
uses: azure/arm-deploy@v1 | |
with: | |
resourceGroupName: ${{ steps.variables.outputs.rgName }} | |
template: ./marketplace/neo4j-community/mainTemplate.json | |
parameters: ./marketplace/neo4j-community/parameters.json _artifactsLocation="https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref }}/" | |
deploymentName: ${{ steps.variables.outputs.depName }} | |
- name: Execute tests | |
run: | | |
URI=$(echo "${{ steps.deployARM.outputs.neo4jBrowserURL }}" | sed 's/http/neo4j/g;s/7474\//7687/g') | |
PASSWORD=$(cat ./marketplace/neo4j-community/parameters.json | jq .adminPassword.value | sed 's/"//g') | |
curl -LJO https://github.com/neo4j/neo4jtester/raw/main/build/neo4jtester_linux | |
chmod +x ./neo4jtester_linux | |
./neo4jtester_linux "${URI}" "neo4j" "${PASSWORD}" | |
- name: Delete Resource Group | |
if: always() | |
uses: Azure/CLI@v1 | |
with: | |
inlineScript: | | |
#!/bin/bash | |
az group delete --name ${{ steps.variables.outputs.rgName }} --yes | |
echo "Azure resource group deleted !!" |