diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/build.yml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/build.yml new file mode 100644 index 000000000..40e7b5ab9 --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/build.yml @@ -0,0 +1,837 @@ +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-dynamic-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 + 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 }} + location: eastus + nsg: wls-nsg + resourceGroupForDependency: wlsd-${{ github.run_id }}-${{ github.run_number }} + resourceGroupPrefix: wls-${{ github.run_id }}-${{ github.run_number }} + userEmail: ${{ secrets.USER_EMAIL }} + userName: ${{ secrets.USER_NAME }} + wlsPassword: ${{ secrets.WLS_PASSWORD }} + adminPassword: ${{ secrets.WLS_PASSWORD }} + otnUser: ${{ secrets.OTN_USERID }} + otnPassword: ${{ secrets.OTN_PASSWORD }} + wlsDomainName: dyClusterDomain + wlsUserName: weblogic + managedServerPrefix: managedServer + adminVMName: adminServerVM + managedServers: "managedServer1" + managedServerVM: "managedServerVM1" + testbranchName: cicd-${{ github.run_id }}-${{ github.run_number }} + ref_javaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + ref_armttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + git_token: ${{ secrets.GIT_TOKEN }} + maxDynamicClusterSize: 2 + dynamicClusterSize: 1 + 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.ref_javaee }} + - name: Checkout arm-ttk + uses: actions/checkout@v2 + with: + repository: Azure/arm-ttk + path: arm-ttk + ref: ${{ env.ref_armttk }} + - name: Checkout arm-oraclelinux-wls-dynamic-cluster + uses: actions/checkout@v2 + with: + path: arm-oraclelinux-wls-dynamic-cluster + - 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: Built and test arm-oraclelinux-wls-dynamic-cluster + run: mvn -Ptemplate-validation-tests clean install --file arm-oraclelinux-wls-dynamic-cluster/pom.xml + + - name: Checkout arm-oraclelinux-wls-dynamic-cluster for test + uses: actions/checkout@v2 + with: + path: arm-oraclelinux-wls-dynamic-cluster-dev + + - name: Create a new branch with development pids in nestedtemplates + run: | + current=`pwd` + echo "current=${current}" >> $GITHUB_ENV + cd arm-oraclelinux-wls-dynamic-cluster-dev/arm-oraclelinux-wls-dynamic-cluster/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/arm-oraclelinux-wls-dynamic-cluster-dev/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/* + cp -r -f $current/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/target/arm/nestedtemplates/* $current/arm-oraclelinux-wls-dynamic-cluster-dev/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ + git status + git commit -a -m "hard code pids" + git push https://$git_token@github.com/$userName/arm-oraclelinux-wls-dynamic-cluster -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 arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh <<< \ + "${{ github.run_id }}${{ github.run_number }} ${location} \ + arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/target/arm/mainTemplate.json \ + ${userName} ${testbranchName} arm-oraclelinux-wls-dynamic-cluster/test/scripts" + + - name: Generate artifact file name and path + id: artifact_file + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/pom.xml) + artifactName=arm-oraclelinux-wls-dynamic-cluster-$version-arm-assembly + unzip arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/target/$artifactName.zip -d arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/target/$artifactName + echo "##[set-output name=artifactName;]${artifactName}" + echo "##[set-output name=artifactPath;]arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/target/$artifactName" + - name: Archive arm-oraclelinux-wls-dynamic-cluster 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;}' arm-oraclelinux-wls-dynamic-cluster/addnode/pom.xml) + addnode_artifactName=arm-oraclelinux-wls-dynamic-cluster-addnode-$addnode_version-arm-assembly + unzip arm-oraclelinux-wls-dynamic-cluster/addnode/target/$addnode_artifactName.zip -d arm-oraclelinux-wls-dynamic-cluster/addnode/target/$addnode_artifactName + echo "##[set-output name=addnode_artifactName;]${addnode_artifactName}" + echo "##[set-output name=addnode_artifactPath;]arm-oraclelinux-wls-dynamic-cluster/addnode/target/$addnode_artifactName" + - name: Archive arm-oraclelinux-wls-dynamic-cluster 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;}' arm-oraclelinux-wls-dynamic-cluster/deletenode/pom.xml) + deletenode_artifactName=arm-oraclelinux-wls-dynamic-cluster-deletenode-$deletenode_version-arm-assembly + unzip arm-oraclelinux-wls-dynamic-cluster/deletenode/target/$deletenode_artifactName.zip -d arm-oraclelinux-wls-dynamic-cluster/deletenode/target/$deletenode_artifactName + echo "##[set-output name=deletenode_artifactName;]${deletenode_artifactName}" + echo "##[set-output name=deletenode_artifactPath;]arm-oraclelinux-wls-dynamic-cluster/deletenode/target/$deletenode_artifactName" + + - name: Archive arm-oraclelinux-wls-dynamic-cluster 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;}' arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/pom.xml) + addnode_coherence_artifactName=arm-oraclelinux-wls-dynamic-cluster-addnode-coherence-$addnode_coherence_version-arm-assembly + unzip arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/target/$addnode_coherence_artifactName.zip -d arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/target/$addnode_coherence_artifactName + echo "##[set-output name=addnode_coherence_artifactName;]${addnode_coherence_artifactName}" + echo "##[set-output name=addnode_coherence_artifactPath;]arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/target/$addnode_coherence_artifactName" + + - name: Archive arm-oraclelinux-wls-dynamic-cluster 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: preflight + 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 arm-oraclelinux-wls-dynamic-cluster + uses: actions/checkout@v2 + with: + path: arm-oraclelinux-wls-dynamic-cluster + - name: Get version information from arm-oraclelinux-wls-dynamic-cluster/pom.xml + id: version + run: | + version=$(awk '/[^<]+<\/version>/{gsub(/|<\/version>/,"",$1);print $1;exit;}' arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/pom.xml) + echo "version=${version}" >> $GITHUB_ENV + - name: Output artifact name for Download action + id: artifact_file + run: | + artifactName=arm-oraclelinux-wls-dynamic-cluster-$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: | + imageUrn="${{ matrix.images }}" + sed -i "s/#adminPasswordOrKey#/$wlsPassword/g" \ + arm-oraclelinux-wls-dynamic-cluster/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" \ + arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-servers-lifecycle.sh + + echo "Generate deployment parameters..." + bash arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy.sh <<< \ + "arm-oraclelinux-wls-dynamic-cluster/test/scripts/parameters-test.json \ + $location \ + $wlsPassword \ + $wlsDomainName \ + $wlsUserName \ + $wlsPassword \ + $managedServerPrefix \ + $maxDynamicClusterSize \ + $dynamicClusterSize \ + $adminVMName \ + $imageUrn \ + $testbranchName \ + $userName" + + - 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 Dynamic Cluster Domain offer + id: deploy-wls-dycluster + uses: azure/CLI@v1 + with: + azcliversion: ${{ env.azCliVersion }} + inlineScript: | + az deployment group create \ + --verbose \ + --resource-group $resourceGroup \ + --name wls-dycluster-node \ + --parameters @arm-oraclelinux-wls-dynamic-cluster/test/scripts/parameters-test.json \ + --template-file arm-oraclelinux-wls-dynamic-cluster-$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: 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' < arm-oraclelinux-wls-dynamic-cluster/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' < arm-oraclelinux-wls-dynamic-cluster/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' < arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-services.sh $wls_managedServer_services + + - name: Verify WebLogic Server Access + id: verify-wls-access + run: | + echo "Verifying Weblogic Server Access" + bash arm-oraclelinux-wls-dynamic-cluster/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' < arm-oraclelinux-wls-dynamic-cluster/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 arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-db.sh <<< \ + "arm-oraclelinux-wls-dynamic-cluster/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 @arm-oraclelinux-wls-dynamic-cluster/test/scripts/parameters-deploy-db.json \ + --template-file arm-oraclelinux-wls-dynamic-cluster-$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 arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-elk.sh <<< \ + "arm-oraclelinux-wls-dynamic-cluster/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 }} \ + ${{ env.managedServerPrefix }} \ + ${{ env.maxDynamicClusterSize }} \ + ${{ env.dynamicClusterSize }} \ + ${{ github.run_id }}${{ github.run_number }}" + + echo "Deploy ELK Template..." + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name elk \ + --parameters @arm-oraclelinux-wls-dynamic-cluster/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 arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-coherence.sh <<< \ + "arm-oraclelinux-wls-dynamic-cluster/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 @arm-oraclelinux-wls-dynamic-cluster/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;}' arm-oraclelinux-wls-dynamic-cluster/addnode/pom.xml) + artifactNameOfAddnode=arm-oraclelinux-wls-dynamic-cluster-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" + echo "generate add-node parameters" + bash arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-addnode.sh <<< \ + "arm-oraclelinux-wls-dynamic-cluster/test/scripts/parameters-deploy-addnode.json \ + ${{ env.wlsPassword }} \ + ${{ env.adminVMName }}:${adminConsolePort} \ + weblogic \ + 1 \ + ${{ matrix.images }} \ + ${storageAccount} \ + ${{ env.wlsDomainName }} \ + ${{ env.location }} \ + ${{ env.wlsUserName }} \ + ${{ env.wlsPassword }} \ + ${{ env.userName }} \ + ${{ env.testbranchName }} \ + ${{ env.managedServerPrefix }} \ + ${{ env.dynamicClusterSize }} \ + ${{ env.maxDynamicClusterSize }}" + + echo "deploy add-node template to create new nodes" + az group deployment validate \ + -g ${resourceGroup} \ + -f ${artifactNameOfAddnode}/mainTemplate.json \ + -p @arm-oraclelinux-wls-dynamic-cluster/test/scripts/parameters-deploy-addnode.json \ + --no-prompt + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name addnode \ + --parameters @arm-oraclelinux-wls-dynamic-cluster/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;}' arm-oraclelinux-wls-dynamic-cluster/addnode-coherence/pom.xml) + artifactNameOfAddnodeCo=arm-oraclelinux-wls-dynamic-cluster-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 arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-addnode-coherence.sh <<< \ + "arm-oraclelinux-wls-dynamic-cluster/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 @arm-oraclelinux-wls-dynamic-cluster/test/scripts/parameters-deploy-addnode-coherence.json \ + --no-prompt + az group deployment create \ + --debug \ + --resource-group ${resourceGroup} \ + --name addnode \ + --parameters @arm-oraclelinux-wls-dynamic-cluster/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;}' arm-oraclelinux-wls-dynamic-cluster/deletenode/pom.xml) + artifactNameOfDeleteNode=arm-oraclelinux-wls-dynamic-cluster-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 arm-oraclelinux-wls-dynamic-cluster/test/scripts/gen-parameters-deploy-deletenode.sh <<< \ + "arm-oraclelinux-wls-dynamic-cluster/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 arm-oraclelinux-wls-dynamic-cluster/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) + 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-dynamic-cluster-${{ github.run_id }}${{ github.run_number }} + + cleanup-github-resource: + needs: deploy-weblogic-cluster + if: always() + runs-on: ubuntu-latest + steps: + - name: Checkout arm-oraclelinux-wls-dynamic-cluster + uses: actions/checkout@v2 + with: + path: arm-oraclelinux-wls-dynamic-cluster + - name: Delete testing branch + run: | + cd arm-oraclelinux-wls-dynamic-cluster + git push https://$git_token@github.com/$userName/arm-oraclelinux-wls-dynamic-cluster.git -f --delete $testbranchName + + cleanup-az-resource: + if: always() + needs: deploy-weblogic-cluster + runs-on: ubuntu-latest + steps: + - 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 }} + - name: Delete ELK index + id: delete-elk-index + if: ${{!(github.event_name == 'schedule' && github.repository_owner != 'wls-eng')}} + run: | + curl -XDELETE --user ${{ env.elkUser }}:${{ env.elkPassword }} ${{ env.elkURI }}/azure-weblogic-dynamic-cluster-${{ github.run_id }}${{ github.run_number }} + + 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-dynamic-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 Dynamic Cluster Offer's workflow, please take a look at: https://github.com/wls-eng/arm-oraclelinux-wls-dynamic-cluster/actions/runs/${{ github.run_id }}" + } + EOF + fi diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/newtag.yaml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/newtag.yaml new file mode 100644 index 000000000..d27d1ff41 --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-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" + gitToken: ${{ secrets.GIT_TOKEN }} + refArmttk: d97aa57d259e2fc8562e11501b1cf902265129d9 + refJavaee: 6addd99d8bc3f472e040f11c053a37e1ac370229 + repoName: "arm-oraclelinux-wls-dynamic-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 \ No newline at end of file diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/pakage.yaml b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/pakage.yaml new file mode 100644 index 000000000..25b182d3e --- /dev/null +++ b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/.github/workflows/pakage.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-dynamic-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 }} + echo ${pidType} + if [[ "${pidType}" == "oracle" ]];then + echo "using oracle pids" + mvn -Ptemplate-validation-tests clean install + else + echo "using ms pids" + 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-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dbTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dbTemplate.json index bfce9c15c..c8363eeeb 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dbTemplate.json +++ b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/dbTemplate.json @@ -85,7 +85,6 @@ } }, "variables": { - "const_singleQuote": "'", "const_wlsAdminPort": "7005", "const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home", "name_scriptFilePrefix": "datasourceConfig-", @@ -126,7 +125,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-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ohsNestedTemplate.json b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ohsNestedTemplate.json index f09758596..d6981d2cc 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ohsNestedTemplate.json +++ b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/arm-oraclelinux-wls-dynamic-cluster/src/main/arm/nestedtemplates/ohsNestedTemplate.json @@ -352,7 +352,7 @@ ] }, "protectedSettings": { - "commandToExecute": "[concat('sh setupOHS.sh',' <<< \"',parameters('ohsDomainName'),' ',parameters('ohsComponentName'),' ',parameters('ohsNMUser'),' ',parameters('ohsNMPassword'),' ',parameters('ohshttpPort'),' ',parameters('ohshttpsPort'),' ',parameters('adminRestMgmtURL'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',base64(parameters('ohsSSLKeystoreData')),' ',base64(parameters('ohsSSLKeystorePassword')),' ',parameters('oracleVaultPswd'),' ',parameters('keyType'))]" + "commandToExecute": "[concat('sh setupOHS.sh',' <<< \"',parameters('ohsDomainName'),' ',parameters('ohsComponentName'),' ',parameters('ohsNMUser'),' ',parameters('ohsNMPassword'),' ',parameters('ohshttpPort'),' ',parameters('ohshttpsPort'),' ',parameters('adminRestMgmtURL'),' ',parameters('wlsUserName'),' ',parameters('wlsPassword'),' ',base64(parameters('ohsSSLKeystoreData')),' ',base64(parameters('ohsSSLKeystorePassword')),' ',parameters('oracleVaultPswd'),' ',parameters('keyType'),'\"')]" } } } diff --git a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh index e5797b95d..860ca7668 100644 --- a/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh +++ b/weblogic-azure-vm/arm-oraclelinux-wls-dynamic-cluster/test/scripts/verify-deployments.sh @@ -13,27 +13,27 @@ 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 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) # run preflight tests