Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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>[^<]+<\/version>/{gsub(/<version>|<\/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}}

Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
}
},
"variables": {
"const_singleQuote": "'",
"const_wlsAdminPort": "7005",
"const_wlsHome": "/u01/app/wls/install/oracle/middleware/oracle_home",
"name_scriptFilePrefix": "datasourceConfig-",
Expand Down Expand Up @@ -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'),'\"')]"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading