Skip to content

Commit

Permalink
Merge branch 'pegasystems:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vikasmviky authored Dec 2, 2021
2 parents 1821677 + 09c521d commit 7a71b9e
Show file tree
Hide file tree
Showing 137 changed files with 5,582 additions and 1,003 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@
**/*.iml

# VS Code
.vscode/*
.vscode/*

# doc-service
docs-service/docs-service.yml
docs-service/docs-service-stop.cmd
docs-service/docs-service-start.cmd
76 changes: 41 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
os: linux
dist: xenial
dist: bionic
env:
global:
- HELM_URL=https://get.helm.sh
Expand All @@ -14,6 +14,7 @@ install:
- PATH=`pwd`/linux-amd64/:$PATH
# Install YamlLint
- sudo pip install yamllint=="${YAMLLINT_VERSION}"
- nvm install --lts
- npm install -g --save remark-cli to-vfile remark-preset-lint-recommended remark-validate-links remark-lint-no-dead-urls remark-message-control remark-preset-lint-markdown-style-guide remark-lint
# Install Go
- eval "$(gimme 1.13.1)"
Expand Down Expand Up @@ -46,20 +47,20 @@ deploy:
- provider: releases
api_key:
secure: >
GuZqxcgBOueUOJWg6t5NaCTIssfkptgdAjwyWm/6SaVXqs9Kdgy
EawtYSu0WLh815qGmuxgVjMbvvkAvtbBXanKH+BheRl1cQjYnza
XJlL+Oa/xxzCqz1n4txqtDMR7l/loqrMTzCRe2bZ806z3+uXpXh
CO12+LwvMDJAAddDkX+2wRE240/1f/0lVlZ2lNzgBitC63jAf1H
ml3/KrgHsTYvNB5M6qKn8C24DcC6PMe012K3hL0O+F+er9Mb39R
FcSLTjF/6AiLvpK4oDAg8sBgciXVq0FPhCXvjbINGB/AY7jM5Ql
0A6ngngZjsjefn+NbtZ3aK230h2m0XM+dN7FJCbtRQeqvczcwRT
/wpDimpzFR0rf/NdXV4G+UZYI6a3bjqKYP5IPN8BbzVo8KzlbGW
JeJLV40gW7EbdyT57R2dNp46I17c1KL8atQH97n3yv9d9ZaC87O
6tOohLmue7L3lKxPDpY60VFna5BjJwvrhW4gvsd11Ko4c39FSu8
ogBSZ6E1EOlmVZDX+cBjuw4dGihcrHqWW5V3k2X/ksAKb+4A74g
AG8pCr/ifPEj9kTWb71IIF5RHkD6JqeGJdKaWFHDpWlYhKNTLRt
3gmcgdLmM5MN9A5khwBzPYiF5oaWT1COxh/Rjdz5V0+jUvyRvc9
a/rvc6hM6quXSmlAwA0U=
B5F4dCPvLmAP2pSCNLptl4vR9hk8AW+vrwsO6wlHsjGwmlKTs2w
YTWjPWA9SEFHO4OouxxsJv96ndPQ+i7TtKNjAJ65Ll1saztsIcn
G+Si567swtSPU4dEq4VhvabXmfZ1+1b/7zjP+fSAnmj41QZzLjI
3V5bQSTgyvVM7Xrol4OYJKX6iiX6p5noo7ysXGXL3iXn3vR+mya
qGIldsM9Bw2NyKeueu070dWq7hPJ4jEl8ObAzKVCjm5C7xqhN47
tl9yPBnicGbsD6qKzMtI97oCTCRz4sxLcbwhPsGg/1T+EpJDvBq
BSkA7OVdJ9Oi7hY+V47aBw9B4s9ABiIDQTTwz38Yu77FcJIMW8K
XH4Pez0xlDg7JD4wmrC07dHNtsz+d9wm4OKvdZnce7bUZ+LYCiL
eX1RPrfcVzTRsmiPyzAHNC6KOUtCrcIS6Jl8Eoq0aZfUjhE/cqy
+q6m6eVEGbt/rz/WVnxeQRjauoPnyCnueREuxndJ+zLMJc21a6Y
6tEZ9Y8DkOVxIL3v8SsCrf2/j0E5zctPpkODzuCY/jtaDjX92i/
xvWna69SRrwUu+66INfT1joG4NgPXCTqpovKcVPSM8YjGGiRbjp
Q2mfeqFIphhDH5ZWEWKgJz8hrGtiVpKho3G4J2qBQgacF1X1lvC
s8HDDyvvaP0mhMvUou8I=
file:
- pega-kubernetes-example.tar.gz
- pega-openshift-example.tar.gz
Expand All @@ -69,28 +70,33 @@ deploy:
- pega-pivotal-pks-example.tar.gz
skip_cleanup: true
on:
repo: pegasystems/pega-helm-charts
repo: $TRAVIS_REPO_SLUG
tags: true
- provider: bintray
file: descriptor.json
user: bintrayautomation
key:
- provider: pages
github-token: $GITHUB_TOKEN
api_key:
secure: >
M1CPmmjJ1OI2luWFRW9Aqregj3b4rQLSnP4ROurkHkewB+HwoZ+
QHAQ4JJD0B+br2AddaGKgN1rdzYpyvg0Cl7ZhWnMb96bE+lVbmD
zYnUc+Iwd8/PWXNoaFuB5sn5LPVESe8H/ZLdP0IyMbBknBDgdNg
KpD9XqH7/UrrNT9jvZSpGFAcMCwLVFiQ1auusnSLOYVr611Jadp
NZarx7QgPLBtlit+cfi/vEGy7GyYTtFzSbM86gBnm1kViSVM4w1
bE4cFs+14KVNiNiwpSzFzK/gBncqQVTz6yaD3bV48Cla5sz3/sD
kh3If7pUhcmMYyy9BPk35176TWTHKcqATv/5GxDvQpgaBMlyl0D
hwhb2d++ZZ6V+kYYj+Uf4m4NaxGV6WNrUnW+IPw9qlBWFHnw17u
80HU5GapXXNedUi2CjzrH25A0Y6DHqfZubDBXJh31RfWKz0r58b
LSGLYxdl96purfLUCeSrsKkZAWS59EmpXiR/f+zSbNmlpG+ryVB
sQIPG+cwdPSVUdGBGVp3QzEjVze6gABSQ/2GaMeRterjzBypi8a
b4vbIyxY905deoMAwcQHUcvybpNJfRcaowToK0BnMNhy8pn26KY
ct3oGLVxQe6rlGbQNZrFePSCyNd/ZfYlkWDcLh/j0OH0gdspHTd
Dfsy8dgS8QzvgNsNKRHk=
B5F4dCPvLmAP2pSCNLptl4vR9hk8AW+vrwsO6wlHsjGwmlKTs2w
YTWjPWA9SEFHO4OouxxsJv96ndPQ+i7TtKNjAJ65Ll1saztsIcn
G+Si567swtSPU4dEq4VhvabXmfZ1+1b/7zjP+fSAnmj41QZzLjI
3V5bQSTgyvVM7Xrol4OYJKX6iiX6p5noo7ysXGXL3iXn3vR+mya
qGIldsM9Bw2NyKeueu070dWq7hPJ4jEl8ObAzKVCjm5C7xqhN47
tl9yPBnicGbsD6qKzMtI97oCTCRz4sxLcbwhPsGg/1T+EpJDvBq
BSkA7OVdJ9Oi7hY+V47aBw9B4s9ABiIDQTTwz38Yu77FcJIMW8K
XH4Pez0xlDg7JD4wmrC07dHNtsz+d9wm4OKvdZnce7bUZ+LYCiL
eX1RPrfcVzTRsmiPyzAHNC6KOUtCrcIS6Jl8Eoq0aZfUjhE/cqy
+q6m6eVEGbt/rz/WVnxeQRjauoPnyCnueREuxndJ+zLMJc21a6Y
6tEZ9Y8DkOVxIL3v8SsCrf2/j0E5zctPpkODzuCY/jtaDjX92i/
xvWna69SRrwUu+66INfT1joG4NgPXCTqpovKcVPSM8YjGGiRbjp
Q2mfeqFIphhDH5ZWEWKgJz8hrGtiVpKho3G4J2qBQgacF1X1lvC
s8HDDyvvaP0mhMvUou8I=
file:
- index.yaml
skip_cleanup: true
target_branch: gh-pages
keep_history: true
verbose: true
on:
all_branches: true
tags: true
repo: $TRAVIS_REPO_SLUG
draft: true
99 changes: 50 additions & 49 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/usr/bin/env groovy
def bintrayautomation = "bintrayautomation"
def labels = ""
def bintrayPackageVersion = "1.0.0"
def curlSuccessStatus = '{"message":"success"}'

node {
stage("Init"){
if (env.CHANGE_ID) {
pullRequest.labels.each{
echo "label: $it"
validateProviderLabel(it)
validateLabels(it)
labels += "$it,"
}
labels = labels.substring(0,labels.length()-1)
Expand All @@ -24,69 +21,73 @@ node {
throw new Exception("Aborting as this is not a PR job")
}
}
stage ("Checkout and Package Charts") {
stage ("Checkout and Package Charts and ConfigFiles") {

// Checkout PR Code
def scmVars = checkout scm
branchName = "${scmVars.GIT_BRANCH}"
packageName = currentBuild.displayName
prNumber = "${env.BRANCH_NAME}".split("-")[1]

chartVersion = "${prNumber}.${env.BUILD_NUMBER}"
deployConfigsFileName = "deploy-config-${chartVersion}.tgz"
installerConfigsFileName = "installer-config-${chartVersion}.tgz"
// Perform Chart packaging
sh "helm dependency update ./charts/pega/"
sh "helm dependency update ./charts/addons/"
sh "curl -o index.yaml https://dl.bintray.com/pegasystems/helm-test-automation/index.yaml"
sh "helm package --version ${prNumber}.${env.BUILD_NUMBER} ./charts/pega/"
sh "helm package --version ${prNumber}.${env.BUILD_NUMBER} ./charts/addons/"
sh "helm repo index --merge index.yaml --url https://dl.bintray.com/pegasystems/helm-test-automation/ ."
sh "cat index.yaml"

// Publish helm charts to test-automation repository
withCredentials([usernamePassword(credentialsId: "bintrayautomation",
passwordVariable: 'BINTRAY_APIKEY', usernameVariable: 'BINTRAY_USERNAME')]) {
chartVersion = "${prNumber}.${env.BUILD_NUMBER}"
pega_chartName = "pega-${chartVersion}.tgz"
addons_chartName = "addons-${chartVersion}.tgz"
DELETE_STATUS_CODE = sh(script: "curl -X DELETE -u${BINTRAY_USERNAME}:${BINTRAY_APIKEY} https://api.bintray.com/content/pegasystems/helm-test-automation/index.yaml --write-out '%{http_code}'", returnStdout: true).trim()
PEGA_STATUS_CODE = sh(script: "curl -T ${pega_chartName} -u${BINTRAY_USERNAME}:${BINTRAY_APIKEY} https://api.bintray.com/content/pegasystems/helm-test-automation/helm-test-automation/${bintrayPackageVersion}/ --write-out '%{http_code}'", returnStdout: true).trim()
ADDONS_STATUS_CODE = sh(script: "curl -T ${addons_chartName} -u${BINTRAY_USERNAME}:${BINTRAY_APIKEY} https://api.bintray.com/content/pegasystems/helm-test-automation/helm-test-automation/${bintrayPackageVersion}/ --write-out '%{http_code}' ", returnStdout: true).trim()
UPDATE_STATUS_CODE = sh(script: "curl -T index.yaml -u${BINTRAY_USERNAME}:${BINTRAY_APIKEY} https://api.bintray.com/content/pegasystems/helm-test-automation/helm-test-automation/${bintrayPackageVersion}/ --write-out '%{http_code}'", returnStdout: true).trim()
PUBLISH_STATUS_CODE = sh(script: "curl -X POST -u${BINTRAY_USERNAME}:${BINTRAY_APIKEY} https://api.bintray.com/content/pegasystems/helm-test-automation/helm-test-automation/${bintrayPackageVersion}/publish --write-out '%{http_code}'", returnStdout: true).trim()
echo "DELETE_STATUS_CODE-- ${DELETE_STATUS_CODE}"
echo "PEGA_STATUS_CODE-- ${PEGA_STATUS_CODE}"
echo "ADDONS_STATUS_CODE-- ${ADDONS_STATUS_CODE}"
echo "UPDATE_STATUS_CODE-- ${UPDATE_STATUS_CODE}"
echo "PUBLISH_STATUS_CODE-- ${PUBLISH_STATUS_CODE}"
sh "helm dependency update ./charts/backingservices/"
sh "helm package --version ${chartVersion} ./charts/pega/"
sh "helm package --version ${chartVersion} ./charts/addons/"
sh "helm package --version ${chartVersion} ./charts/backingservices/"
sh "tar -czvf ${deployConfigsFileName} --directory=./charts/pega/config deploy/context.xml.tmpl deploy/server.xml deploy/prconfig.xml deploy/prlog4j2.xml"
sh "mkdir -p ./charts/pega/charts/installer/config/installer && cp ./charts/pega/charts/installer/config/migrateSystem.properties.tmpl ./charts/pega/charts/installer/config/installer && cp ./charts/pega/charts/installer/config/prbootstrap.properties.tmpl ./charts/pega/charts/installer/config/installer && cp ./charts/pega/charts/installer/config/prconfig.xml.tmpl ./charts/pega/charts/installer/config/installer && cp ./charts/pega/charts/installer/config/prlog4j2.xml ./charts/pega/charts/installer/config/installer && cp ./charts/pega/charts/installer/config/prpcUtils.properties.tmpl ./charts/pega/charts/installer/config/installer && cp ./charts/pega/charts/installer/config/setupDatabase.properties.tmpl ./charts/pega/charts/installer/config/installer && tar -czvf ${installerConfigsFileName} --directory=./charts/pega/charts/installer/config installer/migrateSystem.properties.tmpl installer/prbootstrap.properties.tmpl installer/prconfig.xml.tmpl installer/prlog4j2.xml installer/prpcUtils.properties.tmpl installer/setupDatabase.properties.tmpl"

if ( "${DELETE_STATUS_CODE}" != "${curlSuccessStatus}"+"200" || "${PEGA_STATUS_CODE}" != "${curlSuccessStatus}"+"201" || "${ADDONS_STATUS_CODE}" != "${curlSuccessStatus}"+"201"
|| "${UPDATE_STATUS_CODE}" != "${curlSuccessStatus}"+"201" || "${PUBLISH_STATUS_CODE}" != '{"files":3}'+"200" ) {
currentBuild.result = 'FAILURE'
pullRequest.comment("Unable to publish helm charts to bintray repository. Please retry")
error "This pipeline stops here! Unable to perform helm charts publish to bintray repository."
// Publish helm charts to test-automation GitHub Pages
withCredentials([usernamePassword(credentialsId: "helmautomation",
passwordVariable: 'AUTOMATION_APIKEY', usernameVariable: 'AUTOMATION_USERNAME')]) {

sh "git clone https://${AUTOMATION_USERNAME}:${AUTOMATION_APIKEY}@github.com/pegaautomationuser/helmcharts.git --branch=gh-pages gh-pages"
sh "mv pega-${chartVersion}.tgz gh-pages/"
sh "mv addons-${chartVersion}.tgz gh-pages/"
sh "mv backingservices-${chartVersion}.tgz gh-pages/"
sh "mv ${deployConfigsFileName} gh-pages/"
sh "mv ${installerConfigsFileName} gh-pages/"
dir("gh-pages") {
sh "helm repo index --merge index.yaml --url https://pegaautomationuser.github.io/helmcharts/ ."
sh "git config user.email pegaautomationuser@gmail.com"
sh "git config user.name ${AUTOMATION_USERNAME}"
sh "git add ."
sh "git commit -m \"Jenkins build to publish test artefacts of version ${chartVersion}\""
sh "git push -u origin gh-pages --force"
}

}
}

stage("Setup Cluster and Execute Tests") {

jobMap = [:]
jobMap["job"] = "../kubernetes-test-orchestrator/master"
jobMap["parameters"] = [
string(name: 'PROVIDERS', value: labels),
string(name: 'WEB_READY_IMAGE_NAME', value: ""),
string(name: 'HELM_CHART_VERSION', value: chartVersion),
]
jobMap["propagate"] = true
jobMap["quietPeriod"] = 0
resultWrapper = build jobMap
currentBuild.result = resultWrapper.result
prLabels = labels.toString().split(",")

if(prLabels.contains("integ-all") || prLabels.contains("integ-eks") || prLabels.contains("integ-gke") || prLabels.contains("integ-aks")) {
jobMap = [:]
jobMap["job"] = "../kubernetes-test-orchestrator/master"
jobMap["parameters"] = [
string(name: 'PROVIDERS', value: labels),
string(name: 'WEB_READY_IMAGE_NAME', value: ""),
string(name: 'HELM_CHART_VERSION', value: chartVersion),
]
jobMap["propagate"] = true
jobMap["quietPeriod"] = 0
resultWrapper = build jobMap
currentBuild.result = resultWrapper.result
} else {
echo "Skipping 'Setup Cluster and Execute Tests' stage based on PR labels: $prLabels"
}
}
}

def validateProviderLabel(String provider){
def validProviders = ["integ-all","integ-eks","integ-gke","integ-aks"]
def failureMessage = "Invalid provider label - ${provider}. valid labels are ${validProviders}"
if(!validProviders.contains(provider)){
def validateLabels(String label){
def validLabels = ["integ-all","integ-eks","integ-gke","integ-aks","configs"]
def failureMessage = "Invalid label - ${label}. valid labels are ${validLabels}"
if(!validLabels.contains(label)){
currentBuild.result = 'FAILURE'
pullRequest.comment("${failureMessage}")
throw new Exception("${failureMessage}")
Expand Down
Loading

0 comments on commit 7a71b9e

Please sign in to comment.