-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkin_Output.txt
811 lines (757 loc) · 42.3 KB
/
Jenkin_Output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
```Groovy
pipeline {
agent any
environment {
MAVEN_PROJECT_DIR = 'java-tomcat-sample'
TERRAFORM_DIR = 'terraform'
ANSIBLE_PLAYBOOK = 'deploy.yml'
SONAR_TOKEN = credentials('SonarQubeServerToken')
TERRAFORM_BIN = '/usr/local/bin/terraform'
ANSIBLE_NAME = 'Ansible'
ANSIBLE_HOST_KEY_CHECKING = 'False'
}
stages {
stage('Verify Environment') {
steps {
sh 'echo $PATH'
sh 'terraform --version'
}
}
stage('Cleanup') {
steps {
deleteDir()
}
}
stage('Checkout SCM') {
steps {
git branch: 'dev', url: 'https://github.com/princessbethel/dissertation.git'
}
}
stage('Build') {
steps {
dir("${MAVEN_PROJECT_DIR}") {
script {
def mvnHome = tool name: 'Maven 3.9.7', type: 'maven'
sh "${mvnHome}/bin/mvn clean package"
}
}
}
}
stage('SonarQube Analysis') {
steps {
withSonarQubeEnv('SonarQube') {
dir("${MAVEN_PROJECT_DIR}") {
script {
def scannerHome = tool name: 'SonarQubeScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation'
sh """
${scannerHome}/bin/sonar-scanner \
-Dsonar.projectKey=TestProjectCiCd \
-Dsonar.projectName=TestProject_CICD \
-Dsonar.projectVersion=1.0 \
-Dsonar.sources=src \
-Dsonar.java.binaries=target/classes \
-Dsonar.host.url=http://164.90.138.210:9000 \
-Dsonar.login=${SONAR_TOKEN}
"""
}
}
}
}
}
stage('Infrastructure Provisioning') {
steps {
dir("${TERRAFORM_DIR}") {
withCredentials([
string(credentialsId: 'do_token', variable: 'DO_TOKEN'),
string(credentialsId: 'ssh_key_id', variable: 'SSH_KEY_ID'),
sshUserPrivateKey(credentialsId: 'ssh_private_key', keyFileVariable: 'SSH_PRIVATE_KEY_PATH', usernameVariable: 'SSH_USER'),
string(credentialsId: 'ssh_public_key', variable: 'SSH_PUBLIC_KEY')
]) {
script {
// Initialize Terraform
sh "${TERRAFORM_BIN} init"
// Plan Terraform changes
sh "${TERRAFORM_BIN} plan -var 'do_token=${DO_TOKEN}' -var 'ssh_key_id=${SSH_KEY_ID}' -var 'ssh_private_key=${SSH_PRIVATE_KEY_PATH}' -var 'ssh_public_key=${SSH_PUBLIC_KEY}'"
// Apply Terraform changes
sh "${TERRAFORM_BIN} apply -auto-approve -var 'do_token=${DO_TOKEN}' -var 'ssh_key_id=${SSH_KEY_ID}' -var 'ssh_private_key=${SSH_PRIVATE_KEY_PATH}' -var 'ssh_public_key=${SSH_PUBLIC_KEY}'"
// Capture Terraform output
def output = sh(script: "${TERRAFORM_BIN} output -json", returnStdout: true).trim()
def jsonOutput = readJSON text: output
env.SERVER_IP = jsonOutput.app_server_ip.value
}
}
}
}
}
stage('Deploy Application') {
steps {
withCredentials([
string(credentialsId: 'ansible_password', variable: 'ANSIBLE_PASSWORD'),
sshUserPrivateKey(credentialsId: 'ssh_private_key', keyFileVariable: 'SSH_KEY_FILE', passphraseVariable: '', usernameVariable: 'ANSIBLE_USER')
]) {
script {
def ansibleHome = tool name: "${ANSIBLE_NAME}"
sh "export PATH=${ansibleHome}/bin:\$PATH"
sh "echo 'Ansible Home: ${ansibleHome}'"
sh "echo '[app_servers]\n${SERVER_IP}' > dynamic_inventory.ini"
sh "${ansibleHome}/bin/ansible-playbook ${ANSIBLE_PLAYBOOK} -i dynamic_inventory.ini -e ansible_user=${ANSIBLE_USER} -e ansible_password=${ANSIBLE_PASSWORD} -e server_ip=${SERVER_IP} -e workspace=${WORKSPACE}"
}
}
}
}
}
post {
always {
// junit '**/target/surefire-reports/*.xml'
script {
if (currentBuild.currentResult == 'SUCCESS') {
echo 'Build succeeded!'
} else {
echo 'Build failed. Please check Jenkins for details.'
}
}
}
}
}
```
**_Explanation:_**
- This is the Jenkins pipeline script that defines the CI/CD process. It includes stages for cleaning up the workspace, checking out the source code, building the application, performing SonarQube analysis, provisioning infrastructure with Terraform, and deploying the application using Ansible.
### deploy.yml
```yml
- hosts: app_servers
become: yes
vars:
ansible_user: "deployer"
server_ip: "{{ server_ip }}"
tasks:
- name: Ensure the system is updated
apt:
update_cache: yes
- name: Wait for dpkg lock to be released
shell: |
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
echo "Waiting for dpkg lock to be released..."
sleep 5
done
become: yes
- name: Ensure Java is installed
apt:
name: openjdk-11-jdk
state: present
retries: 5
delay: 10
register: result
until: result is succeeded
become: yes
- name: Copy application WAR to server
copy:
src: "{{ workspace }}/java-tomcat-sample/target/java-tomcat-sample-0.0.1.war"
dest: /home/{{ ansible_user }}/java-tomcat-sample.war
become: yes
- name: Create a script to run the application
copy:
dest: /home/{{ ansible_user }}/run_app.sh
content: |
#!/bin/bash
nohup java -jar /home/{{ ansible_user }}/java-tomcat-sample.war > /home/{{ ansible_user }}/app.log 2>&1 &
mode: "0755"
become: yes
- name: Run the application
shell: /home/{{ ansible_user }}/run_app.sh
become: yes
- name: Wait for the application to start
pause:
minutes: 1
- name: Check if the application is running
shell: pgrep -f "java -jar /home/{{ ansible_user }}/java-tomcat-sample.war"
register: app_status
failed_when: app_status.rc != 0
become: yes
- name: Print application logs
shell: cat /home/{{ ansible_user }}/app.log
register: app_log
become: yes
- debug:
var: app_log.stdout_lines
- name: Verify application deployment
uri:
url: "http://{{ server_ip }}:8080/"
return_content: yes
register: response
retries: 5
delay: 15
- name: Check if application responded successfully
assert:
that:
- response.status == 200
fail_msg: "Application is not running or not accessible"
```
**_Explanation:_**
- This is the Ansible playbook that installs Java on the target server, copies the application JAR file, creates a script to run the application, runs the application, and verifies the deployment.
# Results and Analysis of CI/CD Pipeline Execution
1. Pipeline Execution Steps:
- Provision resources using Terraform.
- Build the Java application with Maven.
- Run SonarQube analysis for code quality.
- Deploy the application using Ansible.
2. Screenshots of Successful Runs:
![alt text](image-24.png)
![alt text](image-25.png)
3. Build Logs:
```
Started by user admin
Checking out git https://github.com/princessbethel/dissertation.git into /var/jenkins_home/workspace/TestImplementation@script/011548f96e290499de454e5f4104b27b0ef2698b5067cc550b1279c091fb4d38 to read Jenkinsfile
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
No credentials specified
> git rev-parse --resolve-git-dir /var/jenkins_home/workspace/TestImplementation@script/011548f96e290499de454e5f4104b27b0ef2698b5067cc550b1279c091fb4d38/.git # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/princessbethel/dissertation.git # timeout=10
Fetching upstream changes from https://github.com/princessbethel/dissertation.git
> git --version # timeout=10
> git --version # 'git version 2.39.2'
> git fetch --tags --force --progress -- https://github.com/princessbethel/dissertation.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/dev^{commit} # timeout=10
Checking out Revision f766bf0c178725f6520413f92ca08ef996135624 (refs/remotes/origin/dev)
> git config core.sparsecheckout # timeout=10
> git checkout -f f766bf0c178725f6520413f92ca08ef996135624 # timeout=10
Commit message: "Retry Logic for Package Installation: Added retry logic to the task that ensures Java is installed. This will retry the task up to 5 times with a 10-second delay between retries if it fails due to the lock being held."
> git rev-list --no-walk 396fa379b8c66486a5267dfa48f8213a69bad871 # timeout=10
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/TestImplementation
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
No credentials specified
> git rev-parse --resolve-git-dir /var/jenkins_home/workspace/TestImplementation/.git # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/princessbethel/dissertation.git # timeout=10
Fetching upstream changes from https://github.com/princessbethel/dissertation.git
> git --version # timeout=10
> git --version # 'git version 2.39.2'
> git fetch --tags --force --progress -- https://github.com/princessbethel/dissertation.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/dev^{commit} # timeout=10
Checking out Revision f766bf0c178725f6520413f92ca08ef996135624 (refs/remotes/origin/dev)
> git config core.sparsecheckout # timeout=10
> git checkout -f f766bf0c178725f6520413f92ca08ef996135624 # timeout=10
Commit message: "Retry Logic for Package Installation: Added retry logic to the task that ensures Java is installed. This will retry the task up to 5 times with a 10-second delay between retries if it fails due to the lock being held."
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withCredentials
Masking supported pattern matches of $SONAR_TOKEN
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Cleanup)
[Pipeline] deleteDir
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Checkout SCM)
[Pipeline] git
Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository https://github.com/princessbethel/dissertation.git
> git init /var/jenkins_home/workspace/TestImplementation # timeout=10
Fetching upstream changes from https://github.com/princessbethel/dissertation.git
> git --version # timeout=10
> git --version # 'git version 2.39.2'
> git fetch --tags --force --progress -- https://github.com/princessbethel/dissertation.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url https://github.com/princessbethel/dissertation.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
> git rev-parse refs/remotes/origin/dev^{commit} # timeout=10
Checking out Revision f766bf0c178725f6520413f92ca08ef996135624 (refs/remotes/origin/dev)
> git config core.sparsecheckout # timeout=10
> git checkout -f f766bf0c178725f6520413f92ca08ef996135624 # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git checkout -b dev f766bf0c178725f6520413f92ca08ef996135624 # timeout=10
Commit message: "Retry Logic for Package Installation: Added retry logic to the task that ensures Java is installed. This will retry the task up to 5 times with a 10-second delay between retries if it fails due to the lock being held."
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] dir
Running in /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] tool
[Pipeline] sh
```
- /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.9.7/bin/mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.example:java-tomcat-sample >-------------------
[INFO] Building hello Maven Webapp 0.0.1
[INFO] from pom.xml
[INFO] --------------------------------[ war ]---------------------------------
[WARNING] Parameter 'version' is unknown for plugin 'maven-war-plugin:3.2.3:war (default-war)'
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ java-tomcat-sample ---
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ java-tomcat-sample ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/src/main/resources
[INFO]
[INFO] --- compiler:3.13.0:compile (default-compile) @ java-tomcat-sample ---
[INFO] No sources to compile
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ java-tomcat-sample ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/src/test/resources
[INFO]
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ java-tomcat-sample ---
[INFO] No sources to compile
[INFO]
[INFO] --- surefire:2.22.2:test (default-test) @ java-tomcat-sample ---
[INFO] No tests to run.
[INFO]
[INFO] --- war:3.2.3:war (default-war) @ java-tomcat-sample ---
[INFO] Packaging webapp
[INFO] Assembling webapp [java-tomcat-sample] in [/var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/target/java-tomcat-sample-0.0.1]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/src/main/webapp]
[INFO] Webapp assembled in [84 msecs]
[INFO] Building war: /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/target/java-tomcat-sample-0.0.1.war
[INFO]
[INFO] --- dependency:2.3:copy (default) @ java-tomcat-sample ---
[INFO] Configured Artifact: com.github.jsimone:webapp-runner:8.5.11.3:jar
[INFO] Copying webapp-runner-8.5.11.3.jar to /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/target/dependency/webapp-runner.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.856 s
[INFO] Finished at: 2024-06-06T17:45:34Z
[INFO] ------------------------------------------------------------------------
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (SonarQube Analysis)
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: SonarQube
[Pipeline] {
[Pipeline] dir
Running in /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] tool
[Pipeline] sh
Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [SONAR_TOKEN]
See https://jenkins.io/redirect/groovy-string-interpolation for details.
- /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQubeScanner/bin/sonar-scanner -Dsonar.projectKey=TestProjectCiCd -Dsonar.projectName=TestProject_CICD -Dsonar.projectVersion=1.0 -Dsonar.sources=src -Dsonar.java.binaries=target/classes -Dsonar.host.url=http://164.90.138.210:9000 -Dsonar.login=**\*\***
17:45:35.861 INFO Scanner configuration file: /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQubeScanner/conf/sonar-scanner.properties
17:45:35.874 INFO Project root configuration file: /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/sonar-project.properties
17:45:35.941 INFO SonarScanner CLI 6.0.0.4432
17:45:35.945 INFO Java 17.0.11 Eclipse Adoptium (64-bit)
17:45:35.946 INFO Linux 6.8.0-35-generic amd64
17:45:36.032 INFO User cache: /root/.sonar/cache
17:45:37.670 INFO Communicating with SonarQube Server 10.5.1.90531
17:45:39.716 INFO Load global settings
17:45:39.964 INFO Load global settings (done) | time=251ms
17:45:40.018 INFO Server id: 147B411E-AY_kpLK82Aurd9SWj9AS
17:45:40.025 INFO User cache: /root/.sonar/cache
17:45:40.047 INFO Loading required plugins
17:45:40.048 INFO Load plugins index
17:45:40.179 INFO Load plugins index (done) | time=131ms
17:45:40.180 INFO Load/download plugins
17:45:40.312 INFO Load/download plugins (done) | time=132ms
17:45:41.114 INFO Process project properties
17:45:41.132 INFO Process project properties (done) | time=17ms
17:45:41.148 INFO Project key: TestProjectCiCd
17:45:41.148 INFO Base dir: /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample
17:45:41.148 INFO Working dir: /var/jenkins_home/workspace/TestImplementation/java-tomcat-sample/.scannerwork
17:45:41.185 INFO Load project settings for component key: 'TestProjectCiCd'
17:45:41.271 INFO Load project settings for component key: 'TestProjectCiCd' (done) | time=86ms
17:45:41.442 INFO Load quality profiles
17:45:41.822 INFO Load quality profiles (done) | time=380ms
17:45:41.886 INFO Auto-configuring with CI 'Jenkins'
17:45:41.994 INFO Load active rules
17:46:05.761 INFO Load active rules (done) | time=23767ms
17:46:05.780 INFO Load analysis cache
17:46:05.797 INFO Load analysis cache (404) | time=17ms
17:46:05.939 WARN The property 'sonar.login' is deprecated and will be removed in the future. Please use the 'sonar.token' property instead when passing a token.
17:46:05.984 INFO Preprocessing files...
17:46:06.393 INFO 2 languages detected in 2 preprocessed files
17:46:06.393 INFO 0 files ignored because of scm ignore settings
17:46:06.397 INFO Loading plugins for detected languages
17:46:06.398 INFO Load/download plugins
17:46:06.406 INFO Load/download plugins (done) | time=8ms
17:46:06.594 INFO Inconsistent constructor declaration on bean with name 'org.sonarsource.scanner.lib.internal.IsolatedClassloader@2374d36a-org.sonar.scanner.issue.IssueFilters': single autowire-marked constructor flagged as optional - this constructor is effectively required since there is no default constructor to fall back to: public org.sonar.scanner.issue.IssueFilters(org.sonar.api.batch.fs.internal.DefaultInputProject)
17:46:06.661 INFO Load project repositories
17:46:06.705 INFO Load project repositories (done) | time=44ms
17:46:06.764 INFO Indexing files...
17:46:06.770 INFO Project configuration:
17:46:06.838 INFO 2 files indexed
17:46:06.844 INFO Quality profile for jsp: Sonar way
17:46:06.845 INFO Quality profile for xml: Sonar way
17:46:06.845 INFO ------------- Run sensors on module TestProject_CICD
17:46:06.970 INFO Load metrics repository
17:46:07.084 INFO Load metrics repository (done) | time=114ms
17:46:08.748 INFO Sensor HTML [web]
17:46:08.944 INFO Sensor HTML [web] (done) | time=197ms
17:46:08.945 INFO Sensor XML Sensor [xml]
17:46:08.967 INFO 1 source file to be analyzed
17:46:09.462 INFO 1/1 source file has been analyzed
17:46:09.462 INFO Sensor XML Sensor [xml] (done) | time=517ms
17:46:09.462 INFO Sensor JaCoCo XML Report Importer [jacoco]
17:46:09.466 INFO 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
17:46:09.468 INFO No report imported, no coverage information will be imported by JaCoCo XML Report Importer
17:46:09.468 INFO Sensor JaCoCo XML Report Importer [jacoco] (done) | time=6ms
17:46:09.468 INFO Sensor IaC Docker Sensor [iac]
17:46:09.477 INFO 0 source files to be analyzed
17:46:09.708 INFO 0/0 source files have been analyzed
17:46:09.708 INFO Sensor IaC Docker Sensor [iac] (done) | time=240ms
17:46:09.709 INFO Sensor TextAndSecretsSensor [text]
17:46:09.709 INFO Available processors: 2
17:46:09.709 INFO Using 2 threads for analysis.
17:46:11.081 INFO 2 source files to be analyzed
17:46:11.129 INFO 2/2 source files have been analyzed
17:46:11.130 INFO Sensor TextAndSecretsSensor [text] (done) | time=1421ms
17:46:11.144 INFO ------------- Run sensors on project
17:46:11.269 INFO Sensor Zero Coverage Sensor
17:46:11.270 INFO Sensor Zero Coverage Sensor (done) | time=1ms
17:46:11.289 INFO CPD Executor 1 file had no CPD blocks
17:46:11.289 INFO CPD Executor Calculating CPD for 0 files
17:46:11.290 INFO CPD Executor CPD calculation finished (done) | time=0ms
17:46:11.299 INFO SCM revision ID 'f766bf0c178725f6520413f92ca08ef996135624'
17:46:11.589 INFO Analysis report generated in 254ms, dir size=194.8 kB
17:46:11.628 INFO Analysis report compressed in 38ms, zip size=20.9 kB
17:46:11.729 INFO Analysis report uploaded in 93ms
17:46:11.737 INFO ANALYSIS SUCCESSFUL, you can find the results at: http://164.90.138.210:9000/dashboard?id=TestProjectCiCd
17:46:11.737 INFO Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
17:46:11.737 INFO More about the report processing at http://164.90.138.210:9000/api/ce/task?id=6b127d16-91b3-40df-976e-a655f254a109
17:46:11.790 INFO Analysis total time: 31.355 s
17:46:11.793 INFO EXECUTION SUCCESS
17:46:11.797 INFO Total time: 36.017s
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:145)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:424)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:386)
at ch.qos.logback.classic.Logger.error(Logger.java:543)
at org.eclipse.jgit.internal.util.ShutdownHook.cleanup(ShutdownHook.java:87)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at org.sonarsource.scanner.lib.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Infrastructure Provisioning)
[Pipeline] dir
Running in /var/jenkins_home/workspace/TestImplementation/terraform
[Pipeline] {
[Pipeline] withCredentials
Masking supported pattern matches of $DO_TOKEN or $SSH_KEY_ID or $SSH_PRIVATE_KEY_PATH or $SSH_PUBLIC_KEY
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] sh
- /usr/local/bin/terraform init
[0m[1mInitializing the backend...[0m
[0m[1mInitializing provider plugins...[0m
- Finding digitalocean/digitalocean versions matching "~> 2.0"...
- Installing digitalocean/digitalocean v2.39.2...
- Installed digitalocean/digitalocean v2.39.2 (signed by a HashiCorp partner, key ID [0m[1mF82037E524B9C0E8[0m[0m)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file [1m.terraform.lock.hcl[0m to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.[0m
[0m[1m[32mTerraform has been successfully initialized![0m[32m[0m
[0m[32m
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.[0m
[Pipeline] sh
Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [SSH_KEY_ID, DO_TOKEN, SSH_PUBLIC_KEY, SSH_PRIVATE_KEY_PATH]
See https://jenkins.io/redirect/groovy-string-interpolation for details.
- /usr/local/bin/terraform plan -var do_token=\***\* -var ssh_key_id=\*\*** -var ssh_private_key=\***\* -var ssh_public_key=\*\***
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
[32m+[0m create
[0m
Terraform will perform the following actions:
[1m # digitalocean_droplet.app_server[0m will be created[0m[0m
[0m [32m+[0m[0m resource "digitalocean_droplet" "app_server" {
[32m+[0m [0m[1m[0mbackups[0m[0m = false
[32m+[0m [0m[1m[0mcreated_at[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mdisk[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mgraceful_shutdown[0m[0m = false
[32m+[0m [0m[1m[0mid[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mimage[0m[0m = "ubuntu-20-04-x64"
[32m+[0m [0m[1m[0mipv4_address[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mipv4_address_private[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mipv6[0m[0m = false
[32m+[0m [0m[1m[0mipv6_address[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mlocked[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mmemory[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mmonitoring[0m[0m = false
[32m+[0m [0m[1m[0mname[0m[0m = "app-server"
[32m+[0m [0m[1m[0mprice_hourly[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mprice_monthly[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mprivate_networking[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mregion[0m[0m = "nyc3"
[32m+[0m [0m[1m[0mresize_disk[0m[0m = true
[32m+[0m [0m[1m[0msize[0m[0m = "s-1vcpu-1gb"
[32m+[0m [0m[1m[0mssh_keys[0m[0m = [
[32m+[0m [0m"****",
]
[32m+[0m [0m[1m[0mstatus[0m[0m = (known after apply)
[32m+[0m [0m[1m[0murn[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mvcpus[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mvolume_ids[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mvpc_uuid[0m[0m = (known after apply)
}
[0m[1mPlan:[0m 1 to add, 0 to change, 0 to destroy.
[0m[0m
[1mChanges to Outputs:[0m[0m
[32m+[0m [0m[1m[0mapp_server_ip[0m[0m = (known after apply)
[90m
─────────────────────────────────────────────────────────────────────────────[0m
Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.
[Pipeline] sh
Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [SSH_KEY_ID, DO_TOKEN, SSH_PUBLIC_KEY, SSH_PRIVATE_KEY_PATH]
See https://jenkins.io/redirect/groovy-string-interpolation for details.
- /usr/local/bin/terraform apply -auto-approve -var do_token=\***\* -var ssh_key_id=\*\*** -var ssh_private_key=\***\* -var ssh_public_key=\*\***
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
[32m+[0m create
[0m
Terraform will perform the following actions:
[1m # digitalocean_droplet.app_server[0m will be created[0m[0m
[0m [32m+[0m[0m resource "digitalocean_droplet" "app_server" {
[32m+[0m [0m[1m[0mbackups[0m[0m = false
[32m+[0m [0m[1m[0mcreated_at[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mdisk[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mgraceful_shutdown[0m[0m = false
[32m+[0m [0m[1m[0mid[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mimage[0m[0m = "ubuntu-20-04-x64"
[32m+[0m [0m[1m[0mipv4_address[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mipv4_address_private[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mipv6[0m[0m = false
[32m+[0m [0m[1m[0mipv6_address[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mlocked[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mmemory[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mmonitoring[0m[0m = false
[32m+[0m [0m[1m[0mname[0m[0m = "app-server"
[32m+[0m [0m[1m[0mprice_hourly[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mprice_monthly[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mprivate_networking[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mregion[0m[0m = "nyc3"
[32m+[0m [0m[1m[0mresize_disk[0m[0m = true
[32m+[0m [0m[1m[0msize[0m[0m = "s-1vcpu-1gb"
[32m+[0m [0m[1m[0mssh_keys[0m[0m = [
[32m+[0m [0m"****",
]
[32m+[0m [0m[1m[0mstatus[0m[0m = (known after apply)
[32m+[0m [0m[1m[0murn[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mvcpus[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mvolume_ids[0m[0m = (known after apply)
[32m+[0m [0m[1m[0mvpc_uuid[0m[0m = (known after apply)
}
[0m[1mPlan:[0m 1 to add, 0 to change, 0 to destroy.
[0m[0m
[1mChanges to Outputs:[0m[0m
[32m+[0m [0m[1m[0mapp_server_ip[0m[0m = (known after apply)
[0m[1mdigitalocean_droplet.app_server: Creating...[0m[0m
[0m[1mdigitalocean_droplet.app_server: Still creating... [10s elapsed][0m[0m
[0m[1mdigitalocean_droplet.app_server: Still creating... [20s elapsed][0m[0m
[0m[1mdigitalocean_droplet.app_server: Still creating... [30s elapsed][0m[0m
[0m[1mdigitalocean_droplet.app_server: Provisioning with 'remote-exec'...[0m[0m
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mConnecting to remote host via SSH...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Host: 159.65.174.94
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m User: root
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Password: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Private key: true
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Certificate: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m SSH Agent: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Checking Host Key: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Target Platform: unix
[0m[1mdigitalocean_droplet.app_server: Still creating... [40s elapsed][0m[0m
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mConnecting to remote host via SSH...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Host: 159.65.174.94
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m User: root
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Password: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Private key: true
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Certificate: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m SSH Agent: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Checking Host Key: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Target Platform: unix
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mConnecting to remote host via SSH...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Host: 159.65.174.94
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m User: root
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Password: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Private key: true
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Certificate: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m SSH Agent: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Checking Host Key: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Target Platform: unix
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mConnecting to remote host via SSH...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Host: 159.65.174.94
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m User: root
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Password: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Private key: true
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Certificate: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m SSH Agent: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Checking Host Key: false
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m Target Platform: unix
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mConnected!
[0m[1mdigitalocean_droplet.app_server: Still creating... [50s elapsed][0m[0m
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Working]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:1 http://security.ubuntu.com/ubuntu focal-security InRelease [128 kB]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Connected to archive.ubuntu.com (91
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mHit:2 http://archive.ubuntu.com/ubuntu focal InRelease
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Waiting for headers] [1 InRelease 1
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [128 kB]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [128 kB]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Working]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Working]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Working]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Working]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [Working]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [3337 kB]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [5 Packages 298 kB/3337 kB 9%]
...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:16 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [620 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [5 Packages store 0 B] [16 Commands-
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [5 Packages store 0 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [5 Packages store 0 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:17 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m0% [5 Packages store 0 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:18 http://archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB]
...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m93% [5 Packages store 0 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:32 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [24.0 kB]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m93% [5 Packages store 0 B] [32 Packages
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m93% [5 Packages store 0 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:33 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5904 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m93% [5 Packages store 0 B] [33 Translat
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m93% [5 Packages store 0 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mGet:34 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [548 B]
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0m93% [5 Packages store 0 B] [34 Commands
...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mFetched 17.2 MB in 11s (1627 kB/s)
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mReading package lists... 0%
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mReading package lists... 0%
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mReading package lists... 0%
...
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mReading package lists... 99%
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mReading package lists... Done
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mE: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1659 (apt-get)
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mN: Be aware that removing the lock file is not a solution and may break your system.
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mE: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1659 (apt-get)
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mN: Be aware that removing the lock file is not a solution and may break your system.
[0m[1mdigitalocean_droplet.app_server (remote-exec):[0m [0mE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
[0m[1mdigitalocean_droplet.app_server: Provisioning with 'local-exec'...[0m[0m
[0m[1mdigitalocean_droplet.app_server (local-exec):[0m [0mExecuting: ["/bin/sh" "-c" " ssh-keyscan -H 159.65.174.94 >> ~/.ssh/known_hosts\n"]
[0m[1mdigitalocean_droplet.app_server (local-exec):[0m [0m# 159.65.174.94:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
[0m[1mdigitalocean_droplet.app_server (local-exec):[0m [0m# 159.65.174.94:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
[0m[1mdigitalocean_droplet.app_server (local-exec):[0m [0m# 159.65.174.94:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
[0m[1mdigitalocean_droplet.app_server (local-exec):[0m [0m# 159.65.174.94:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
[0m[1mdigitalocean_droplet.app_server (local-exec):[0m [0m# 159.65.174.94:22 SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
[0m[1mdigitalocean_droplet.app_server: Creation complete after 1m11s [id=423883970][0m
[0m[1m[32m
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
[0m[0m[1m[32m
Outputs:
[0mapp_server_ip = "159.65.174.94"
[Pipeline] sh
- /usr/local/bin/terraform output -json
[Pipeline] readJSON
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy Application)
[Pipeline] withCredentials
Masking supported pattern matches of $ANSIBLE_PASSWORD or $SSH_KEY_FILE
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] tool
[Pipeline] sh
- export PATH=/bin:/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[Pipeline] sh
- echo Ansible Home:
Ansible Home:
[Pipeline] sh
- echo [app_servers]
159.65.174.94
[Pipeline] sh
Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [ANSIBLE_PASSWORD]
See https://jenkins.io/redirect/groovy-string-interpolation for details.
- /bin/ansible-playbook deploy.yml -i dynamic_inventory.ini -e ansible_user=deployer -e ansible_password=\*\*\*\* -e server_ip=159.65.174.94 -e workspace=/var/jenkins_home/workspace/TestImplementation
PLAY [app_servers] **\*\***\*\***\*\***\*\***\*\***\*\***\*\***\***\*\***\*\***\*\***\*\***\*\***\*\***\*\***
TASK [Gathering Facts] \***\*\*\*\*\*\*\***\*\*\*\*\***\*\*\*\*\*\*\***\*\***\*\*\*\*\*\*\***\*\*\*\*\***\*\*\*\*\*\*\***
ok: [159.65.174.94]
TASK [Ensure the system is updated] **\*\*\*\***\*\*\*\***\*\*\*\***\*\*\*\***\*\*\*\***\*\*\*\***\*\*\*\***
changed: [159.65.174.94]
TASK [Wait for dpkg lock to be released] **\*\*\*\***\*\***\*\*\*\***\*\*\***\*\*\*\***\*\***\*\*\*\***
changed: [159.65.174.94]
TASK [Ensure Java is installed] \***\*\*\*\*\***\*\*\***\*\*\*\*\***\*\*\*\*\***\*\*\*\*\***\*\*\***\*\*\*\*\***
changed: [159.65.174.94]
TASK [Copy application WAR to server] **\*\*\*\***\*\*\*\***\*\*\*\***\*\***\*\*\*\***\*\*\*\***\*\*\*\***
changed: [159.65.174.94]
TASK [Run the application] \***\*\*\*\*\*\*\***\*\*\***\*\*\*\*\*\*\***\*\***\*\*\*\*\*\*\***\*\*\***\*\*\*\*\*\*\***
changed: [159.65.174.94]
PLAY RECAP **\*\***\*\*\*\***\*\***\*\***\*\***\*\*\*\***\*\***\***\*\***\*\*\*\***\*\***\*\***\*\***\*\*\*\***\*\***
159.65.174.94 : ok=6 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] junit
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline