Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
ad210ff
Update build.gradle
sdgcpsb Jan 18, 2021
13f3ae9
Update build.gradle
sdgcpsb Jan 18, 2021
77b8748
Update build.gradle
sdgcpsb Jan 18, 2021
71de485
Update build.gradle
sdgcpsb Jan 18, 2021
ee3b909
Update build.gradle
sdgcpsb Jan 18, 2021
0989556
Update build.gradle
sdgcpsb Jan 18, 2021
ac621bd
Create gradle.yml
sdgcpsb Jan 18, 2021
29ee204
Create gradle.yaml
sdgcpsb Jan 18, 2021
accabca
Rename gradle.yaml to gradle.yml
sdgcpsb Jan 18, 2021
7c8f279
Update build.gradle
sdgcpsb Jan 18, 2021
7c9803f
Update build.gradle
sdgcpsb Jan 18, 2021
b4e0eed
Update build.gradle
sdgcpsb Jan 18, 2021
fbe2ea8
Update build.gradle
sdgcpsb Jan 18, 2021
373bc11
Update build.gradle
sdgcpsb Jan 18, 2021
23f028b
Update build.gradle
sdgcpsb Jan 18, 2021
8c1cb4c
Update build.gradle
sdgcpsb Jan 18, 2021
e667263
Update build.gradle
sdgcpsb Jan 18, 2021
828f2fc
Create Jenkinsfile
sdgcpsb Jan 18, 2021
1075e0e
Update Jenkinsfile
sdgcpsb Jan 18, 2021
1810385
Update Jenkinsfile
sdgcpsb Jan 18, 2021
8f6396c
Update Jenkinsfile
sdgcpsb Jan 18, 2021
e3df617
Update Jenkinsfile
sdgcpsb Jan 18, 2021
cfc5a33
Update Jenkinsfile
sdgcpsb Jan 18, 2021
e9e7df0
Update Jenkinsfile
sdgcpsb Jan 18, 2021
3031986
Update build.gradle
sdgcpsb Jan 18, 2021
c814b5b
Update Jenkinsfile
sdgcpsb Jan 18, 2021
72961ad
Update build.gradle
sdgcpsb Jan 18, 2021
a0282d8
Update build.gradle
sdgcpsb Jan 18, 2021
197622c
Update Jenkinsfile
sdgcpsb Jan 18, 2021
10972c0
Update Jenkinsfile
sdgcpsb Jan 18, 2021
c16167f
Update build.gradle
sdgcpsb Jan 18, 2021
1dd4b15
Update Jenkinsfile
sdgcpsb Jan 18, 2021
bd5d551
Update Jenkinsfile
sdgcpsb Jan 18, 2021
b616e67
Update Jenkinsfile
sdgcpsb Jan 18, 2021
e8e8256
Update build.gradle
sdgcpsb Jan 18, 2021
f1fa023
Update Jenkinsfile
sdgcpsb Jan 18, 2021
eee16a0
Update build.gradle
sdgcpsb Jan 18, 2021
10e3cf9
Update Jenkinsfile
sdgcpsb Jan 18, 2021
536e119
Update Jenkinsfile
sdgcpsb Jan 18, 2021
483ab09
Update Jenkinsfile
sdgcpsb Jan 18, 2021
73e726a
Update Jenkinsfile
sdgcpsb Jan 18, 2021
a334a6b
Update Jenkinsfile
sdgcpsb Jan 18, 2021
c4eaae9
Update Jenkinsfile
sdgcpsb Jan 18, 2021
4e160e2
Update Jenkinsfile
sdgcpsb Jan 18, 2021
0847c2c
Create pom.xml
sdgcpsb Jan 18, 2021
d16c0f6
Update Jenkinsfile
sdgcpsb Jan 18, 2021
3ae8822
Update Jenkinsfile
sdgcpsb Jan 18, 2021
da78127
Update Jenkinsfile
sdgcpsb Jan 18, 2021
024d357
Update pom.xml
sdgcpsb Jan 18, 2021
76bba57
Update Jenkinsfile
sdgcpsb Jan 18, 2021
a5de934
Create sample-java-app
sdgcpsb Jan 18, 2021
0d53798
Add files via upload
sdgcpsb Jan 18, 2021
0c4018a
Update Jenkinsfile
sdgcpsb Jan 18, 2021
63611a9
Update Jenkinsfile
sdgcpsb Jan 18, 2021
113a87f
Update Jenkinsfile
sdgcpsb Jan 18, 2021
d9c38bc
Update Jenkinsfile
sdgcpsb Jan 18, 2021
f347527
Update Jenkinsfile
sdgcpsb Jan 18, 2021
9d48bb9
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
d22ac6d
Update Jenkinsfile
sdgcpsb Jan 18, 2021
9c3b15e
Update Jenkinsfile
sdgcpsb Jan 18, 2021
813e2af
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
2702490
Update build.gradle
sdgcpsb Jan 18, 2021
019faca
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
450c286
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
9dd8713
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
9e2c3c8
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
9e01c26
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
7d38084
hi
rakshita-singh Jan 18, 2021
4060131
Update Jenkinsfile
sdgcpsb Jan 18, 2021
1b89cba
Update Jenkinsfile
sdgcpsb Jan 18, 2021
6290323
Update Jenkinsfile
sdgcpsb Jan 18, 2021
0e72e3e
Update build.gradle
sdgcpsb Jan 18, 2021
d3254db
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
9eacd55
Update Jenkinsfile
sdgcpsb Jan 18, 2021
1bcc668
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
bc6e706
Update pom.xml
sdgcpsb Jan 18, 2021
cf0182a
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
dd554ee
Update pom.xml
sdgcpsb Jan 18, 2021
cb63d62
Update Jenkinsfile
sdgcpsb Jan 18, 2021
89e5491
Update SpringBootRestAppApplicationTests.java
sdgcpsb Jan 18, 2021
fcde3aa
Update Jenkinsfile
sdgcpsb Jan 18, 2021
12bbc57
Update Jenkinsfile
sdgcpsb Jan 18, 2021
a668ef8
Update Jenkinsfile
sdgcpsb Jan 18, 2021
b1280cc
Update Jenkinsfile
sdgcpsb Jan 18, 2021
f303ccf
Update Jenkinsfile
sdgcpsb Jan 18, 2021
7074735
Update Jenkinsfile
sdgcpsb Jan 18, 2021
0d8a9c2
Update Jenkinsfile
sdgcpsb Jan 18, 2021
d6e1e90
Create Jenkinsfile_AIP
sdgcpsb Jan 19, 2021
652aa5d
Update Jenkinsfile
sdgcpsb Jan 20, 2021
cbbafee
Update Jenkinsfile
sdgcpsb Jan 20, 2021
bc158b3
Update Jenkinsfile
sdgcpsb Jan 20, 2021
bbfc9ad
Update Jenkinsfile
sdgcpsb Jan 20, 2021
79d772f
Update Jenkinsfile
sdgcpsb Jan 20, 2021
cc3e52b
Update Jenkinsfile
sdgcpsb Jan 20, 2021
084528d
Update Jenkinsfile
sdgcpsb Jan 21, 2021
d736ae9
Update Jenkinsfile
sdgcpsb Jan 21, 2021
5f58600
Update Jenkinsfile_AIP
sdgcpsb Jan 21, 2021
937fc35
Update Jenkinsfile_AIP
sdgcpsb Jan 28, 2021
9f44db8
Create project.properties
sdgcpsb Jan 28, 2021
b635f0f
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
856fe2a
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
4835edc
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
04a0350
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
74b8c81
Update pom.xml
sdgcpsb Feb 2, 2021
1632f91
Update pom.xml
sdgcpsb Feb 2, 2021
f34f52a
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
a6d5669
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
9cebfcf
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
a6ef5de
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
2470a39
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
87e8e01
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
4100660
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
b5c6c82
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
2e17be0
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
9f78593
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
3167c0f
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
5f137c9
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
e2c8cca
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
498b5f0
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
1865ae6
Create Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
ad96675
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
a057727
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
6c76bdb
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
7c51c13
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
92bce3b
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
ac6e4cb
Update pom.xml
sdgcpsb Feb 2, 2021
e76a5d4
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
c43522e
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
fef6af5
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
d29df91
Update pom.xml
sdgcpsb Feb 2, 2021
978715e
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
0fbf4dd
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
07263a5
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
a2639c3
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
8e49be5
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
ef94138
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
a42b3ab
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
a5bee13
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
5934544
Update pom.xml
sdgcpsb Feb 2, 2021
145c61c
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
5eddf3a
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
fcb0604
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
52cdcc9
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
3c5830d
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
7d329c0
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
f585501
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
26c82a6
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
b818566
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
ec951ae
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
7bd5cf4
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
b4943f7
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
2f633e5
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
b428156
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
0e5f2eb
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
7ae20bb
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
017fd10
Update Jenkinsfile_AIP
sdgcpae Feb 2, 2021
32b27b2
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
c1f89fb
Update Jenkinsfile_AIP
sdgcpsb Feb 2, 2021
74ad8d7
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
f704338
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
d3695f3
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
f0471ed
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
24b2274
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
fb51d95
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
1ea78ce
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
ef29900
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
0da6589
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
6071006
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
07ef98f
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
0b5e68a
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
f63472a
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
0c30e6e
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
fcb91b8
Update Jenkinsfile_AIP
sdgcpsb Feb 3, 2021
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
26 changes: 26 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
104 changes: 104 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
pipeline {
environment {
PROJECT_ID = "sd-devops"
APP_NAME = "sample-java-app"
CLUSTER_NAME = "cluster-1"
CLUSTER_ZONE = "us-central1-a"
CREDENTIALS_ID = "sd-devops"
}
//agent any 2
agent {
kubernetes {
label 'SpringBootRestApp'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
component: ci
spec:
containers:
-name: gradle
image: gradle: 3.5 - jdk8 - alpine
command:
-cat
tty: true
"""
}
}
stages {
stage('test') {
parallel {
stage('check_gradle_version') {
steps {
container('gradle') {
sh 'gradle -v'
sh 'echo workspace is $WORKSPACE'
sh "ls -la ${pwd()}"
sh 'chmod 777 * '
sh './gradlew compileJava'
}
}
}
stage('Unit Test') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName: 'Sonarqube') {
echo 'I am executing unit test'
sh "ls -la ${pwd()}"
sh 'mvn -f sample-java-app/pom.xml clean package'
}
}
}
}
}
}
stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName: 'Sonarqube') {
echo 'I am executing code quality using sonarqube'
sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
sleep(60)
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
}
}
}
stage('Publish Package') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am executing build and push the artifact with unique name showing the branch from which it is generated, to Archiva'
sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-0.0.1-SNAPSHOT.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=http://35.188.92.10/repository/snapshots/'
}
}
}
}
stage('Deploy Dev') {
when {
branch 'dev'
}
steps {
echo "I am executing Deploy the artifact from Archiva to target dev environment. My artifact has a unique name which is automatically generated and deployed to target dev environment"
echo "Work in progress"
}
}
stage('Smoke Test') {
when {
branch 'dev'
}
steps {
echo "I am executing Smoke Test on target dev environment post deployment"
echo 'Work in progress'
}
}
}
}
}
182 changes: 182 additions & 0 deletions Jenkinsfile_AIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
pipeline {

agent {
kubernetes {
label 'SpringBootRestApp'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
component: ci
spec:
containers:
- name: gradle
image: gradle:3.5-jdk8-alpine
command:
- cat
tty: true
"""
}
}

stages {
stage('Build & Unit Test') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName: 'Sonarqube') {
echo 'I am executing unit test'
// sh 'for i in ESBAuditClient ESBAuditLog ESBErrorTranslator TaxESB FraudESB FulfillmentESB PaymentESB ESBRadial ESBAutomatedQueueRetry AlertESB OrderReconESB;do gradle --no-daemon -p ${i} clean build;done'
sh 'mvn -f sample-java-app/pom.xml clean package'
}
}
}
}
}
stage('Code Quality') {
steps {
container('gradle') {
withMaven(maven: 'MAVEN-3.6.3') {
withSonarQubeEnv(installationName: 'Sonarqube') {
echo 'I am executing code quality using sonarqube'
sh 'mvn -f sample-java-app/pom.xml sonar:sonar'
}
sleep(60)
timeout(time: 1, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}



}
}
}
}
stage("Publish Package") {
steps {
container('gradle') {
script {
propfile = readProperties(file: './project.properties')
println("deploy:" + propfile['feature_deploy'])
println("reading properties ...")
if (propfile['feature_deploy'] == "true" || env.BRANCH_NAME == 'dev' || env.BRANCH_NAME == 'release') {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am pushing the artifact with unique name showing the branch from which it is generated, to Archiva'
/* echo 'copying the jar and war files from the individual target directorrys and copying it to artifacts directory '
sh "mkdir -p $WORKSPACE/artifacts"
sh 'for i in ESBAuditClient ESBAuditLog ESBErrorTranslator TaxESB FraudESB FulfillmentESB PaymentESB ESBRadial ESBAutomatedQueueRetry AlertESB OrderReconESB;do cp -rp ${i}/dist/libs/* $WORKSPACE/artifacts/ ;done' */
/* echo 'create a tar file on the Jenkins server'
sh "cd $WORKSPACE/artifacts/ && tar -cvzf artifact.tar * && md5sum artifact.tar archiveArtifacts artifacts: 'artifacts/*.tar', fingerprint: true */
sh 'mv sample-java-app/target/sample-0.0.1-SNAPSHOT.jar sample-java-app/target/sample-build_${BUILD_NUMBER}-branch_${BRANCH_NAME}.jar'
sh 'ls -lrt sample-java-app/target/'
sh 'mvn -X deploy:deploy-file -Dfile=sample-java-app/target/sample-build_${BUILD_NUMBER}-branch_${BRANCH_NAME}.jar -DpomFile=sample-java-app/pom.xml -DrepositoryId=snapshots -Durl=https://archiva.sgn.devops.accentureanalytics.com/repository/snapshots/'
echo "noooooooooooooooooo"
}
}
}
}
}
}
stage("Deploy") {
steps {
container('gradle') {
script {
propfile = readProperties(file: './project.properties')
println("deploy:" + propfile['feature_deploy'])
println("reading properties ...")
if (propfile['feature_deploy'] == "true" || env.BRANCH_NAME == 'dev' || env.BRANCH_NAME == 'release') {
withMaven(maven: 'MAVEN-3.6.3') {
echo 'I am deploying the artifact into the target environment'
echo 'shutting down the tomcat ESB server'
/* sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "$ESB_BIN_PATH stop || sleep 20"'
echo 'force stop any remaining mule process'
sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "if [[ $(ps aux | grep /opt/mule/latest/ | grep -vc grep) > 0 ]]; then "kill -9 $(ps -ef|pgrep -f "/opt/mule/latest/bin")"; else echo "do nothing"; fi"' */
echo 'tomcat server stopped'
echo 'copying the tar file from jenkins to deployment directory on app and remove the old folders and untarring the new jar and war files'
/* sh 'scp -rp $WORKSPACE/artifacts/artifact.tar $DEPLOYMENT_USER@$DEPOYMENT_SERVER:$DEPLOYMENT_STAGE_DIR/'
sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "cd $DEPLOYMENT_STAGE_DIR && rm -rf *.war *.jar"'
sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "cd $DEPLOYMENT_STAGE_DIR && tar -xvzf artifact.tar && rm -rf *.jar"'
sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "cd $DEPLOYMENT_DIR && rm -rf $ESB_WAR_FOLDERS && cp -rp $DEPLOYMENT_STAGE_DIR/*.war $DEPLOYMENT_DIR"' */
echo 'Deployment has been completed'
echo 'starting the tomcat ESB server'
/* sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "$ESB_BIN_PATH start"'
sh 'ssh $DEPLOYMENT_USER@$DEPOYMENT_SERVER "sleep 20"' */
echo 'tomcat server started'
}
} else {
echo "no need"
}
}
}
}
}

