Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
b97599a
Initial commit to create jenkinsfile in the repo
devopsbcsquad5 Feb 26, 2021
cabe2d4
adding build info
devopsbcsquad5 Mar 1, 2021
7ca2696
commit for Jira Integration
devopsbcsquad5 Mar 1, 2021
18ba82b
Update Jenkinsfile
devopsbcsquad5 Mar 1, 2021
e8bb072
Update Jenkinsfile
devopsbcsquad5 Mar 1, 2021
987f92c
SQUAD5-1
devopsbcsquad5 Mar 2, 2021
08a4c0b
Added the sonar qube analysis stage
smanoj85 Mar 2, 2021
8aa7bf0
Added the sonarqube analysis
smanoj85 Mar 2, 2021
a9bcc45
Added the sonarqube analysis
smanoj85 Mar 2, 2021
bf32921
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
a3a21be
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
591973a
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
612e343
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
e77e476
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
b217f93
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
567444d
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
d32c254
Updated the installationName of sonarqube
smanoj85 Mar 2, 2021
2d4f086
Print Message revert
smanoj85 Mar 2, 2021
a33e65f
Print Message revert
smanoj85 Mar 2, 2021
f5fd987
Added the sonarqube stage in the dev-master branch
smanoj85 Mar 2, 2021
bb8bf46
Added the mvn compile step
smanoj85 Mar 2, 2021
67a5a6b
Added the mvn compile step
smanoj85 Mar 2, 2021
90bb84c
Added the mvn compile step
smanoj85 Mar 2, 2021
2257706
SQUAD5-3
devopsbcsquad5 Mar 2, 2021
27ab5c9
LOGIN-5 SQUAD5-3
devopsbcsquad5 Mar 2, 2021
e69a968
LOGIN-5
devopsbcsquad5 Mar 2, 2021
6e85f76
Docker file added
devopsbcsquad5 Mar 2, 2021
f7cbf5d
Added Jenkinsfile
devopsbcsquad5 Mar 2, 2021
cc78aeb
test server ip changes
devopsbcsquad5 Mar 2, 2021
fefc66d
update test server ip
devopsbcsquad5 Mar 3, 2021
c800f7c
Updated the gcloud auth file path
devopsbcsquad5 Mar 3, 2021
b9947e7
Updated the dockerfile
smanoj85 Mar 3, 2021
9cbe211
Updated the dockerfile
smanoj85 Mar 3, 2021
c087015
DP-2 #comment This is first commit
devopsbcsquad5 Mar 3, 2021
800912e
#comment DP-2 test
devopsbcsquad5 Mar 3, 2021
a8ddf1a
DP-2 trigger JIRA
devopsbcsquad5 Mar 4, 2021
1d08fed
DP-2 testing JIRA
devopsbcsquad5 Mar 4, 2021
0ab6e66
Add files via upload
devopsbcsquad5 Mar 4, 2021
b514cfe
Updated for the dockerfile
smanoj85 Mar 4, 2021
d39b091
Merge branch 'dev-master' of https://github.com/devopsbcsquad5/DevOps…
smanoj85 Mar 4, 2021
47fd064
Added the playbook for configuring testserver
smanoj85 Mar 4, 2021
791a910
sudo command inclusion
smanoj85 Mar 4, 2021
c3b0558
sudo command inclusion
smanoj85 Mar 4, 2021
f26fc99
sudo command inclusion
smanoj85 Mar 4, 2021
9052e52
sudo command inclusion
smanoj85 Mar 4, 2021
93f2fca
sudo command inclusion
smanoj85 Mar 4, 2021
ce763f4
Added the mvn package and pusing the war file to tomcat
smanoj85 Mar 4, 2021
4a74969
DP-2 jenkins commit
devopsbcsquad5 Mar 5, 2021
f153a1b
DP-2 test jenkins
devopsbcsquad5 Mar 5, 2021
9e0b7d0
DP-2 test comited
devopsbcsquad5 Mar 5, 2021
b30ee88
DP-2
devopsbcsquad5 Mar 5, 2021
3ed6af8
DP-2 test commit
devopsbcsquad5 Mar 5, 2021
c80e42b
DP-2
devopsbcsquad5 Mar 5, 2021
d069256
DP-2
devopsbcsquad5 Mar 5, 2021
552f1f2
DP-2
devopsbcsquad5 Mar 5, 2021
7f94b63
Added the mvn package and pusing the war file to tomcat
smanoj85 Mar 5, 2021
f84bc3c
Added the mvn package and pusing the war file to tomcat
smanoj85 Mar 5, 2021
5c50e78
Added the artifactory publish step
smanoj85 Mar 5, 2021
b606e97
Added the artifactory publish step
smanoj85 Mar 5, 2021
54b0c72
Added the artifactory publish step
smanoj85 Mar 5, 2021
6c584b0
Added the artifactory publish step
smanoj85 Mar 5, 2021
265967e
Added the artifactory publish step
smanoj85 Mar 5, 2021
60920f6
Added the artifactory publish step
smanoj85 Mar 5, 2021
2f32cf1
Added the artifactory publish step
smanoj85 Mar 5, 2021
6d40df3
Added the artifactory publish step
smanoj85 Mar 5, 2021
019ff48
Added the artifactory publish step
smanoj85 Mar 5, 2021
476f9b5
Added the artifactory path
smanoj85 Mar 5, 2021
d6c6e9c
Added the artifactory path
smanoj85 Mar 5, 2021
3b73468
Added the artifactory path
smanoj85 Mar 5, 2021
49e2cdd
Added the deploy from artifaction to test server
smanoj85 Mar 5, 2021
b8581db
Added the deploy from artifaction to test server
smanoj85 Mar 5, 2021
5c99f35
Added the deploy from artifaction to test server
smanoj85 Mar 5, 2021
793e850
DP-2
devopsbcsquad5 Mar 6, 2021
8f84993
DP-2
devopsbcsquad5 Mar 6, 2021
11fdf41
DP-2
devopsbcsquad5 Mar 6, 2021
283cb6c
DP-2
devopsbcsquad5 Mar 6, 2021
0f4555d
DP-2
devopsbcsquad5 Mar 6, 2021
fa36535
DP-2
devopsbcsquad5 Mar 6, 2021
7663289
h
devopsbcsquad5 Mar 6, 2021
3c55017
h
devopsbcsquad5 Mar 6, 2021
e528bc0
h
devopsbcsquad5 Mar 6, 2021
9012eb2
j
devopsbcsquad5 Mar 6, 2021
5f39a51
j
devopsbcsquad5 Mar 6, 2021
2fb2a59
k
devopsbcsquad5 Mar 6, 2021
b8e2a3d
h
devopsbcsquad5 Mar 6, 2021
e419c13
DP-2
devopsbcsquad5 Mar 6, 2021
3e1ce0d
added selenium and blazemeter test
devopsbcsquad5 Mar 6, 2021
ccffc5e
uncomment test server config
devopsbcsquad5 Mar 6, 2021
23ce608
transfer war file to test server
devopsbcsquad5 Mar 6, 2021
9ce7742
transfer war file to test server
devopsbcsquad5 Mar 6, 2021
ff41c40
transfer war file to test server
devopsbcsquad5 Mar 6, 2021
538292d
transfer war file to test server
devopsbcsquad5 Mar 6, 2021
1135247
Renamed the war file
smanoj85 Mar 6, 2021
30710d7
Renamed the war file
smanoj85 Mar 6, 2021
5d2c5ed
commited selenium tyest
devopsbcsquad5 Mar 6, 2021
9760e97
Updated the prod server
smanoj85 Mar 6, 2021
27efa49
Merge branch 'dev-master' of https://github.com/devopsbcsquad5/DevOps…
smanoj85 Mar 6, 2021
1f04240
Updated the prod server
smanoj85 Mar 6, 2021
8459df7
Update TestServerCreation.yml
devopsbcsquad5 Mar 7, 2021
12e6146
updated sonar server name
devopsbcsquad5 Mar 7, 2021
7b36079
Merge branch 'dev-master' of https://github.com/devopsbcsquad5/DevOps…
devopsbcsquad5 Mar 7, 2021
d65caef
updated sonar server name
devopsbcsquad5 Mar 7, 2021
3468ef3
updated sonar server name
devopsbcsquad5 Mar 7, 2021
bf63fc3
updated sonar server name
devopsbcsquad5 Mar 7, 2021
2dc8541
updated sonar server name
devopsbcsquad5 Mar 7, 2021
88d64fc
updated sonar server name
devopsbcsquad5 Mar 7, 2021
e7f8c16
updated sonar server name
devopsbcsquad5 Mar 7, 2021
0938744
updated sonar server name
devopsbcsquad5 Mar 7, 2021
7ed876a
updated sonar server name
devopsbcsquad5 Mar 7, 2021
63e90fc
updated sonar server name
devopsbcsquad5 Mar 7, 2021
e1bc286
updated sonar server name
devopsbcsquad5 Mar 7, 2021
2a0cbaa
updated sonar server name
devopsbcsquad5 Mar 7, 2021
42b21f6
updated sonar server name
devopsbcsquad5 Mar 7, 2021
76ab178
updated sonar server name
devopsbcsquad5 Mar 7, 2021
14091f8
updated sonar server name
devopsbcsquad5 Mar 7, 2021
febba34
updated sonar server name
devopsbcsquad5 Mar 7, 2021
0c1f1ca
updated sonar server name
devopsbcsquad5 Mar 7, 2021
3f4042b
updated sonar server name
devopsbcsquad5 Mar 7, 2021
4b74220
updated sonar server name
devopsbcsquad5 Mar 7, 2021
fdb160e
update the package code
smanoj85 Mar 7, 2021
b1631e9
updated sonar server name
devopsbcsquad5 Mar 7, 2021
90bc220
updated sonar server name
devopsbcsquad5 Mar 7, 2021
de3f36c
Update Jenkinsfile
devopsbcsquad5 Mar 7, 2021
0d0f2c6
Added deploywar stage
smanoj85 Mar 7, 2021
09e7b1c
Added deploywar stage
smanoj85 Mar 7, 2021
f975756
Added deploywar stage
smanoj85 Mar 7, 2021
e51d37c
Added deploywar stage
smanoj85 Mar 7, 2021
1aa421e
Added deploywar stage
smanoj85 Mar 7, 2021
a7409bb
Running e2E test
devopsbcsquad5 Mar 7, 2021
4d4ae3d
Running e2E test
devopsbcsquad5 Mar 7, 2021
b270e76
Running e2E test
devopsbcsquad5 Mar 7, 2021
27ba5fa
Running e2E test
devopsbcsquad5 Mar 7, 2021
d622608
Running e2E test
devopsbcsquad5 Mar 7, 2021
b557fe3
Running e2E test
devopsbcsquad5 Mar 7, 2021
b703e5b
Running e2E test
devopsbcsquad5 Mar 7, 2021
d10195b
Running e2E test
devopsbcsquad5 Mar 7, 2021
d2be77a
Running e2E test
devopsbcsquad5 Mar 7, 2021
68c1b8d
Added deploywar stage
smanoj85 Mar 7, 2021
2bdfa9d
Added deploywar stage
smanoj85 Mar 7, 2021
deeba26
Added deploywar stage
smanoj85 Mar 7, 2021
2c59148
Added deploywar stage
smanoj85 Mar 7, 2021
ca68aed
Merge branch 'master' into dev-master
devopsbcsquad5 Mar 7, 2021
81a90d1
Merge pull request #1 from devopsbcsquad5/dev-master
devopsbcsquad5 Mar 7, 2021
1dd7f8c
Testing jira
smanoj85 Mar 7, 2021
1698f5a
Merge branch 'dev-master' of https://github.com/devopsbcsquad5/DevOps…
smanoj85 Mar 7, 2021
1369012
Testing jira
smanoj85 Mar 7, 2021
ab74abb
Merge pull request #2 from devopsbcsquad5/dev-master
devopsbcsquad5 Mar 7, 2021
3cf8183
Testing jira for dp-4 second time
smanoj85 Mar 7, 2021
8db06f0
Merge pull request #3 from devopsbcsquad5/dev-master
devopsbcsquad5 Mar 7, 2021
929b128
Added the docker stage
smanoj85 Mar 8, 2021
1becc00
Added the docker stage
smanoj85 Mar 8, 2021
ef323c8
Added the docker stage
smanoj85 Mar 8, 2021
715f311
Added the docker restart policy
smanoj85 Mar 8, 2021
14be6b6
Added the docker restart policy
smanoj85 Mar 8, 2021
39266ce
Added the docker restart policy
smanoj85 Mar 8, 2021
e3746e1
Added the docker restart policy
smanoj85 Mar 8, 2021
173a2c9
Added the docker restart policy
smanoj85 Mar 8, 2021
fe38df2
Added the docker restart policy
smanoj85 Mar 8, 2021
ee5b25e
Added the docker image
smanoj85 Mar 8, 2021
5f133de
changed the for condition
smanoj85 Mar 8, 2021
e2c4b7d
changed the for condition
smanoj85 Mar 8, 2021
4be339a
changed the for condition
smanoj85 Mar 8, 2021
909802c
changed the for condition
smanoj85 Mar 8, 2021
2ff606b
changed the for condition
smanoj85 Mar 8, 2021
cad8ba3
changed the for condition
smanoj85 Mar 8, 2021
2341b8f
changed the for condition
smanoj85 Mar 8, 2021
3e6d4b4
changed the for condition
smanoj85 Mar 8, 2021
b822914
DP-2 commit of new code from dev-master
smanoj85 Mar 9, 2021
556bc98
Merge pull request #4 from devopsbcsquad5/dev-master
devopsbcsquad5 Mar 9, 2021
6fa5e89
Updated the docker restart steps
smanoj85 Mar 9, 2021
33027e5
Updated the docker restart steps
smanoj85 Mar 9, 2021
7391979
Updated the docker restart steps
smanoj85 Mar 9, 2021
f24fb78
Updated the docker restart steps
smanoj85 Mar 9, 2021
a6a01a3
Added the docker compose step
smanoj85 Mar 9, 2021
bbb3d96
Added the docker compose step
smanoj85 Mar 9, 2021
53ed5db
Added the docker compose step
smanoj85 Mar 9, 2021
ca89556
Added the docker compose step
smanoj85 Mar 9, 2021
d903101
Added the docker compose step
smanoj85 Mar 9, 2021
63b2d43
Merge pull request #5 from devopsbcsquad5/master
smanoj85 Mar 17, 2021
d3b4e8e
Updated the blazemeter step
Mar 17, 2021
d7b43e6
Merge pull request #6 from devopsbcsquad5/dev-master
devopsbcsquad5 Mar 17, 2021
5361693
Updated the taurus testid in blazemeter
smanoj85 Mar 18, 2021
fe0366d
Merge pull request #7 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 18, 2021
910c79e
Updated the slack success and failure step in all stages updated
smanoj85 Mar 18, 2021
945dc49
Merge pull request #8 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 18, 2021
0ff3a67
Updated the slack success and failure step in all stages updated
smanoj85 Mar 18, 2021
c688cb1
Merge pull request #9 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 18, 2021
6376eb1
Updated the blazemeter testID
smanoj85 Mar 19, 2021
9f9d3eb
Merge pull request #10 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
11922bc
Updated the blazemeter testID
smanoj85 Mar 19, 2021
c75e27e
Merge pull request #11 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
0d83976
Updated the blazemeter testID
smanoj85 Mar 19, 2021
63692eb
Merge pull request #12 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
2da06c3
Updated the blazemeter testID
smanoj85 Mar 19, 2021
07c8d2a
Merge pull request #13 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
f637ef8
Updated the blazemeter testID
smanoj85 Mar 19, 2021
bcea1e0
Merge pull request #14 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
ea5f029
Added Pivotal Tracker Update
smanoj85 Mar 19, 2021
6763868
Added Pivotal Tracker Update
smanoj85 Mar 19, 2021
055a214
Merge pull request #15 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
231a34c
Added Pivotal Tracker Update
smanoj85 Mar 19, 2021
a86c8a9
Merge pull request #16 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
c5392bd
Added Pivotal Tracker Update
smanoj85 Mar 19, 2021
7fe93f4
Merge pull request #17 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
bfd42ee
Added code to change the story status and add the comments in the piv…
smanoj85 Mar 19, 2021
dcf6eeb
Merge pull request #18 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
7f6951c
Added code to change the story status and add the comments in the piv…
smanoj85 Mar 19, 2021
56b6bfc
Merge pull request #19 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
37f7336
Added code to change the story status and add the comments in the piv…
smanoj85 Mar 19, 2021
a182bbc
Merge pull request #20 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
8a5cbb6
Added code to change the story status and add the comments in the piv…
smanoj85 Mar 19, 2021
d94f15d
Added code to change the story status and add the comments in the piv…
smanoj85 Mar 19, 2021
17f296a
Merge pull request #21 from devopsbcsquad5/177407436-CreationCICD
devopsbcsquad5 Mar 19, 2021
5f3e5c3
Added code to change the story status and add the comments in the piv…
smanoj85 Mar 19, 2021
99db183
Merge pull request #22 from devopsbcsquad5/177409853-CreationCICD2
devopsbcsquad5 Mar 19, 2021
ed06cc8
Update README.md
devopsbcsquad5 Mar 19, 2021
5b20a5e
Update Jenkinsfile
devopsbcsquad5 Mar 19, 2021
6fbc259
true commit
smanoj85 Mar 19, 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
4 changes: 2 additions & 2 deletions Acceptancetest/src/test/java/acceptancetest/acat.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class acat {
public HtmlUnitDriver driver;
//public WebDriver driver;
public WebDriverWait wait;
public String URL = "http://172.31.45.127:8080/ProdWebapp";
public String URL1 = "http://172.31.45.127:8080/ProdWebapp/avncreatepage.jsp";
public String URL = "http://squadprodserver:8080/ProdWebapp";
public String URL1 = "http://squadprodserver:8080/ProdWebapp/avncreatepage.jsp";
//public String URL = "http://localhost:8080/AVNCommunication-1.0/avnlogin.jsp";
//public String URL1 = "http://localhost:8080/AVNCommunication-1.0/avncreatepage.jsp";

Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# FROM openjdk:8-jre-alpine
# EXPOSE 8080
# ADD target/*.jar app.jar
# ENTRYPOINT [ "sh", "-c", "java -jar /app.jar" ]
FROM squad5
COPY target/AVNCommunication-1.0.war /usr/local/tomcat/webapps/AVNCommunication-1.0.war
RUN service tomcat8 start
336 changes: 336 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,336 @@
def server
def buildInfo
def rtMaven
pipeline {
agent any
stages {
stage('Initalize') {
parallel {
stage('Static Code Analysis') {
steps {
slackSend channel: 'notify', message: "Static Code Analysis started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"

withSonarQubeEnv('sonarqube-server') {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
mvn "-Dsonar.test.exclusions=**/test/java/servlet/createpage_junit.java " -Dsonar.login=sonar -Dsonar.password=${SONAR_AUTH} -Dsonar.tests=. -Dsonar.inclusions=**/test/java/servlet/createpage_junit.java -Dsonar.sources=. sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL}
'''
}
}
post {
success {
slackSend channel: 'notify', message: "Static Code Analysis succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Static Code Analysis failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

stage('Build the project') {
steps {
slackSend channel: 'notify', message: "Build the project started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
mvn -B -f pom.xml compile
'''
}
}
post {
success {
slackSend channel: 'notify', message: "Build the project succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Build the project failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}
stage('Initalize Docker Compose on Test & Prod Servers') {
steps {
slackSend channel: 'notify', message: "Initialize Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2`
prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2`
for server in $testserver $prodserver
do
sudo scp -o StrictHostKeyChecking=no docker-compose.yml root@${server}:/root/docker-compose.yml
sudo ssh -o StrictHostKeyChecking=no root@${server} '
if [[ `docker ps -q | wc -l` -gt 0 ]]
then
docker-compose down
fi
rm -fr /opt/tomcat/webapps/*
docker-compose up -d
'
done
'''
}
}
post {
success {
slackSend channel: 'notify', message: "Initialize Test & Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Initialize Test & Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}
}
post {
success {
script {
sh '''
### Code to update the Story state
story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1`
my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2`
curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"finished"}' "${MY_PIVOTAL_STORIES}/${story_nbr}"

### Code to add the comments to the pivotal story
curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline started due to new code merge to master from '${story_nbr}' in the github.\\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **FINISHED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments"
'''
}
}
}
}

stage('Configure Test & Prod Server') {
steps {
slackSend channel: 'notify', message: "Configure Test & Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
testserver=`grep test-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2`
prodserver=`grep prod-server /etc/ansible/hosts | awk '{print $2}' | cut -d '=' -f2`
echo "Testserver: $testserver and Prodcution: $prodserver"
sed -i "s/squadtestserver/$testserver/g" $(find . -type f)
sed -i "s/squadprodserver/$prodserver/g" $(find . -type f)
grep URL functionaltest/src/test/java/functionaltest/ftat.java
grep URL Acceptancetest/src/test/java/acceptancetest/acat.java
'''
}
}
post {
success {
slackSend channel: 'notify', message: "Configure Test & Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Configure Test & Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

stage('Package the project') {
steps {
slackSend channel: 'notify', message: "Package the project started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
mvn package -Dmaven.test.skip=true
'''
}
}
post {
success {
slackSend channel: 'notify', message: "Package the project succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Package the project failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

stage('Store Artifacts') {
steps {
slackSend channel: 'notify', message: "Upload artifacts started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
server = Artifactory.server 'artifactory'
sh """ mvn package -Dmaven.test.skip=true """
def uploadSpec = """{
"files": [
{
"pattern": "target/*.war",
"target": "squad5-libs-release-local"
},
{
"pattern": "target/*.war",
"target": "squad5-libs-snapshot-local"
}
]
}"""
server.upload spec: uploadSpec

}
}
post {
success {
slackSend channel: 'notify', message: "Upload artifacts succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Upload artifacts failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

stage('Deploy on Test Server') {
steps {
slackSend channel: 'notify', message: "Deployment of War on Test Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
sudo ansible-playbook -e 'deployservers="test-server" lcp="QA"' dwnldArtifact.yml
sleep 20s
'''
}
}
post {
success {
slackSend channel: 'notify', message: "Deployment of War on Test Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Deployment of War on Test Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}


stage('UI Testing on Test Server') {
steps {
slackSend channel: 'notify', message: "UI Testing started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
mvn -B -f functionaltest/pom.xml test
'''
}
// publish html
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\functionaltest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: ''])
}
post {
always {
jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'test-${env.BUILD_NUMBER}', environmentName: 'testserver', environmentType: 'testing', issueKeys: ['DP-2']
}
success {
slackSend channel: 'notify', message: "UI Testing succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "UI Testing failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

stage('Performance test'){
steps {
slackSend channel: 'notify', message: "Performance Testing started for build : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
// blazeMeterTest credentialsId: 'Blazemeter', testId: '9137429.taurus', workspaceId: '775624'
//blazeMeterTest credentialsId: 'bcb98eda-1130-4c9e-97e3-2262ffd3a6b7', testId: '9204220.taurus', workspaceId: '799387'
}
post {
success {
slackSend channel: 'notify', message: "Performance Testing succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
### Code to update the Story state
story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1`
my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2`
curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"delivered"}' "${MY_PIVOTAL_STORIES}/${story_nbr}"

### Code to add the comments to the pivotal story
curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipeline deployed the new code to AWS Test-Server from artifactory using docker compose and ran the UI and Performance testing. \\n **Story ID**: '${story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **DELIVERED** " }' "${MY_PIVOTAL_STORIES}/${story_nbr}/comments"
'''
}
}
failure {
slackSend channel: 'notify', message: "Performance Testing failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

stage('Deploy on Prod Server') {
steps {
slackSend channel: 'notify', message: "Deployment of War on Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
sudo ansible-playbook -e 'deployservers="prod-server" lcp="Prod"' dwnldArtifact.yml
sleep 20s
'''
}
}
post {
success {
slackSend channel: 'notify', message: "Deployment of War on Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Deployment of War on Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

stage('Sanity Tests') {
steps {
slackSend channel: 'notify', message: "Sanity Testing on Prod Server started for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
script {
sh '''
mvn -B -f Acceptancetest/pom.xml test
'''
}
// publish html
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: '\\Acceptancetest\\target\\surefire-reports', reportFiles: 'index.html', reportName: 'HTML Report', reportTitles: ''])
}
post {
always {
jiraSendDeploymentInfo site: 'devopsbctcs03.atlassian.net', environmentId: 'prod-${env.BUILD_NUMBER}', environmentName: 'prodserver', environmentType: 'production', issueKeys: ['DP-2']
}
success {
slackSend channel: 'notify', message: "Sanity Testing on Prod Server succesfully completed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
failure {
slackSend channel: 'notify', message: "Sanity Testing on Prod Server failed for : ${env.JOB_NAME} ${env.BUILD_NUMBER}"
}
}
}

}
post {
success {
script {
sh '''
### Code to update the Story CICD Pipeline status
export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1`
export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD)
my_merge_branch=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2`

curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"passed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "${MY_PIVOTAL_CICD}"



### Code to add the comments to the pivotal story
curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{ "text":"Squad-5 Pipelinedeployed the new code to AWS Prod-Server from artifactory using docker compose and completed the Sanity testing. Code is live to end-user \\n **Story ID**: '{story_nbr}' \\n **BRANCH**: '${my_merge_branch}' \\n **REPO**: '${MY_REPO}'\\n \\n \\n Story status is updated to **ACCEPTED** " }' "${MY_PIVOTAL_STORIES}/{story_nbr}/comments"

curl -v -X PUT -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"current_state":"accepted"}' "${MY_PIVOTAL_STORIES}/${story_nbr}"


'''
}
}
failure {
script {
sh '''
### Code to update the Story CICD Pipeline status
export story_nbr=`git show ':/^Merge' --oneline| xargs| awk '{print $7}' | cut -d '/' -f2 | cut -d '-' -f1`
export NEW_LATEST_GIT_SHA=$(git rev-parse HEAD)

curl -v -X POST -H "X-TrackerToken: $TRACKER_API_TOKEN" -H "Content-Type: application/json" -d '{"status":"failed", "url":"'$BUILD_URL'", "uuid":"9c1a65985558b645d869c2adf0f162fc", "story_ids":['${story_nbr}'], "latest_git_sha":"'$NEW_LATEST_GIT_SHA'", "version":1}' "${MY_PIVOTAL_CICD}"
'''
}
}
}
tools {
maven 'Maven3.6.3'
jdk 'JDK'
}
environment {
SONAR_AUTH = credentials('sonar-login')
TRACKER_API_TOKEN = credentials('tracker-api-token')
MY_REPO="https://github.com/devopsbcsquad5/DevOps-Demo-WebApp"
MY_PIVOTAL_CICD="https://www.pivotaltracker.com/services/v5/projects/2490801/cicd"
MY_PIVOTAL_STORIES="https://www.pivotaltracker.com/services/v5/projects/2490801/stories"
}
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ This is a sample project used for learning the devops end to end concepts
my intial commit 01/26

testing polling SCM

testing JIRA polling

NEw commit for Dp-4

NEw commit for Dp-4 second time

Starting new commit - 177411384
23 changes: 23 additions & 0 deletions TestServerCreation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- #sonar qube creation
- hosts: "{{ myhostserver }}"
become: yes
tasks:
- name: "Transfer the Tomcat installation script"
copy:
src: tomcat.sh
dest: /root/tomcat.sh
tags: tomcatInstall
- name: "Transfer the postgresql installation script"
copy:
src: postgresql.sh
dest: /root/postgresql.sh
- name: "Install Tomcat"
shell: bash tomcat.sh > tomcatinstallLog.txt
tags: tomcatInstall
- name: "Install Postgresql"
shell: bash postgresql.sh > postgresqlinstallLog.txt
tags: postgresqlInstall
- name: "Install Java"
apt:
name: openjdk-8-jdk
state: present
Loading