From f171b51d2535c2267c300c0db74fbe17c6ff67f5 Mon Sep 17 00:00:00 2001 From: Sanjay Mantoor Date: Wed, 25 Aug 2021 06:21:14 +0000 Subject: [PATCH 1/2] Added workflow and updated setup scripts for cluster --- .../.github/workflows/build.yml | 999 ++++++++++++++++++ .../.github/workflows/newtag.yaml | 104 ++ .../.github/workflows/package.yaml | 73 ++ .../nestedtemplates/coherenceTemplate.json | 2 +- .../main/arm/nestedtemplates/dbTemplate.json | 3 +- .../src/main/scripts/setupClusterDomain.sh | 1 + .../test/scripts/verify-deployments.sh | 28 +- 7 files changed, 1193 insertions(+), 17 deletions(-) create mode 100644 weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/build.yml create mode 100644 weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/newtag.yaml create mode 100644 weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/package.yaml diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/build.yml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/build.yml new file mode 100644 index 000000000..4f23c16b5 --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/build.yml @@ -0,0 +1,999 @@ +name: Build and Test +on: + workflow_dispatch: + inputs: + enableELK: + description: 'Specify whether to enable ELK depoyment or not.' + required: true + default: 'false' + # Allows you to run this workflow using GitHub APIs + # PERSONAL_ACCESS_TOKEN= + # REPO_NAME=wls-eng/arm-oraclelinux-wls-cluster + # curl --verbose -XPOST -u "wls-eng:${PERSONAL_ACCESS_TOKEN}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${REPO_NAME}/dispatches --data '{"event_type": "production-deploy"}' + repository_dispatch: + +env: + adminConsolePort: 7001 + adminPassword: ${{ secrets.WLS_PASSWORD }} + adminVMName: adminServerVM + azCliVersion: 2.6.0 + dbName: wlsdb${{ github.run_id }}${{ github.run_number }} + elkURI: ${{ secrets.ELK_URI }} + elkUser: ${{ secrets.ELK_USER_NAME }} + elkPassword: ${{ secrets.ELK_PSW }} + gitToken: ${{ secrets.GIT_TOKEN }} + location: eastus + managedServerPrefix: managedServer + managedServerVM: "managedServerVM1" + managedServers: "managedServer1" + nsg: wls-nsg + numberOfInstances: 2 + refArmttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + refJavaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + repoName: arm-oraclelinux-wls-cluster + resourceGroupForDependency: wlsd-${{ github.run_id }}-${{ github.run_number }} + resourceGroupPrefix: ${{ github.run_id }}-${{ github.run_number }} + testbranchName: cicd-${{ github.run_id }}-${{ github.run_number }} + userEmail: ${{ secrets.USER_EMAIL }} + userName: ${{ secrets.USER_NAME }} + wlsDomainName: wlsd + wlsPassword: ${{ secrets.WLS_PASSWORD }} + wlsUserName: weblogic + wls_admin_services: "rngd wls_admin wls_nodemanager" + wls_managedServer_services: "rngd wls_nodemanager" + +jobs: + preflight: + runs-on: ubuntu-latest + steps: + - name: Checkout azure-javaee-iaas + uses: actions/checkout@v2 + with: + repository: Azure/azure-javaee-iaas + path: azure-javaee-iaas + ref: ${{ env.refJavaee }} + - name: Checkout arm-ttk + uses: actions/checkout@v2 + with: + repository: Azure/arm-ttk + path: arm-ttk + ref: ${{ env.refArmttk }} + - name: Checkout ${{ env.repoName }} + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }} + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build azure-javaee-iaas + run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml + - name: Build and test ${{ env.repoName }} + run: mvn -Ptemplate-validation-tests clean install --file ${{ env.repoName }}/pom.xml + + - name: Checkout ${{ env.repoName }} for test + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }}-dev + - name: Create a new branch with development pids in nestedtemplates + run: | + current=`pwd` + echo "current=${current}" >> $GITHUB_ENV + cd ${{ env.repoName }}-dev/${{ env.repoName }}/src/main/arm/nestedtemplates + git config --global core.longpaths true + git config --global user.email $userEmail + git config --global user.name $userName + echo "create branch $testbranchName" + git checkout -b $testbranchName + rm -r -f $current/${{ env.repoName }}-dev/${{ env.repoName }}/src/main/arm/nestedtemplates/* + cp -r -f $current/${{ env.repoName }}/${{ env.repoName }}/target/arm/nestedtemplates/* $current/${{ env.repoName }}-dev/${{ env.repoName }}/src/main/arm/nestedtemplates/ + git status + git commit -a -m "hard code pids" + git push https://$gitToken@github.com/$userName/${{ env.repoName }}.git -f + + - uses: azure/login@v1 + id: azure-login + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Validate deployment templates for different combinations of service integration + id: validate-deployment-templates + run: | + bash ${{ env.repoName }}/test/scripts/verify-deployments.sh <<< "${{ github.run_id }}${{ github.run_number }} ${location} \ + ${{ env.repoName }}/${{ env.repoName }}/target/arm/mainTemplate.json \ + ${userName} ${testbranchName} ${{ env.repoName }}/test/scripts" + + - name: Generate artifact file name and path + id: artifact_file + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/${{ env.repoName }}/pom.xml) + artifactName=${{ env.repoName }}-$version-arm-assembly + unzip ${{ env.repoName }}/${{ env.repoName }}/target/$artifactName.zip -d ${{ env.repoName }}/${{ env.repoName }}/target/$artifactName + echo "##[set-output name=artifactName;]${artifactName}" + echo "##[set-output name=artifactPath;]${{ env.repoName }}/${{ env.repoName }}/target/$artifactName" + - name: Archive ${{ env.repoName }} template + uses: actions/upload-artifact@v1 + if: success() + with: + name: ${{steps.artifact_file.outputs.artifactName}} + path: ${{steps.artifact_file.outputs.artifactPath}} + + - name: Generate addnode artifact file name and path + id: addnode_artifact_file + run: | + addnode_version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/addnode/pom.xml) + addnode_artifactName=${{ env.repoName }}-addnode-$addnode_version-arm-assembly + unzip ${{ env.repoName }}/addnode/target/$addnode_artifactName.zip -d ${{ env.repoName }}/addnode/target/$addnode_artifactName + echo "##[set-output name=addnode_artifactName;]${addnode_artifactName}" + echo "##[set-output name=addnode_artifactPath;]${{ env.repoName }}/addnode/target/$addnode_artifactName" + - name: Archive ${{ env.repoName }} addnode template + uses: actions/upload-artifact@v1 + if: success() + with: + name: ${{steps.addnode_artifact_file.outputs.addnode_artifactName}} + path: ${{steps.addnode_artifact_file.outputs.addnode_artifactPath}} + + - name: Generate delete node artifact file name and path + id: deletenode_artifact_file + run: | + deletenode_version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/deletenode/pom.xml) + deletenode_artifactName=${{ env.repoName }}-deletenode-$deletenode_version-arm-assembly + unzip ${{ env.repoName }}/deletenode/target/$deletenode_artifactName.zip -d ${{ env.repoName }}/deletenode/target/$deletenode_artifactName + echo "##[set-output name=deletenode_artifactName;]${deletenode_artifactName}" + echo "##[set-output name=deletenode_artifactPath;]${{ env.repoName }}/deletenode/target/$deletenode_artifactName" + + - name: Archive ${{ env.repoName }} deletenode template + uses: actions/upload-artifact@v1 + if: success() + with: + name: ${{steps.deletenode_artifact_file.outputs.deletenode_artifactName}} + path: ${{steps.deletenode_artifact_file.outputs.deletenode_artifactPath}} + + - name: Generate addnode-coherence artifact file name and path + id: addnode_coherence_artifact_file + run: | + addnode_coherence_version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/addnode-coherence/pom.xml) + addnode_coherence_artifactName=${{ env.repoName }}-addnode-coherence-$addnode_coherence_version-arm-assembly + unzip ${{ env.repoName }}/addnode-coherence/target/$addnode_coherence_artifactName.zip -d ${{ env.repoName }}/addnode-coherence/target/$addnode_coherence_artifactName + echo "##[set-output name=addnode_coherence_artifactName;]${addnode_coherence_artifactName}" + echo "##[set-output name=addnode_coherence_artifactPath;]${{ env.repoName }}/addnode-coherence/target/$addnode_coherence_artifactName" + + - name: Archive ${{ env.repoName }} addnode-coherence template + uses: actions/upload-artifact@v1 + if: success() + with: + name: ${{steps.addnode_coherence_artifact_file.outputs.addnode_coherence_artifactName}} + path: ${{steps.addnode_coherence_artifact_file.outputs.addnode_coherence_artifactPath}} + + deploy-dependencies: + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + needs: preflight + runs-on: ubuntu-latest + steps: + - uses: azure/login@v1 + id: azure-login + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Create Resource Group + id: create-resource-group + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "create resource group" ${{ env.resourceGroupForDependency }} + az group create --verbose --name ${{ env.resourceGroupForDependency }} --location ${location} + + - name: Set Up Azure Postgresql to Test dbTemplate + id: setup-postgresql + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "Deploy DB with name " ${{ env.dbName }} + az postgres server create \ + --resource-group ${{ env.resourceGroupForDependency }} \ + --name ${{ env.dbName }} \ + --location ${location} \ + --admin-user weblogic \ + --ssl-enforcement Enabled \ + --public-network-access Enabled \ + --admin-password ${{ env.wlsPassword }} \ + --sku-name B_Gen5_1 + + echo "Allow Access To Azure Services" + az postgres server firewall-rule create \ + -g ${{ env.resourceGroupForDependency }} \ + -s ${{ env.dbName }} \ + -n "AllowAllWindowsAzureIps" \ + --start-ip-address "0.0.0.0" \ + --end-ip-address "0.0.0.0" + + deploy-weblogic-cluster: + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + needs: deploy-dependencies + runs-on: ubuntu-latest + strategy: + max-parallel: 1 + fail-fast: false + matrix: + images: + [ + "owls-122130-jdk8-ol73;Oracle:weblogic-122130-jdk8-ol73:owls-122130-jdk8-ol7;latest", + "owls-122130-jdk8-ol74;Oracle:weblogic-122130-jdk8-ol74:owls-122130-jdk8-ol7;latest", + "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", + "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", + "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest", + ] + steps: + - name: Checkout ${{ env.repoName }} + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }} + - name: Get version information from ${{ env.repoName }}/pom.xml + id: version + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/${{ env.repoName }}/pom.xml) + echo "version=${version}" >> $GITHUB_ENV + - name: Output artifact name for Download action + id: artifact_file + run: | + artifactName=${{ env.repoName }}-$version-arm-assembly + echo "artifactName=${artifactName}" >> $GITHUB_ENV + echo "##[set-output name=artifactName;]${artifactName}" + - name: Download artifact for deployment + uses: actions/download-artifact@v1 + with: + name: ${{steps.artifact_file.outputs.artifactName}} + - uses: azure/login@v1 + id: azure-login + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Get Image SKU + id: image-sku + run: | + imageUrn="${{ matrix.images }}" + sku=${imageUrn%%;*} + echo "sku=${sku}" >> $GITHUB_ENV + echo ${resourceGroupPrefix} + resourceGroup=$(echo "${resourceGroupPrefix}-${sku}" | sed "s/_//g") + echo "resourceGroup=${resourceGroup}" >> $GITHUB_ENV + - name: Create Resource Group + id: create-resource-group + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "create resource group" $resourceGroup + az group create --verbose --name $resourceGroup --location ${location} + + - name: Prepare deployed parameters and test script + id: prepare-deployed-parameters-and-test-script + run: | + echo $managedServerPrefix $numberOfInstances $adminVMName + sed -i "s/#location#/$location/g; \ + s/#adminPasswordOrKey#/$wlsPassword/g; \ + s/#wlsdomainname#/$wlsDomainName/g; \ + s/#wlsusername#/$wlsUserName/g; \ + s/#wlspassword#/$wlsPassword/g; \ + s/#managedserverprefix#/$managedServerPrefix/g; \ + s/#numinstances#/$numberOfInstances/g; \ + s/#adminvmname#/$adminVMName/g; \ + s/#skuUrnVersion#/${{ matrix.images }}/g; \ + s/#testbranchName#/$testbranchName/g; \ + s/#gitUserName#/$userName/g" \ + ${{ env.repoName }}/test/data/parameters-test.json + + sed -i "s/#adminPasswordOrKey#/$wlsPassword/g" \ + ${{ env.repoName }}/test/scripts/verify-wls-path.sh + + sed -i "s/#adminVMName#/$adminVMName/g; \ + s/#adminPasswordOrKey#/$wlsPassword/g; \ + s/#managedServers#/$managedServers/g; \ + s/#wlsUserName#/$wlsUserName/g; \ + s/#wlspassword#/$wlsPassword/g" \ + ${{ env.repoName }}/test/scripts/verify-servers-lifecycle.sh + + - name: Accept Image Terms + id: accept-terms + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "accept terms for " "${{ matrix.images }}" + rawUrn="${{ matrix.images }}" + publisherAndName=$(echo ${rawUrn} | grep -o ";.*:" | sed "s/;//g") + imageVersion=${rawUrn##*;} + az vm image terms accept --urn ${publisherAndName}${sku}:${imageVersion} + + - name: Deploy WebLogic Server Cluster Domain offer + id: deploy-wls-cluster + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + az deployment group create \ + --verbose \ + --resource-group $resourceGroup \ + --name wls-cluster-node \ + --parameters @${{ env.repoName }}/test/data/parameters-test.json \ + --template-file ${artifactName}/mainTemplate.json + + - name: Verify Network Security Group + id: verify-nsg + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query nsg name, will exit with error if nsg does not exist." + az network nsg show -g $resourceGroup -n ${nsg} --query "name" + + - name: Get IP of build machine + id: get-ip-address + run: | + myIP=$(dig @ns1.google.com TXT o-o.myaddr.l.google.com +short) + echo "myIP=${myIP}" >> $GITHUB_ENV + + - name: Add ip address to security rule to access the wls machine + id: add-ip-to-security-rule + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query existing source address prefixes" + attempt=0 + toCreateRule101=false + while [[ -z `az network nsg show -g $resourceGroup -n ${nsg} | grep "NRMS-Rule-101"` && $attempt -le 5 ]] + do + if [ $attempt -eq 5 ]; then + toCreateRule101=true + fi + echo "network security group rule NRMS-Rule-101 is not ready" + sleep 1m + attempt=$((attempt + 1)) + done + if [ $toCreateRule101 == true ]; then + az network nsg rule create --name NRMS-Rule-101 \ + --nsg-name ${nsg} \ + --priority 101 \ + --resource-group $resourceGroup \ + --access Allow \ + --destination-address-prefixes "*" \ + --destination-port-ranges 22 43 ${adminConsolePort} \ + --direction Inbound \ + --protocol Tcp \ + --source-address-prefixes $myIP + else + sourceAddressPrefixes=$(az network nsg rule show \ + --resource-group $resourceGroup \ + --nsg-name ${nsg} \ + --name NRMS-Rule-101 \ + --query "sourceAddressPrefixes") + echo "IP of this machine: " ${myIP} + sourceAddressPrefixes=$(echo ${myIP} ${sourceAddressPrefixes} | \ + sed 's/,/ /g; s/\[//g; s/\]//g; s/"//g') + echo ${sourceAddressPrefixes} + az network nsg rule update \ + --resource-group $resourceGroup \ + --nsg-name ${nsg} \ + --name NRMS-Rule-101 \ + --source-address-prefixes $sourceAddressPrefixes \ + --destination-port-ranges 443 22 ${adminConsolePort} + fi + + - name: Restart wls VM + id: restart-wls-wm + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "restart vm to make sure security rule work." + az vm restart -g $resourceGroup -n $adminVMName + + - name: Query public IP of AdminServer VM + id: query-wls-admin-ip + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query public ip" + publicIP=$(az vm show \ + --resource-group $resourceGroup \ + --name $adminVMName -d \ + --query publicIps -o tsv) + echo "##[set-output name=publicIP;]${publicIP}" + - name: Create environment variable for AdminServer IP + id: env-admin-ip + run: echo "wlsPublicIP=${{steps.query-wls-admin-ip.outputs.publicIP}}" >> $GITHUB_ENV + + - name: Query public IP of managedServerVM1 + id: query-wls-managed-ip + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query public ip" + publicIP=$(az vm show \ + --resource-group $resourceGroup \ + --name $managedServerVM -d \ + --query publicIps -o tsv) + echo "##[set-output name=publicIP;]${publicIP}" + - name: Create environment variable for managedServerVM1 IP + id: env-managedserver-vm1-ip + run: echo "ms1PublicIP=${{steps.query-wls-managed-ip.outputs.publicIP}}" >> $GITHUB_ENV + + - name: Verify WebLogic Server Installation + id: verify-wls + run: | + echo "pubilc IP of wls machine: ${wlsPublicIP}" + echo "Verifying Weblgic server installation" + timeout 6m sh -c 'until nc -zv $0 $1; do echo "nc rc: $?"; sleep 5; done' ${wlsPublicIP} 22 + echo install sshpass + sudo apt-get install -y sshpass + sshpass -p ${wlsPassword} -v ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=100 -v -tt weblogic@${wlsPublicIP} 'bash -s' < ${{ env.repoName }}/test/scripts/verify-wls-path.sh + + # Fix failure that caused by remote server closed. + - name: Restart remote SSH agent + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "Restart remote SSH agent" + az vm user reset-ssh \ + --resource-group $resourceGroup \ + --name ${{ env.adminVMName }} + + - name: Verify wls admin services + id: veriy-admin-service + run: | + echo "Verifying WebLogic services at admin server" + sshpass -p ${wlsPassword} -v ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=100 -v -tt weblogic@${wlsPublicIP} 'bash -s' < ${{ env.repoName }}/test/scripts/verify-services.sh $wls_admin_services + + # Fix failure that caused by remote server closed. + - name: Restart remote SSH agent + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "Restart remote SSH agent" + az vm user reset-ssh \ + --resource-group $resourceGroup \ + --name ${{ env.adminVMName }} + + - name: Verify wls managed server services + id: veriy-msservice + run: | + echo "Verifying WebLogic services at managed server" + sshpass -p ${wlsPassword} -v ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=100 -v -tt weblogic@${ms1PublicIP} 'bash -s' < ${{ env.repoName }}/test/scripts/verify-services.sh $wls_managedServer_services + + - name: Verify WebLogic Server Access + id: verify-wls-access + run: | + echo "Verifying Weblogic Server Access" + bash ${{ env.repoName }}/test/scripts/verify-wls-access.sh <<< "$wlsPublicIP ${adminConsolePort} $wlsUserName $wlsPassword $managedServers" + + # Fix failure that caused by remote server closed. + - name: Restart remote SSH agent + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "Restart remote SSH agent" + az vm user reset-ssh \ + --resource-group $resourceGroup \ + --name ${{ env.adminVMName }} + + - name: Verify WebLogic Managed Server LifeCycle check + id: verify-server-lifecycle + run: | + echo "Verifying Weblogic managed server lifecycle" + sshpass -p ${wlsPassword} -v ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=100 -v -tt weblogic@${wlsPublicIP} 'bash -s' < ${{ env.repoName }}/test/scripts/verify-servers-lifecycle.sh + + - name: Deploy DB Template to Connect to Azure Postgresql Database + id: enable-postgresql-db + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + # Generate parameters for db template deployment + bash ${{ env.repoName }}/test/scripts/gen-parameters-deploy-db.sh \ + <<< "${{ env.repoName }}/test/scripts/ \ + ${{ env.adminVMName }} \ + ${{ env.wlsPassword}} \ + ${{ env.dbName }} \ + ${{ env.location }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }}" + echo "Deploy DB Template..." + az group deployment create \ + --verbose \ + --resource-group ${resourceGroup} \ + --name db \ + --parameters @${{ env.repoName }}/test/scripts/parameters-deploy-db.json \ + --template-file ${artifactName}/nestedtemplates/dbTemplate.json + + - name: Generate Application Gateway Certificate + id: gen-certificate-agw + run: | + echo "Generate SSL Certificate for Application Gateway" + openssl genrsa -passout pass:${{ env.wlsPassword }} -out privkey.pem 3072 + openssl req -x509 -new -key privkey.pem -out privkey.pub -subj "/C=US" + openssl pkcs12 -passout pass:${{ env.wlsPassword }} -export -in privkey.pub -inkey privkey.pem -out mycert.pfx + agwCertificateBase64String=$(base64 mycert.pfx -w 0) + echo "agwCertificateBase64String=${agwCertificateBase64String}" >> $GITHUB_ENV + - name: Set up Application Gateway by Deploying Sub Template + id: enable-application-gateway + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + # Generate parameters for application gateway template deployment + bash ${{ env.repoName }}/test/scripts/gen-parameters-deploy-agw.sh \ + <<< "${{ env.repoName }}/test/scripts/parameters-deploy-agw.json \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ env.adminVMName }} \ + ${agwCertificateBase64String} \ + ${{ env.wlsPassword }} \ + ${{ env.numberOfInstances }} \ + ${{ env.location }} \ + ${{ env.wlsPassword }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsDomainName }} \ + ${{ env.managedServerPrefix }}" + echo "Deploy Application Gateway Template..." + az group deployment create \ + --verbose \ + --debug \ + --resource-group ${resourceGroup} \ + --name agw \ + --parameters @${{ env.repoName }}/test/scripts/parameters-deploy-agw.json \ + --template-file ${artifactName}/nestedtemplates/appGatewayNestedTemplate.json + + - name: Query appGatewayURL of appgateway deployment + id: query-agwurl + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query appgatewayURL" + appGatewayURL=$(az network public-ip show \ + --resource-group $resourceGroup \ + --name gwip \ + --query dnsSettings.fqdn -o tsv) + echo "##[set-output name=appGatewayURL;]${appGatewayURL}" + - name: Save appGatewayURL for app deployement verification + id: save-appgatewayurl + run: | + echo ${{steps.query-agwurl.outputs.appGatewayURL}} + echo "appGatewayURL=${{steps.query-agwurl.outputs.appGatewayURL}}" >> $GITHUB_ENV + echo ${appGatewayURL} + + - name: Checkout WebLogic-Cafe + id: checkout-webapp + uses: actions/checkout@v2 + with: + repository: microsoft/weblogic-on-azure + path: weblogic-on-azure + + - name: Maven build the web app + id: maven-build-webapp + run: | + echo "build the WebLogic Cafe web app" + mvn -DskipTests clean install --file weblogic-on-azure/javaee/weblogic-cafe/pom.xml + + - name: Query adminVMsver DNS + id: query-adminvmdns + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query adminVMsver DNS for $adminVMName" + adminVMDNS=$(az network public-ip show \ + --resource-group $resourceGroup \ + --name "${adminVMName}_PublicIP" \ + --query dnsSettings.fqdn -o tsv) + echo "##[set-output name=adminVMDNS;]${adminVMDNS}" + + - name: Save adminVMsver DNS for app deployement + id: save-adminvmdns + run: | + echo ${{steps.query-adminvmdns.outputs.adminVMDNS}} + echo "adminVMDNS=${{steps.query-adminvmdns.outputs.adminVMDNS}}" >> $GITHUB_ENV + echo ${adminVMDNS} + + - name: Prepare the webapp deployment script + id: prepare-webapp-deployement-script + run: | + echo ${adminVMDNS} ${wlsUserName} + sed -i "s/#adminVMDNS#/${adminVMDNS}/g; \ + s/#wlsUserName#/$wlsUserName/g; \ + s/#wlsPassword#/$wlsPassword/g" \ + arm-oraclelinux-wls-cluster/test/scripts/deploy-webapp.sh + + echo ${appGatewayURL} + sed -i "s|#appGatewayURL#|${appGatewayURL}|g;" \ + arm-oraclelinux-wls-cluster/test/scripts/verify-webapp-deployment.sh + + - name: Add ip address to security rule to access the wls machine + id: add-ip-to-security-rule-105 + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query existing source address prefixes" + attempt=0 + toCreateRule105=false + while [[ -z `az network nsg show -g $resourceGroup -n ${nsg} | grep "NRMS-Rule-105"` && $attempt -le 5 ]] + do + if [ $attempt -eq 5 ]; then + toCreateRule105=true + fi + echo "network security group rule NRMS-Rule-105 is not ready" + sleep 1m + attempt=$((attempt + 1)) + done + if [ $toCreateRule105 == true ]; then + az network nsg rule create --name NRMS-Rule-105 \ + --nsg-name ${nsg} \ + --priority 102 \ + --resource-group $resourceGroup \ + --access Allow \ + --destination-address-prefixes "*" \ + --destination-port-ranges 1433 1434 3306 4333 5432 6379 7000 7199 9042 9160 9300 16379 26379 27017 \ + --direction Inbound \ + --protocol Tcp \ + --source-address-prefixes $myIP + else + az network nsg rule update \ + --resource-group $resourceGroup \ + --nsg-name ${nsg} \ + --name NRMS-Rule-105 \ + --destination-port-ranges 1433 1434 3306 4333 5432 6379 7000 7199 9042 9160 9300 16379 26379 27017 + fi + + - name: Restart wls VM + id: restart-wls-admin-vm + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "restart vm to make sure security rule work." + az vm restart -g $resourceGroup -n $adminVMName + + # Fix failure that caused by remote server closed. + - name: Restart remote SSH agent + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "Restart remote SSH agent" + az vm user reset-ssh \ + --resource-group $resourceGroup \ + --name ${{ env.adminVMName }} + + - name: Deploy WebLogicCafe app using WebLogic Management Services + id: deploy-webapp + run: | + echo "Deploy WebLogic Cafe to server" + timeout 6m sh -c 'until nc -zv $0 $1; do echo "nc rc: $?"; sleep 5; done' ${adminVMDNS} 7001 + bash arm-oraclelinux-wls-cluster/test/scripts/deploy-webapp.sh + + - name: Verify WebLogicCafe app is successfully deployed + id: verify-webapp-deployment + run: | + echo "Verify WebLogicCafe app is successfully deployed" + bash arm-oraclelinux-wls-cluster/test/scripts/verify-webapp-deployment.sh + + - name: Set up ELK by deploying sub template + id: enable-elk + if: ${{github.event_name == 'workflow_dispatch' && github.event.inputs.enableELK == 'true'}} + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + # Generate parameters for ELK template deployment + bash ${{ env.repoName }}/test/scripts/gen-parameters-deploy-elk.sh \ + <<< "${{ env.repoName }}/test/scripts/parameters-deploy-elk.json \ + ${{ env.adminVMName }} \ + ${{ env.elkPassword }} \ + ${{ env.elkURI }} \ + ${{ env.elkUser }} \ + ${{ env.location }} \ + ${{ env.numberOfInstances }} \ + ${{ env.wlsDomainName }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ env.managedServerPrefix }} \ + ${{ github.run_id }}${{ github.run_number }}" + + echo "Deploy ELK Template..." + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name elk \ + --parameters @${{ env.repoName }}/test/scripts/parameters-deploy-elk.json \ + --template-file ${artifactName}/nestedtemplates/elkNestedTemplate.json + + - name: Get storage account name + id: query-storage-account-name + run: | + echo "query storage account name" + storageAccount=$(az resource list -g $resourceGroup --resource-type Microsoft.Storage/storageAccounts --query [0].name -o tsv) + echo "Storage account name: ${storageAccount}" + echo "storageAccount=${storageAccount}" >> $GITHUB_ENV + + - name: Set up Coherence by deploying sub template + id: enable-coherence + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + # Generate parameters for Coherence template deployment + bash ${{ env.repoName }}/test/scripts/gen-parameters-deploy-coherence.sh \ + <<< "${{ env.repoName }}/test/scripts/parameters-deploy-coherence.json \ + ${{ env.adminVMName }} \ + ${{ env.wlsPassword }} \ + ${{ matrix.images }} \ + ${{ env.location }} \ + ${storageAccount} \ + ${{ env.wlsDomainName }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ env.managedServerPrefix }}" + + echo "Deploy Coherence Template..." + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name coherence \ + --parameters @${{ env.repoName }}/test/scripts/parameters-deploy-coherence.json \ + --template-file ${artifactName}/nestedtemplates/coherenceTemplate.json + + - name: Output addnode artifact name + id: artifact_file_addnode + run: | + addnodeVersion=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/addnode/pom.xml) + artifactNameOfAddnode=${{ env.repoName }}-addnode-$addnodeVersion-arm-assembly + echo "artifactNameOfAddnode=${artifactNameOfAddnode}" >> $GITHUB_ENV + echo "##[set-output name=artifactNameOfAddnode;]${artifactNameOfAddnode}" + - name: Download artifact for deployment + uses: actions/download-artifact@v1 + with: + name: ${{steps.artifact_file_addnode.outputs.artifactNameOfAddnode}} + + - name: Add new nodes to existing cluster + id: add-node + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "add two new nodes and enable app gateway" + echo "generate add-node parameters" + bash ${{ env.repoName }}/test/scripts/gen-parameters-deploy-addnode.sh \ + <<< "${{ env.repoName }}/test/scripts/parameters-deploy-addnode.json \ + ${{ env.wlsPassword }} \ + ${{ env.adminVMName }}:${adminConsolePort} \ + weblogic \ + ${{ env.numberOfInstances }} \ + ${{ matrix.images }} \ + ${storageAccount} \ + ${{ env.wlsDomainName }} \ + ${{ env.location }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ env.managedServerPrefix }}" + echo "deploy add-node template to create new nodes" + az group deployment validate \ + -g ${resourceGroup} \ + -f ${artifactNameOfAddnode}/mainTemplate.json \ + -p @${{ env.repoName }}/test/scripts/parameters-deploy-addnode.json \ + --no-prompt + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name addnode \ + --parameters @${{ env.repoName }}/test/scripts/parameters-deploy-addnode.json \ + --template-file ${artifactNameOfAddnode}/mainTemplate.json + - name: Verify new nodes + id: verify-new-nodes + run: | + mspVM2=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --name ${{ env.managedServerPrefix }}VM2 --query [0].name -o tsv) + if [ -z "$mspVM2" ]; then + echo "Add-node failure: new machine ${{ env.managedServerPrefix }}VM2 does not exist." + exit 1 + fi + + - name: Output addnode-coherence artifact name + id: artifact_file_addnode_coherence + run: | + addnodeCoherenceVersion=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/addnode-coherence/pom.xml) + artifactNameOfAddnodeCo=${{ env.repoName }}-addnode-coherence-$addnodeCoherenceVersion-arm-assembly + echo "artifactNameOfAddnodeCo=${artifactNameOfAddnodeCo}" >> $GITHUB_ENV + echo "##[set-output name=artifactNameOfAddnodeCo;]${artifactNameOfAddnodeCo}" + - name: Download artifact for deployment + uses: actions/download-artifact@v1 + with: + name: ${{steps.artifact_file_addnode_coherence.outputs.artifactNameOfAddnodeCo}} + + - name: Add new cache node to coherence cluster + id: add-node-coherence + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "add new cache server" + echo "generate parameters" + bash ${{ env.repoName }}/test/scripts/gen-parameters-deploy-addnode-coherence.sh \ + <<< "${{ env.repoName }}/test/scripts/parameters-deploy-addnode-coherence.json \ + ${{ env.wlsPassword }} \ + ${{ env.adminVMName }} \ + weblogic \ + 1 \ + ${{ matrix.images }} \ + ${storageAccount} \ + ${{ env.wlsDomainName }} \ + ${{ env.location }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ env.managedServerPrefix }}" + echo "deploy add-node template to create new nodes" + az group deployment validate \ + -g ${resourceGroup} \ + -f ${artifactNameOfAddnodeCo}/mainTemplate.json \ + -p @${{ env.repoName }}/test/scripts/parameters-deploy-addnode-coherence.json \ + --no-prompt + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name addnode \ + --parameters @${{ env.repoName }}/test/scripts/parameters-deploy-addnode-coherence.json \ + --template-file ${artifactNameOfAddnodeCo}/mainTemplate.json + - name: Verify new nodes + id: verify-new-nodes-coherence + run: | + mspVM2=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --name ${{ env.managedServerPrefix }}StorageVM2 --query [0].name -o tsv) + if [ -z "$mspVM2" ]; then + echo "Add-node failure: new machine ${{ env.managedServerPrefix }}StorageVM2 does not exist." + exit 1 + fi + + - name: Output delete-node artifact name + id: artifact_file_deletenode + run: | + deleteNodeVersion=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/deletenode/pom.xml) + artifactNameOfDeleteNode=${{ env.repoName }}-deletenode-$deleteNodeVersion-arm-assembly + echo "artifactNameOfDeleteNode=${artifactNameOfDeleteNode}" >> $GITHUB_ENV + echo "##[set-output name=artifactNameOfDeleteNode;]${artifactNameOfDeleteNode}" + - name: Download artifact for deployment + uses: actions/download-artifact@v1 + with: + name: ${{steps.artifact_file_deletenode.outputs.artifactNameOfDeleteNode}} + - name: Delete nodes from existing cluster + id: delete-node + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "generate delete-node parameters" + bash ${{ env.repoName }}/test/scripts/gen-parameters-deploy-deletenode.sh \ + <<< "${{ env.repoName }}/test/scripts/parameters-deploy-deletenode.json \ + ${{ env.adminVMName }} \ + ${{ env.location }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ env.managedServerPrefix }}" + echo "Run deletenode-cli.sh to remove nodes" + chmod ugo+x ${artifactNameOfDeleteNode}/scripts/deletenode-cli.sh + ${artifactNameOfDeleteNode}/scripts/deletenode-cli.sh \ + -g ${resourceGroup} \ + -f ${artifactNameOfDeleteNode}/mainTemplate.json \ + -p ${{ env.repoName }}/test/scripts/parameters-deploy-deletenode.json \ + -s + - name: Verify deleted nodes + id: verify-deleted-nodes + run: | + mspVM2=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --name ${{ env.managedServerPrefix }}VM2 --query [0].name -o tsv) + count=0 + while [[ -n "$mspVM2" && $count -lt 10 ]]; + do + echo "waiting for $mspVM2 deleted..." + sleep 1m + count=$((count+1)) + mspVM2=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --name ${{ env.managedServerPrefix }}VM2 --query [0].name -o tsv) + if [ -z "$mspVM2" ]; then + break; + fi + done + + if [ -n "$mspVM2" ]; then + echo "Delete-node failure: machine ${{ env.managedServerPrefix }}VM2 is not removed." + exit 1 + fi + + - name: Delete Resource Group + id: delete-resource-group + if: always() + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "delete... " $resourceGroup + az group delete --yes --no-wait --verbose --name $resourceGroup + - name: Delete ELK index + id: delete-elk-index + if: ${{github.event_name == 'workflow_dispatch' && github.event.inputs.enableELK == 'true'}} + run: | + curl -XDELETE --user ${{ env.elkUser }}:${{ env.elkPassword }} ${{ env.elkURI }}/azure-weblogic-cluster-${{ github.run_id }}${{ github.run_number }} + + cleanup-github-resoruce: + needs: deploy-weblogic-cluster + if: always() + runs-on: ubuntu-latest + steps: + - name: Checkout ${{ env.repoName }} + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }} + - name: Delete testing branch + run: | + cd ${{ env.repoName }} + git push https://$gitToken@github.com/$userName/${{ env.repoName }}.git -f --delete $testbranchName + + cleanup-az-resource: + if: always() + needs: deploy-weblogic-cluster + runs-on: ubuntu-latest + steps: + - uses: azure/login@v1 + id: azure-login + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Delete DB Resource Group + id: delete-db-resource-group + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "delete... " $resourceGroup + az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForDependency }} + + summary: + needs: deploy-weblogic-cluster + if: always() + runs-on: ubuntu-latest + steps: + - name: summarize jobs + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + run: | + workflow_jobs=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/wls-eng/arm-oraclelinux-wls-cluster/actions/runs/${{ github.run_id }}/jobs) + critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.name|test("^deploy-weblogic-cluster."))) | length') + echo "$critical_job_num" + succeed_critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.conclusion=="success") | select(.name|test("^deploy-weblogic-cluster."))) | length') + echo "$succeed_critical_job_num" + failed_job_num="$(($critical_job_num-$succeed_critical_job_num))" + echo $failed_job_num + if (($failed_job_num >= 2));then + echo "too many jobs failed, send notification to Teams" + curl ${{ secrets.MSTEAMS_WEBHOOK }} \ + -H 'Content-Type: application/json' \ + --data-binary @- << EOF + { + "@context":"http://schema.org/extensions", + "@type":"MessageCard", + "text":"$failed_job_num jobs failed in Configured Cluster Offer's workflow, please take a look at: https://github.com/wls-eng/arm-oraclelinux-wls-cluster/actions/runs/${{ github.run_id }}" + } + EOF + fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/newtag.yaml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/newtag.yaml new file mode 100644 index 000000000..def24ea6e --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/newtag.yaml @@ -0,0 +1,104 @@ +name: New Tag +on: + workflow_dispatch: + inputs: + tagname: + description: 'Specify Tag name to create/update.' + required: true + default: '2020-12-02-01-Q4' + ref: + description: 'Specify Git Ref if needed.' + required: false + default: 'refs/heads/develop' +env: + tagbranch: "tagbranch" + refArmttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + refJavaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + gitToken: ${{ secrets.GIT_TOKEN }} + repoName: "arm-oraclelinux-wls-cluster" + userEmail: ${{ secrets.USER_EMAIL }} + userName: ${{ secrets.USER_NAME }} + +jobs: + newtag: + runs-on: ubuntu-latest + steps: + - name: Checkout azure-javaee-iaas + uses: actions/checkout@v2 + with: + repository: Azure/azure-javaee-iaas + path: azure-javaee-iaas + ref: ${{ env.refJavaee }} + - name: Checkout arm-ttk + uses: actions/checkout@v2 + with: + repository: Azure/arm-ttk + path: arm-ttk + ref: ${{ env.refArmttk }} + - name: Checkout ${{ env.repoName }} + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }} + ref: ${{ github.event.inputs.ref }} + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build azure-javaee-iaas + run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml + + - name: Build and test ${{ env.repoName }} + run: | + cd ${{ env.repoName }} + mvn -Ptemplate-validation-tests clean install + + - name: Create new tag + run: | + cd ${{ env.repoName }} + git config --global core.longpaths true + git config --global user.email $userEmail + git config --global user.name $userName + + authGitPath=https://$gitToken@github.com/$userName/${{ env.repoName }}.git + + echo "Create tag branch" + remoteBranches=$(git ls-remote --heads) + echo ${remoteBranches} + if [[ -n `echo ${remoteBranches} | grep "${tagbranch}"` ]]; then + git push ${authGitPath} --delete ${tagbranch} -f + fi + git checkout -b ${tagbranch} + + # replace pids + export targetARM="target/arm" + for d in */ ; do + echo $d + if [ ! -d ${d}${targetARM} ];then + continue; + fi + + list=$(find ${d}${targetARM} | grep ".json") + for file in ${list}; do + targetPath=$(echo "$file" | sed "s:target:src/main:g") + if test -f "$targetPath"; then + echo "Replace ${targetPath} with ${file}" + cp -f $file $targetPath + fi + done + done + + git status + git commit -a -m "hard code pids" + git fetch --unshallow + git push ${authGitPath} tagbranch -f + + # remove existing tag + tagname=${{ github.event.inputs.tagname }} + if [[ -n `git ls-remote --tags | grep "${tagname}"` ]]; then + git push ${authGitPath} --delete ${tagname} -f + fi + + # create new tag + git tag ${tagname} + git push ${authGitPath} ${tagname} -f + git push ${authGitPath} --delete ${tagbranch} -f diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/package.yaml b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/package.yaml new file mode 100644 index 000000000..da7f3a918 --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/.github/workflows/package.yaml @@ -0,0 +1,73 @@ +name: Package ARM +on: + workflow_dispatch: + inputs: + pidType: + description: 'Specify which pids to use, oracle or microsoft.' + required: true + default: 'microsoft' + ref: + description: 'Specify Git Ref if needed.' + required: false + default: 'refs/heads/develop' +env: + refArmttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + refJavaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + repoName: "arm-oraclelinux-wls-cluster" + +jobs: + package: + runs-on: ubuntu-latest + steps: + - name: Checkout azure-javaee-iaas + uses: actions/checkout@v2 + with: + repository: Azure/azure-javaee-iaas + path: azure-javaee-iaas + ref: ${{ env.refJavaee }} + - name: Checkout arm-ttk + uses: actions/checkout@v2 + with: + repository: Azure/arm-ttk + path: arm-ttk + ref: ${{ env.refArmttk }} + - name: Checkout ${{ env.repoName }} + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }} + ref: ${{ github.event.inputs.ref }} + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build azure-javaee-iaas + run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml + + - name: Build and test ${{ env.repoName }} using ${{ github.event.inputs.pidType }} pids + run: | + cd ${{ env.repoName }} + pidType=${{ github.event.inputs.pidType }} + if [[ "${pidType}" == "oracle" ]];then + echo "using oracle pid" + mvn -Ptemplate-validation-tests clean install + else + echo "using ms pid" + mvn -Ptemplate-validation-tests clean install -Ddev + fi + + - name: Generate artifact file name and path + id: artifact_file + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/${{ env.repoName }}/pom.xml) + artifactName=${{ env.repoName }}-$version-arm-assembly + unzip ${{ env.repoName }}/${{ env.repoName }}/target/$artifactName.zip -d ${{ env.repoName }}/${{ env.repoName }}/target/$artifactName + echo "##[set-output name=artifactName;]${artifactName}-${{ github.event.inputs.pidType }}" + echo "##[set-output name=artifactPath;]${{ env.repoName }}/${{ env.repoName }}/target/$artifactName" + - name: Archive ${{ env.repoName }} template + uses: actions/upload-artifact@v1 + if: success() + with: + name: ${{steps.artifact_file.outputs.artifactName}} + path: ${{steps.artifact_file.outputs.artifactPath}} + + diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json index 51e810b1b..350115ff1 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json +++ b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/coherenceTemplate.json @@ -466,7 +466,7 @@ ] }, "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'), ' <<< \"',variables('const_singleQuote'),parameters('wlsDomainName'),variables('const_singleQuote'),' ',variables('const_singleQuote'),parameters('wlsUserName'),variables('const_singleQuote'),' ',variables('const_singleQuote'),parameters('wlsPassword'),variables('const_singleQuote'),' ', variables('const_singleQuote'),parameters('adminVMName'),variables('const_singleQuote'),' ',variables('const_singleQuote'),variables('const_wlsHome'),variables('const_singleQuote'),' ',variables('const_singleQuote'),variables('const_wlsDomainPath'),variables('const_singleQuote'),' ', variables('const_singleQuote'),parameters('storageAccountName'),variables('const_singleQuote'), ' ', variables('const_singleQuote'),listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersion2}').keys[0].value,variables('const_singleQuote'),' ', variables('const_singleQuote'),variables('const_mountPointPath'),variables('const_singleQuote'),' ', parameters('enableCoherenceWebLocalStorage'),' ',parameters('enableELK'),' ',variables('const_singleQuote'),parameters('elasticsearchEndpoint'),variables('const_singleQuote'),' ',variables('const_singleQuote'),parameters('elasticsearchUserName'),variables('const_singleQuote'),' ',variables('const_singleQuote'),parameters('elasticsearchPassword'),variables('const_singleQuote'),' ',array.join(parameters('logsToIntegrate')),' ',variables('const_singleQuote'),parameters('logIndex'),variables('const_singleQuote'),' ',variables('name_wlsServerPrefix'),' ',copyIndex(),' ',string(parameters('enableCustomSSL')),' ',base64(parameters('keyVaultCustomIdentityKeyStoreData')),' ',base64(parameters('keyVaultCustomIdentityKeyStorePassPhrase')),' ',base64(parameters('keyVaultCustomIdentityKeyStoreType')),' ',base64(parameters('keyVaultCustomTrustKeyStoreData')),' ',base64(parameters('keyVaultCustomTrustKeyStorePassPhrase')),' ',base64(parameters('keyVaultCustomTrustKeyStoreType')),' ',base64(parameters('keyVaultPrivateKeyAlias')),' ',base64(parameters('keyVaultPrivateKeyPassPhrase')),'\"')]" + "commandToExecute": "[concat('sh',' ',variables('name_scriptFile'), ' <<< \"',parameters('wlsDomainName'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ', parameters('adminVMName'),' ',variables('const_wlsHome'),' ',variables('const_wlsDomainPath'),' ', parameters('storageAccountName'),' ',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '${azure.apiVersion2}').keys[0].value,' ', variables('const_mountPointPath'),' ', parameters('enableCoherenceWebLocalStorage'),' ',parameters('enableELK'),' ',variables('const_singleQuote'),parameters('elasticsearchEndpoint'),variables('const_singleQuote'),' ',variables('const_singleQuote'),parameters('elasticsearchUserName'),variables('const_singleQuote'),' ',variables('const_singleQuote'),parameters('elasticsearchPassword'),variables('const_singleQuote'),' ',array.join(parameters('logsToIntegrate')),' ',variables('const_singleQuote'),parameters('logIndex'),variables('const_singleQuote'),' ',variables('name_wlsServerPrefix'),' ',copyIndex(),' ',string(parameters('enableCustomSSL')),' ',base64(parameters('keyVaultCustomIdentityKeyStoreData')),' ',base64(parameters('keyVaultCustomIdentityKeyStorePassPhrase')),' ',base64(parameters('keyVaultCustomIdentityKeyStoreType')),' ',base64(parameters('keyVaultCustomTrustKeyStoreData')),' ',base64(parameters('keyVaultCustomTrustKeyStorePassPhrase')),' ',base64(parameters('keyVaultCustomTrustKeyStoreType')),' ',base64(parameters('keyVaultPrivateKeyAlias')),' ',base64(parameters('keyVaultPrivateKeyPassPhrase')),'\"')]" } } }, diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dbTemplate.json index 9a7c46f28..a13e5680e 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dbTemplate.json +++ b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/dbTemplate.json @@ -84,7 +84,6 @@ } }, "variables": { - "const_singleQuote": "'", "const_wlsAdminPort": "7005", "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", "name_scriptFilePrefix": "datasourceConfig-", @@ -125,7 +124,7 @@ ] }, "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFilePrefix'),parameters('databaseType'),'.sh <<< \"',variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',variables('const_singleQuote'),parameters('wlsPassword'),variables('const_singleQuote'),' ',parameters('jdbcDataSourceName'),' ',variables('const_singleQuote'),parameters('dsConnectionURL'),variables('const_singleQuote'),' ',parameters('dbUser'),' ',variables('const_singleQuote'),parameters('dbPassword'),variables('const_singleQuote'),'\"')]" + "commandToExecute": "[concat('sh',' ',variables('name_scriptFilePrefix'),parameters('databaseType'),'.sh <<< \"',variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('jdbcDataSourceName'),' ',parameters('dsConnectionURL'),' ',parameters('dbUser'),' ',parameters('dbPassword'),'\"')]" } } }, diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupClusterDomain.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupClusterDomain.sh index 2b456263f..c00794fc2 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupClusterDomain.sh +++ b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/scripts/setupClusterDomain.sh @@ -747,6 +747,7 @@ isHTTPAdminListenPortEnabled="${isHTTPAdminListenPortEnabled,,}" isCustomSSLEnabled="${isCustomSSLEnabled,,}" if [ "${isCustomSSLEnabled}" != "true" ]; +then isCustomSSLEnabled="false" fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-deployments.sh b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-deployments.sh index e7fb46f32..9b523eac1 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-deployments.sh +++ b/weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-deployments.sh @@ -28,47 +28,47 @@ az keyvault secret set --vault-name ${keyVaultName} -n ${certPasswordName} --val # generate parameters for testing differnt cases parametersList=() # parameters for cluster -bash ${scriptsDir}/gen-parameters.sh ${scriptsDir}/parameters.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters.sh <<< "${scriptsDir}/parameters.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters.json) # parameters for cluster+db -bash ${scriptsDir}/gen-parameters-db.sh ${scriptsDir}/parameters-db.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-db.sh <<< "${scriptsDir}/parameters-db.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-db.json) # parameters for cluster+aad -bash ${scriptsDir}/gen-parameters-aad.sh ${scriptsDir}/parameters-aad.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-aad.sh <<< "${scriptsDir}/parameters-aad.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-aad.json) # parameters for cluster+coherence -bash ${scriptsDir}/gen-parameters-elk.sh ${scriptsDir}/parameters-coherence.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-elk.sh <<< "${scriptsDir}/parameters-coherence.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-coherence.json) # parameters for cluster+elk -bash ${scriptsDir}/gen-parameters-elk.sh ${scriptsDir}/parameters-elk.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-elk.sh <<< "${scriptsDir}/parameters-elk.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-elk.json) # parameters for cluster+db+aad -bash ${scriptsDir}/gen-parameters-db-aad.sh ${scriptsDir}/parameters-db-aad.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-db-aad.sh <<< "${scriptsDir}/parameters-db-aad.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-db-aad.json) # parameters for cluster+ag -bash ${scriptsDir}/gen-parameters-ag.sh ${scriptsDir}/parameters-ag.json $githubUserName $testbranchName \ - ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName} +bash ${scriptsDir}/gen-parameters-ag.sh <<< "${scriptsDir}/parameters-ag.json $githubUserName $testbranchName \ + ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName}" parametersList+=(${scriptsDir}/parameters-ag.json) # parameters for cluster+db+ag -bash ${scriptsDir}/gen-parameters-db-ag.sh ${scriptsDir}/parameters-db-ag.json $githubUserName $testbranchName \ - ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName} +bash ${scriptsDir}/gen-parameters-db-ag.sh <<< "${scriptsDir}/parameters-db-ag.json $githubUserName $testbranchName \ + ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName}" parametersList+=(${scriptsDir}/parameters-db-ag.json) # parameters for cluster+aad+ag -bash ${scriptsDir}/gen-parameters-aad-ag.sh ${scriptsDir}/parameters-aad-ag.json $githubUserName $testbranchName \ - ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName} +bash ${scriptsDir}/gen-parameters-aad-ag.sh <<< "${scriptsDir}/parameters-aad-ag.json $githubUserName $testbranchName \ + ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName}" parametersList+=(${scriptsDir}/parameters-aad-ag.json) # parameters for cluster+db+aad+ag -bash ${scriptsDir}/gen-parameters-db-aad-ag.sh ${scriptsDir}/parameters-db-aad-ag.json $githubUserName $testbranchName \ - ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName} +bash ${scriptsDir}/gen-parameters-db-aad-ag.sh <<< "${scriptsDir}/parameters-db-aad-ag.json $githubUserName $testbranchName \ + ${keyVaultName} ${groupName} ${certDataName} ${certPasswordName}" parametersList+=(${scriptsDir}/parameters-db-aad-ag.json) # run preflight tests From 16d371010cfe95d3e7e1b92c18ae01cb79703327 Mon Sep 17 00:00:00 2001 From: Sanjay Mantoor Date: Mon, 30 Aug 2021 09:57:33 +0000 Subject: [PATCH 2/2] Added workflow and updated setup scripts for admin --- .../.github/workflows/build.yml | 523 ++++++++++++++++++ .../.github/workflows/newtag.yaml | 110 ++++ .../.github/workflows/package.yaml | 72 +++ .../main/arm/nestedtemplates/dbTemplate.json | 3 +- .../test/scripts/verify-deployments.sh | 10 +- 5 files changed, 711 insertions(+), 7 deletions(-) create mode 100644 weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/build.yml create mode 100644 weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/newtag.yaml create mode 100644 weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/package.yaml diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/build.yml b/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/build.yml new file mode 100644 index 000000000..48bda2b36 --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/build.yml @@ -0,0 +1,523 @@ +name: Build and Test + +on: + workflow_dispatch: + inputs: + enableELK: + description: 'Specify whether to enable ELK depoyment or not.' + required: true + default: 'false' + # Allows you to run this workflow using GitHub APIs + # PERSONAL_ACCESS_TOKEN= + # REPO_NAME=wls-eng/arm-oraclelinux-wls-admin + # curl --verbose -XPOST -u "wls-eng:${PERSONAL_ACCESS_TOKEN}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${REPO_NAME}/dispatches --data '{"event_type": "production-deploy"}' + repository_dispatch: + +env: + azCliVersion: 2.6.0 + adminConsolePort: 7005 + dbName: wlsdb${{ github.run_id }}${{ github.run_number }} + elkURI: ${{ secrets.ELK_URI }} + elkUser: ${{ secrets.ELK_USER_NAME }} + elkPassword: ${{ secrets.ELK_PSW }} + location: eastus + nsg: wls-nsg + resourceGroupPrefix: wls-${{ github.run_id }}-${{ github.run_number }} + resourceGroupForDependency: wlsd-${{ github.run_id }}-${{ github.run_number }} + userEmail: ${{ secrets.USER_EMAIL }} + userName: ${{ secrets.USER_NAME }} + wlsPassword: ${{ secrets.WLS_PASSWORD }} + adminPassword: ${{ secrets.WLS_PASSWORD }} + wlsDomainName : adminDomain + wlsUserName : weblogic + adminVMName: adminServerVM + offerName: arm-oraclelinux-wls-admin + testbranchName: cicd-${{ github.run_id }}-${{ github.run_number }} + ref_javaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + ref_armttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + git_token: ${{ secrets.GIT_TOKEN }} + +jobs: + preflight: + runs-on: ubuntu-latest + steps: + - name: Checkout azure-javaee-iaas + uses: actions/checkout@v2 + with: + repository: Azure/azure-javaee-iaas + path: azure-javaee-iaas + ref: ${{ env.ref_javaee }} + - name: Checkout arm-ttk + uses: actions/checkout@v2 + with: + repository: Azure/arm-ttk + path: arm-ttk + ref: ${{ env.ref_armttk }} + - name: Checkout ${{ env.offerName }} + uses: actions/checkout@v2 + with: + path: ${{ env.offerName }} + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build azure-javaee-iaas + run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml + - name: Build and test ${{ env.offerName }} + run: mvn -Ptemplate-validation-tests clean install --file ${{ env.offerName }}/pom.xml + + - name: Checkout ${{ env.offerName }} for test + uses: actions/checkout@v2 + with: + path: ${{ env.offerName }}-dev + - name: Create a new branch with development pids in nestedtemplates + run: | + current=`pwd` + echo "current=${current}" >> $GITHUB_ENV + cd ${{ env.offerName }}-dev/src/main/arm/nestedtemplates + git config --global core.longpaths true + git config --global user.email $userEmail + git config --global user.name $userName + echo "create branch $testbranchName" + git checkout -b $testbranchName + rm -r -f $current/${{ env.offerName }}-dev/src/main/arm/nestedtemplates/* + cp -r -f $current/${{ env.offerName }}/target/arm/nestedtemplates/* $current/${{ env.offerName }}-dev/src/main/arm/nestedtemplates/ + git status + git commit -a -m "hard code pids" + git push https://$git_token@github.com/$userName/${{ env.offerName }}.git -f + + - uses: azure/login@v1 + id: azure-login + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Validate deployment templates for different combinations of service integration + id: validate-deployment-templates + run: | + bash ${{ env.offerName }}/test/scripts/verify-deployments.sh \ + <<< "${{ github.run_id }}${{ github.run_number }} ${location} \ + ${{ env.offerName }}/target/arm/mainTemplate.json \ + ${userName} ${testbranchName} ${{ env.offerName }}/test/scripts" + + - name: Get version information from pom.xml + id: version + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.offerName }}/pom.xml) + echo "version=${version}" >> $GITHUB_ENV + - name: Print version + run: echo $version + - name: Generate artifact name + run: echo "artifactName=${{ env.offerName }}-$version-arm-assembly" >> $GITHUB_ENV + - name: Print artifact name + run: echo $artifactName + - name: Output artifact name + id: artifact_file + run: echo "##[set-output name=artifactName;]${{ env.offerName }}-$version-arm-assembly" + - name: Generate zip package path + id: artifact_path + run: echo "##[set-output name=artifactPath;]${{ env.offerName }}/target/$artifactName" + - name: Output artifact path + run: echo $artifactPath + env: + artifactPath: ${{steps.package.outputs.artifactPath}} + - name: Unzip the package as upload action will zip again + run: unzip ${{ env.offerName }}/target/$artifactName.zip -d ${{ env.offerName }}/target/$artifactName + + - name: Archive ${{ env.offerName }} template + uses: actions/upload-artifact@v1 + if: success() + with: + name: ${{steps.artifact_file.outputs.artifactName}} + path: ${{steps.artifact_path.outputs.artifactPath}} + + deploy-dependencies: + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + needs: preflight + runs-on: ubuntu-latest + steps: + - uses: azure/login@v1 + id: azure-login + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Create Resource Group + id: create-resource-group + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "create resource group" ${{ env.resourceGroupForDependency }} + az group create --verbose --name ${{ env.resourceGroupForDependency }} --location ${location} + + - name: Set Up Azure Postgresql to Test dbTemplate + id: setup-postgresql + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "Deploy DB with name " ${{ env.dbName }} + az postgres server create \ + --resource-group ${{ env.resourceGroupForDependency }} \ + --name ${{ env.dbName }} \ + --location ${location} \ + --admin-user weblogic \ + --ssl-enforcement Enabled \ + --public-network-access Enabled \ + --admin-password ${{ env.wlsPassword }} \ + --sku-name B_Gen5_1 + + echo "Allow Access To Azure Services" + az postgres server firewall-rule create \ + -g ${{ env.resourceGroupForDependency }} \ + -s ${{ env.dbName }} \ + -n "AllowAllWindowsAzureIps" \ + --start-ip-address "0.0.0.0" \ + --end-ip-address "0.0.0.0" + + deploy-weblogic-admin: + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + needs: deploy-dependencies + runs-on: ubuntu-latest + strategy: + max-parallel: 1 + fail-fast: false + matrix: + images: ["owls-122130-jdk8-ol73;Oracle:weblogic-122130-jdk8-ol73:owls-122130-jdk8-ol7;latest", "owls-122130-jdk8-ol74;Oracle:weblogic-122130-jdk8-ol74:owls-122130-jdk8-ol7;latest", "owls-122140-jdk8-ol76;Oracle:weblogic-122140-jdk8-ol76:owls-122140-jdk8-ol7;latest", "owls-141100-jdk8-ol76;Oracle:weblogic-141100-jdk8-ol76:owls-141100-jdk8-ol7;latest", "owls-141100-jdk11-ol76;Oracle:weblogic-141100-jdk11-ol76:owls-141100-jdk11-ol7;latest"] + + steps: + - name: Checkout ${{ env.offerName }} + uses: actions/checkout@v2 + with: + path: ${{ env.offerName }} + - name: Get version information from ${{ env.offerName }}/pom.xml + id: version + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.offerName }}/pom.xml) + echo "version=${version}" >> $GITHUB_ENV + - name: Output artifact name for Download action + id: artifact_file + run: | + artifactName=${{ env.offerName }}-$version-arm-assembly + echo "artifactName=${artifactName}" >> $GITHUB_ENV + echo "##[set-output name=artifactName;]${artifactName}" + - name: Download artifact for deployment + uses: actions/download-artifact@v1 + with: + name: ${{steps.artifact_file.outputs.artifactName}} + + - uses: azure/login@v1 + id: azure-login + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Get Image SKU + id: image-sku + run: | + imageUrn="${{ matrix.images }}" + sku=${imageUrn%%;*} + echo "sku=${sku}" >> $GITHUB_ENV + echo ${resourceGroupPrefix} + resourceGroup=$(echo "${resourceGroupPrefix}-${sku}" | sed "s/_//g") + echo "resourceGroup=${resourceGroup}" >> $GITHUB_ENV + - name: Create Resource Group + id: create-resource-group + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "create resource group" $resourceGroup + az group create --verbose --name $resourceGroup --location ${location} + echo "resourceGroup=${resourceGroup}" >> $GITHUB_ENV + + - name: Prepare deployed parameters and test script + id: prepare-deployed-parameters-and-test-script + run: | + sed -i "s/#location#/$location/g; \ + s/#adminPasswordOrKey#/$wlsPassword/g; \ + s/#wlsdomainname#/$wlsDomainName/g; \ + s/#wlsusername#/$wlsUserName/g; \ + s/#wlspassword#/$wlsPassword/g; \ + s/#adminvmname#/$adminVMName/g; \ + s/#skuUrnVersion#/${{ matrix.images }}/g; \ + s/#testbranchName#/$testbranchName/g; \ + s/#gitUserName#/$userName/g" \ + ${{ env.offerName }}/test/data/parameters-test.json + sed -i "s/#adminPasswordOrKey#/$wlsPassword/g" \ + ${{ env.offerName }}/test/scripts/verify-wls-path.sh + + - name: Accept Image Terms + id: accept-terms + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "accept terms for " "${{ matrix.images }}" + rawUrn="${{ matrix.images }}" + publisherAndName=$(echo ${rawUrn} | grep -o ";.*:" | sed "s/;//g") + imageVersion=${rawUrn##*;} + az vm image terms accept --urn ${publisherAndName}${sku}:${imageVersion} + + - name: Deploy WebLogic Server Admin only Domain offer + id: deploy-wls-admin + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + az deployment group create \ + --verbose \ + --resource-group $resourceGroup \ + --name wls-admin-node \ + --parameters @${{ env.offerName }}/test/data/parameters-test.json \ + --template-file ${{ env.offerName }}-$version-arm-assembly/mainTemplate.json + + - name: Verify Network Security Group + id: verify-nsg + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query nsg name, will exit with error if nsg does not exist." + az network nsg show -g $resourceGroup -n ${nsg} --query "name" + + - name: Get IP of build machine + id: get-ip-address + run: | + myIP=$(dig @ns1.google.com TXT o-o.myaddr.l.google.com +short) + echo "myIP=${myIP}" >> $GITHUB_ENV + + - name: Add ip address to security rule to access the wls machine + id: add-ip-to-security-rule + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query existing source address prefixes" + attempt=0 + toCreateRule101=false + while [[ -z `az network nsg show -g $resourceGroup -n ${nsg} | grep "NRMS-Rule-101"` && $attempt -le 5 ]] + do + if [ $attempt -eq 5 ]; then + toCreateRule101=true + fi + echo "network security group rule NRMS-Rule-101 is not ready" + sleep 1m + attempt=$((attempt + 1)) + done + if [ $toCreateRule101 == true ]; then + az network nsg rule create --name NRMS-Rule-101 \ + --nsg-name ${nsg} \ + --priority 101 \ + --resource-group $resourceGroup \ + --access Allow \ + --destination-address-prefixes "*" \ + --destination-port-ranges 22 43 ${adminConsolePort} \ + --direction Inbound \ + --protocol Tcp \ + --source-address-prefixes $myIP + else + sourceAddressPrefixes=$(az network nsg rule show \ + --resource-group $resourceGroup \ + --nsg-name ${nsg} \ + --name NRMS-Rule-101 \ + --query "sourceAddressPrefixes") + echo "IP of this machine: " ${myIP} + sourceAddressPrefixes=$(echo ${myIP} ${sourceAddressPrefixes} | \ + sed 's/,/ /g; s/\[//g; s/\]//g; s/"//g') + echo ${sourceAddressPrefixes} + az network nsg rule update \ + --resource-group $resourceGroup \ + --nsg-name ${nsg} \ + --name NRMS-Rule-101 \ + --source-address-prefixes $sourceAddressPrefixes \ + --destination-port-ranges 443 22 ${adminConsolePort} + fi + - name: Restart wls VM + id: restart-wls-wm + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "restart vm to make sure security rule work." + az vm restart -g $resourceGroup -n $adminVMName + + - name: Query public IP of AdminServer VM + id: query-wls-admin-ip + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "query public ip" + publicIP=$(az vm show \ + --resource-group $resourceGroup \ + --name $adminVMName -d \ + --query publicIps -o tsv) + echo "##[set-output name=publicIP;]${publicIP}" + - name: Create environment variable for AdminServer IP + id: env-admin-ip + run: echo "wlsPublicIP=${{steps.query-wls-admin-ip.outputs.publicIP}}" >> $GITHUB_ENV + + - name: Verify WebLogic Server Installation + id: verify-wls + run: | + echo "pubilc IP of wls machine: ${wlsPublicIP}" + echo "Verifying Weblgic server installation" + timeout 6m sh -c 'until nc -zv $0 $1; do echo "nc rc: $?"; sleep 5; done' ${wlsPublicIP} 22 + echo install sshpass + sudo apt-get install -y sshpass + sshpass -p ${wlsPassword} -v ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=100 -v -tt weblogic@${wlsPublicIP} 'bash -s' < ${{ env.offerName }}/test/scripts/verify-wls-path.sh + + - name: Restart remote SSH agent + id: restart-remote-ssh + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "Restart remote SSH agent" + az vm user reset-ssh \ + --resource-group $resourceGroup \ + --name ${{ env.adminVMName }} + + - name: Verify system services at admin server + id: veriy-admin-service + run: | + echo "Verifying WebLogic services at admin server" + sshpass -p ${wlsPassword} -v ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=100 -v -tt weblogic@${wlsPublicIP} 'bash -s' < ${{ env.offerName }}/test/scripts/verify-services.sh + + - name: Verify WebLogic Server Access + id: verify-wls-access + run: | + echo "Verifying Weblogic Server Access" + echo ${wlsPublicIP} + bash ${{ env.offerName }}/test/scripts/verify-wls-access.sh <<< "${wlsPublicIP} 7005" + + - name: Deploy DB Template to Connect to Azure Postgresql Database + id: enable-postgresql-db + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + # Generate parameters for db template deployment + bash ${{ env.offerName }}/test/scripts/gen-parameters-deploy-db.sh \ + <<< "${{ env.offerName }}/test/scripts/ \ + ${{ env.adminVMName }} \ + ${{ env.wlsPassword}} \ + ${{ env.dbName }} \ + ${{ env.location }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }}" + echo "Deploy DB Template..." + az group deployment create \ + --verbose \ + --resource-group ${resourceGroup} \ + --name db \ + --parameters @${{ env.offerName }}/test/scripts/parameters-deploy-db.json \ + --template-file ${{ env.offerName }}-$version-arm-assembly/nestedtemplates/dbTemplate.json + + - name: Set up ELK by deploying sub template + id: enable-elk + if: ${{github.event_name == 'workflow_dispatch' && github.event.inputs.enableELK == 'true'}} + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + # Generate parameters for ELK template deployment + bash ${{ env.offerName }}/test/scripts/gen-parameters-deploy-elk.sh \ + <<< "${{ env.offerName }}/test/scripts/parameters-deploy-elk.json \ + ${{ env.adminVMName }} \ + ${{ env.elkPassword }} \ + ${{ env.elkURI }} \ + ${{ env.elkUser }} \ + ${{ env.location }} \ + ${{ env.wlsDomainName }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ github.run_id }}${{ github.run_number }}" + echo "Deploy ELK Template..." + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name elk \ + --parameters @${{ env.offerName }}/test/scripts/parameters-deploy-elk.json \ + --template-file ${artifactName}/nestedtemplates/elkNestedTemplate.json + - name: Delete Resource Group + id: delete-resource-group + if: always() + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "delete... " $resourceGroup + az group delete --yes --no-wait --verbose --name $resourceGroup + - name: Delete ELK index + id: delete-elk-index + if: ${{github.event_name == 'workflow_dispatch' && github.event.inputs.enableELK == 'true'}} + run: | + curl -XDELETE --user ${{ env.elkUser }}:${{ env.elkPassword }} ${{ env.elkURI }}/azure-weblogic-admin-${{ github.run_id }}${{ github.run_number }} + + cleanup-github-resource: + needs: deploy-weblogic-admin + if: always() + runs-on: ubuntu-latest + steps: + - name: Checkout ${{ env.offerName }} + uses: actions/checkout@v2 + with: + path: ${{ env.offerName }} + - name: Delete testing branch + run: | + cd ${{ env.offerName }} + git push https://$git_token@github.com/$userName/${{ env.offerName }}.git -f --delete $testbranchName + + cleanup-az-resource: + needs: deploy-weblogic-admin + if: always() + runs-on: ubuntu-latest + steps: + - name: Checkout ${{ env.offerName }} + uses: actions/checkout@v2 + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + with: + path: ${{ env.offerName }} + - uses: azure/login@v1 + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + id: azure-login + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - name: Delete DB Resource Group + id: delete-db-resource-group + uses: azure/CLI@v1 + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + echo "delete... " $resourceGroup + az group delete --yes --no-wait --verbose --name ${{ env.resourceGroupForDependency }} + + summary: + needs: deploy-weblogic-admin + if: always() + runs-on: ubuntu-latest + steps: + - name: summarize jobs + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + run: | + workflow_jobs=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/wls-eng/arm-oraclelinux-wls-admin/actions/runs/${{ github.run_id }}/jobs) + critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.name|test("^deploy-weblogic-admin."))) | length') + echo "$critical_job_num" + succeed_critical_job_num=$(echo $workflow_jobs | jq '.jobs | map(select(.conclusion=="success") | select(.name|test("^deploy-weblogic-admin."))) | length') + echo "$succeed_critical_job_num" + failed_job_num="$(($critical_job_num-$succeed_critical_job_num))" + echo $failed_job_num + if (($failed_job_num >= 2));then + echo "too many jobs failed, send notification to Teams" + curl ${{ secrets.MSTEAMS_WEBHOOK }} \ + -H 'Content-Type: application/json' \ + --data-binary @- << EOF + { + "@context":"http://schema.org/extensions", + "@type":"MessageCard", + "text":"$failed_job_num jobs failed in Admin Offer's workflow, please take a look at: https://github.com/wls-eng/arm-oraclelinux-wls-admin/actions/runs/${{ github.run_id }}" + } + EOF + fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/newtag.yaml b/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/newtag.yaml new file mode 100644 index 000000000..691f75077 --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/newtag.yaml @@ -0,0 +1,110 @@ +name: New Tag +on: + workflow_dispatch: + inputs: + tagname: + description: 'Specify Tag name to create/update.' + required: true + default: '2020-12-02-01-Q4' + ref: + description: 'Specify Git Ref if needed.' + required: false + default: 'refs/heads/develop' +env: + tagbranch: "tagbranch" + gitToken: ${{ secrets.GIT_TOKEN }} + refArmttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + refJavaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + repoName: "arm-oraclelinux-wls-admin" + userEmail: ${{ secrets.USER_EMAIL }} + userName: ${{ secrets.USER_NAME }} + +jobs: + newtag: + runs-on: ubuntu-latest + steps: + - name: Checkout azure-javaee-iaas + uses: actions/checkout@v2 + with: + repository: Azure/azure-javaee-iaas + path: azure-javaee-iaas + ref: ${{ env.refJavaee }} + - name: Checkout arm-ttk + uses: actions/checkout@v2 + with: + repository: Azure/arm-ttk + path: arm-ttk + ref: ${{ env.refArmttk }} + - name: Checkout ${{ env.repoName }} + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }} + ref: ${{ github.event.inputs.ref }} + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build azure-javaee-iaas + run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml + + - name: Build and test ${{ env.repoName }} + run: | + cd ${{ env.repoName }} + mvn -Ptemplate-validation-tests clean install + + - name: Create new tag + run: | + cd ${{ env.repoName }} + git config --global core.longpaths true + git config --global user.email $userEmail + git config --global user.name $userName + + authGitPath=https://$gitToken@github.com/$userName/${{ env.repoName }}.git + + echo "Create tag branch" + remoteBranches=$(git ls-remote --heads) + echo ${remoteBranches} + if [[ -n `echo ${remoteBranches} | grep "${tagbranch}"` ]]; then + git push ${authGitPath} --delete ${tagbranch} -f + fi + + if [[ -n `git branch --all | grep "${tagbranch}"` ]]; then + git branch -D ${tagbranch} + fi + + git checkout -b ${tagbranch} + + # replace pids + export targetARM="arm" + for d in */ ; do + echo $d + if [ ! -d ${d}${targetARM} ];then + continue; + fi + + list=$(find ${d}${targetARM} | grep ".json") + for file in ${list}; do + targetPath=$(echo "$file" | sed "s:target:src/main:g") + if test -f "$targetPath"; then + echo "Replace ${targetPath} with ${file}" + cp -f $file $targetPath + fi + done + done + + git status + git add --all + git commit -m "hard code pids" + git fetch --unshallow + git push ${authGitPath} tagbranch -f + + # remove existing tag + tagname=${{ github.event.inputs.tagname }} + if [[ -n `git ls-remote --tags | grep "${tagname}"` ]]; then + git push ${authGitPath} --delete ${tagname} -f + fi + + # create new tag + git tag ${tagname} + git push ${authGitPath} ${tagname} -f + git push ${authGitPath} --delete ${tagbranch} -f diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/package.yaml b/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/package.yaml new file mode 100644 index 000000000..521ee1b89 --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-admin/.github/workflows/package.yaml @@ -0,0 +1,72 @@ +name: Package ARM +on: + workflow_dispatch: + inputs: + pidType: + description: 'Specify which pids to use, oracle or microsoft.' + required: true + default: 'microsoft' + ref: + description: 'Specify Git Ref if needed.' + required: false + default: 'refs/heads/develop' +env: + refArmttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + refJavaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + repoName: "arm-oraclelinux-wls-admin" + +jobs: + package: + runs-on: ubuntu-latest + steps: + - name: Checkout azure-javaee-iaas + uses: actions/checkout@v2 + with: + repository: Azure/azure-javaee-iaas + path: azure-javaee-iaas + ref: ${{ env.refJavaee }} + - name: Checkout arm-ttk + uses: actions/checkout@v2 + with: + repository: Azure/arm-ttk + path: arm-ttk + ref: ${{ env.refArmttk }} + - name: Checkout ${{ env.repoName }} + uses: actions/checkout@v2 + with: + path: ${{ env.repoName }} + ref: ${{ github.event.inputs.ref }} + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build azure-javaee-iaas + run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml + + - name: Build and test ${{ env.repoName }} using ${{ github.event.inputs.pidType }} pids + run: | + cd ${{ env.repoName }} + pidType=${{ github.event.inputs.pidType }} + if [[ "${pidType}" == "oracle" ]];then + echo "using oracle pid" + mvn -Ptemplate-validation-tests clean install + else + echo "using ms pid" + mvn -Ptemplate-validation-tests clean install -Ddev + fi + + - name: Generate artifact file name and path + id: artifact_file + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' ${{ env.repoName }}/pom.xml) + artifactName=${{ env.repoName }}-$version-arm-assembly + unzip ${{ env.repoName }}/target/$artifactName.zip -d ${{ env.repoName }}/target/$artifactName + echo "##[set-output name=artifactName;]${artifactName}-${{ github.event.inputs.pidType }}" + echo "##[set-output name=artifactPath;]${{ env.repoName }}/target/$artifactName" + - name: Archive ${{ env.repoName }} template + uses: actions/upload-artifact@v1 + if: success() + with: + name: ${{steps.artifact_file.outputs.artifactName}} + path: ${{steps.artifact_file.outputs.artifactPath}} + diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dbTemplate.json index 4dd6bfb52..1e174dffb 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dbTemplate.json +++ b/weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/dbTemplate.json @@ -80,7 +80,6 @@ } }, "variables": { - "const_singleQuote": "'", "const_wlsAdminPort": "7005", "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", "name_scriptFilePrefix": "datasourceConfig-", @@ -121,7 +120,7 @@ ] }, "protectedSettings": { - "commandToExecute": "[concat('sh',' ',variables('name_scriptFilePrefix'),parameters('databaseType'),'.sh <<< \"',variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',variables('const_singleQuote'),parameters('wlsPassword'),variables('const_singleQuote'),' ',parameters('jdbcDataSourceName'),' ',variables('const_singleQuote'),parameters('dsConnectionURL'),variables('const_singleQuote'),' ',parameters('dbUser'),' ',variables('const_singleQuote'),parameters('dbPassword'),variables('const_singleQuote'),'\"')]" + "commandToExecute": "[concat('sh',' ',variables('name_scriptFilePrefix'),parameters('databaseType'),'.sh <<< \"',variables('const_wlsHome'),' ',parameters('adminVMName'),' ',variables('const_wlsAdminPort'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',parameters('jdbcDataSourceName'),' ',parameters('dsConnectionURL'),' ',parameters('dbUser'),' ',parameters('dbPassword'),'\"')]" } } }, diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-deployments.sh b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-deployments.sh index 42bd61b5c..ff6aa6f84 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-deployments.sh +++ b/weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-deployments.sh @@ -13,23 +13,23 @@ az group create --verbose --name $groupName --location ${location} # generate parameters for testing differnt cases parametersList=() # parameters for cluster -bash ${scriptsDir}/gen-parameters.sh ${scriptsDir}/parameters.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters.sh <<< "${scriptsDir}/parameters.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters.json) # parameters for cluster+db -bash ${scriptsDir}/gen-parameters-db.sh ${scriptsDir}/parameters-db.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-db.sh <<< "${scriptsDir}/parameters-db.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-db.json) # parameters for cluster+aad -bash ${scriptsDir}/gen-parameters-aad.sh ${scriptsDir}/parameters-aad.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-aad.sh <<< "${scriptsDir}/parameters-aad.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-aad.json) # parameters for admin+elk -bash ${scriptsDir}/gen-parameters-elk.sh ${scriptsDir}/parameters-elk.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-elk.sh <<< "${scriptsDir}/parameters-elk.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-elk.json) # parameters for cluster+db+aad -bash ${scriptsDir}/gen-parameters-db-aad.sh ${scriptsDir}/parameters-db-aad.json $githubUserName $testbranchName +bash ${scriptsDir}/gen-parameters-db-aad.sh <<< "${scriptsDir}/parameters-db-aad.json $githubUserName $testbranchName" parametersList+=(${scriptsDir}/parameters-db-aad.json) # run preflight tests