stage('Post Deploy Tests') {
parallel {
stage('Smoke Test') {
steps {
echo "I am executing Smoke Test on target dev environment post deployment"
}
/*RESP=`curl -X GET "${bamboo.uri}/RequestsRunning" -H "accept: application/xml" -H "authorization: bearer lR0AA2qfq7v9Ry96vDAgqcer1GPVd5yStmv1_aJVFS43rk06EytB7WsS0_owoiXIgpOXmZVEfkY4ST0JwHtRBk7RH0QRaldWtQT8udC0VdimdGx38RddY2sGaeeF0t9Aflr5rh1Jc_EUfkNK8YrKVxQ6kxB05aCe46CD2fkognv7TiJATmht-ycUjEsd_oy8jH5EK9fmn9eL-wXavNTQcEdsUmFm3-2r3IJDzMK7XCa74qu353yOKLvVyZ1yYQBnc1_fY5GS1BDrFLUZprxpAS30lGEu-d_JTTOQ989UJtIEB3cZzDkIQzeqdYBGCsiDdjdHo2DC1FK2kVPyBITTbQ"`
echo "The response for current execution status is: $RESP"
if [ "$RESP" != "[]" ];
then
echo "There is a test executing currently in Worksoft. Hence, not proceeding with the execution of Worksoft test cases."
exit 1
else
echo "There are no tests executing right now. Hence, proceeding with Worksoft test execution"
fi
# To abort the request before attempting to re-run, uncomment and run below line.
# abort=$(curl -X PUT -H "Authorization: Bearer $token" -d "" -H "id: ${bamboo.RequestID}" ${bamboo.uri}/Request/${bamboo.RequestID}/abort/)
guid=$(curl -X PUT -H "Authorization: Bearer $token" -d "" -H "parameters: {TestEnv}{${bamboo.stage_name}}" -H "id: ${bamboo.RequestID}" ${bamboo.uri}/ExecuteRequest/ | tr -d \")
echo "The GUID is: $guid"
status=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/ | awk -F':' '{print $2}' | tr -d \" | tr -d \})
echo "The status is: $status"
while [[ $status != *"Completed"* ]]
do
status=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/ | awk -F':' '{print $2}' | tr -d \" | tr -d \})
echo "The status is: $status"
sleep 15
done
status=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/)
echo "The status is: $status"
execstatus=$(curl -X GET -H "Authorization: Bearer $token" -d "" -H "APIRequestID: $guid" ${bamboo.uri}/ExecutionStatus/ | awk -F':' '{print $3}' | tr -d \" | tr -d \})
echo "The exec status is: $execstatus"
if [[ $execstatus != *Passed* ]];
then
echo "Failed"
exit 1
else
echo "Passed"
exit
fi
exit */
}
stage('Security Test') {
steps {
echo 'I am running Security Test here'
}
}
}
}
}
post {
failure {
/*mail bcc: '',
body: "<b>Example</b><br>\n<br>Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}",
cc: '',
charset: 'UTF-8',
from: '',
mimeType: 'text/html',
replyTo: '',
subject: "ERROR CI: Project name -> ${env.JOB_NAME}",
to: "[email protected]";*/
echo 'I am sending a notification with failure'
}
success {
echo 'I am sending a notification with success'
}
}
}
25 changes: 19 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'

}

group = 'com.kkjavatutorials'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '8'


repositories {
mavenCentral()
}

configurations {
// configuration that holds jars to include in the jar
extraLibs
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation('org.springframework.boot:spring-boot-starter-test') {

configurations.compile.extendsFrom(configurations.extraLibs)
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
}

test {
test {
useJUnitPlatform()
}
}




26 changes: 26 additions & 0 deletions gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
Loading