List of commits:
Subject Hash Author Date (UTC)
[AP] Fix the credential id for gitlab 9bba45b10eb93688e11435219a7cdffafbbee8d7 Pai, Ashwin 2019-01-31 17:18:45
Refactor Jenkins cred 36acd3adbb192d251ccdc83802fc6a54798d3493 mandas04 2019-01-31 15:55:35
Update test cases 351a1f00250e293ff49fd66c852a3bced9c296be mandas04 2019-01-31 15:21:06
Skipped testing during gradle build 37352f5b876e311a19a8b2aea5759c9c1be8f037 mandas04 2019-01-31 13:29:27
Adjust JaCoCo test coverage 3eca68000e279756223fc5d27accf3a12988ad1d mandas04 2019-01-31 13:17:55
update resttemplate configurations bd1da0c99a2f97c0f7ac1537121a093b7229cba5 mandas04 2019-01-31 13:10:04
Refactor test packages ddc3aae04e4ebceb21b5a421813be6e0cc7733ad mandas04 2019-01-31 11:46:57
Refactoring Test packages e916b5f3f15beb28f5a7373bc046cc81fb2b7630 mandas04 2019-01-31 04:36:10
Refactor DockerFile 90de083d4cb6128977b761994a02b244c8d3cf6c mandas04 2019-01-30 14:31:54
Refactor DockerFile cbf36a94f7e3d7cd6ca2c36279ec5d28886afc54 mandas04 2019-01-30 12:52:25
Liquibase setup for dev and prod separately 93cb8265755e2ceb14c45b1f99e8581aa93155fc mandas04 2019-01-30 12:41:48
Sanity test in dev: correct env variable name f0ecedb119b83f313b5a04e1affb4e1584790ce4 mandas04 2019-01-30 09:47:33
Refactor Jenkinsfile c853f0d754b0c4086e4fb02a0d4776e9865f77f5 mandas04 2019-01-30 09:16:41
Put hyphen in place of empty version c45822e737f1fc38a9498f5c3600de374762c588 mandas04 2019-01-30 09:14:51
Plot all applications (reference + reporting) in report 2c37a8767f97d63ac8c347f33fcc765d08ce1998 mandas04 2019-01-30 06:09:22
Setup liquibase for dev and prod separately 49dc85a8404833ebb7193a396a1ede16dafa32e5 mandas04 2019-01-30 05:44:31
Jenkins secret variable udpate 23ef9bc048d411e15da152aba1d87616bc7c0b97 mandas04 2019-01-30 05:03:31
User service reimplented as POST and DELETE method 8e08f92e52927c03152c7eca01b0549eb6608bf3 mandas04 2019-01-30 05:00:07
Adding wait for 2 mins before sanity test ebec65b19a1bd1cb36f0a8ac03d22c8893bf9123 mandas04 2019-01-29 15:42:27
Adding acceptance test criteria b38c915f4f14f13a73b3ae3945f791342ea31099 mandas04 2019-01-29 12:55:27
Commit 9bba45b10eb93688e11435219a7cdffafbbee8d7 - [AP] Fix the credential id for gitlab
Author: Pai, Ashwin
Author date (UTC): 2019-01-31 17:18
Committer name: Pai, Ashwin
Committer date (UTC): 2019-01-31 17:18
Parent(s): 36acd3adbb192d251ccdc83802fc6a54798d3493
Signing key:
Tree: 3abdb07c9a136a59e2710d9ccb47d0a332555df5
File Lines added Lines deleted
Jenkinsfile 105 105
File Jenkinsfile changed (mode: 100644) (index aff5a81..60c012d)
1 pipeline{
2 agent {
3 label 'iib-sca-build'
4 }
5 environment {
6 codecIV = credentials('deployment_audit_api_iv_nonprod')
7 codecKey = credentials('deployment_audit_api_key_nonprod')
8 codecIV_prod = credentials('deployment_audit_api_iv_prod')
9 codecKey_prod = credentials('deployment_audit_api_key_prod')
10 srv_gitlab = credentials('srv-gitlab')
11 }
12 stages
13 {
14 stage("Compile") {
15 steps {
16 sh "sh ./gradlew compileJava --stacktrace"
17 }
18 }
19
20 stage("Unit test") {
21 steps {
22 sh "sh ./gradlew test --tests com.kingfisher.deployment.audit.test.unit.suite.* --stacktrace"
23 publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/reports/tests/test', reportFiles: 'index.html', reportName: 'Unit Test Report', reportTitles: 'Unit tests by Junit'])
24 }
25 }
26
27 stage('Setup dev DB instance') {
28 steps{
29 sh "sh ./gradlew update -PrunList=dev --stacktrace"
30 }
31 }
32
33 stage("Integration test with dev DB") {
34 steps {
35 sh "sh ./gradlew test --tests com.kingfisher.deployment.audit.test.integration.suite.* --stacktrace"
36 publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/reports/tests/test', reportFiles: 'index.html', reportName: 'Integration Test Report', reportTitles: 'Unit tests by Junit'])
37 }
38 }
39
40 stage('Test Coverage') {
41 steps{
42 // sh "sh ./gradlew check"
43 sh "sh ./gradlew jacocoTestReport --stacktrace"
44 publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/reports/jacoco/test/html', reportFiles: 'index.html', reportName: 'Code Coverage Report', reportTitles: 'Code coverage by JaCoCo'])
45 }
46 }
47
48 stage("Package") {
49 steps {
50 // sh "sh ./gradlew -Dskip.tests build "
51 sh "sh ./gradlew build -x test "
52 }
53 }
54
55 stage("Docker build") {
56 steps {
57 sh "docker build -t registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:latest --build-arg arg_port=9090 --build-arg arg_profile=dev --build-arg arg_codecKey=$codecKey --build-arg arg_codecIV=$codecIV --build-arg arg_git_commit=$GIT_COMMIT ."
58 sh "docker build -t registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:${BUILD_NUMBER} --build-arg arg_port=9090 --build-arg arg_profile=dev --build-arg arg_codecKey=$codecKey --build-arg arg_codecIV=$codecIV ."
59 }
60 }
61
62 stage("Docker publish to registry") {
63 steps {
64 withDockerRegistry([ credentialsId: "srv_gitlab", url: "https://registry.gitlab.kfplc.com" ]) {
65 sh "docker push registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:latest"
66 sh "docker push registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:${BUILD_NUMBER}"
67 }
68 }
69 }
70
71 stage("Deploy in dev") {
72 steps {
73
74 sshPublisher(publishers: [sshPublisherDesc(configName: 'INTAPPS_NONPROD', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'docker ps -aq|xargs -I {} docker stop {}; docker ps -aq|xargs -I {} docker rm {}; docker login registry.gitlab.kfplc.com -u $srv_gitlab_USR -p $srv_gitlab_PSW; docker pull registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api; docker run -d -p 9090:9090 registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api', execTimeout: 1200000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/cloud-user', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
75
76 }
77 }
78
79 /*stage("Sanity test in dev") {
80 steps {
81 script
82 {
83 sleep (2*60) // Sleep for 2 mins, waiting the application to be booted up in dev
84 currentGitCommit = sh(script: 'curl http://int-hos-intapps-nonprod-01.iaas.gha.kfplc.com:9090/v1/currentGitCommit', returnStdout: true)
85 if ( currentGitCommit != GIT_COMMIT ){
86 sh "exit 1"
87 }
88 }
89 }
90 }*/
91
92 stage('Setup prod DB instance') {
93 steps{
94 sh "sh ./gradlew update -PrunList=prod"
95 }
96 }
97
98 stage("Deploy in prod") {
99 steps {
100
101 sshPublisher(publishers: [sshPublisherDesc(configName: 'INTAPPS_PROD', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'docker ps -aq|xargs -I {} docker stop {}; docker ps -aq|xargs -I {} docker rm {}; docker login registry.gitlab.kfplc.com -u $srv_gitlab_USR -p $srv_gitlab_PSW; docker pull registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api; docker run -d -p 9090:9090 registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api', execTimeout: 1200000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/cloud-user', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
102
103 }
104 }
105 }
1 pipeline{
2 agent {
3 label 'iib-sca-build'
4 }
5 environment {
6 codecIV = credentials('deployment_audit_api_iv_nonprod')
7 codecKey = credentials('deployment_audit_api_key_nonprod')
8 codecIV_prod = credentials('deployment_audit_api_iv_prod')
9 codecKey_prod = credentials('deployment_audit_api_key_prod')
10 srv_gitlab = credentials('srv-gitlab')
11 }
12 stages
13 {
14 stage("Compile") {
15 steps {
16 sh "sh ./gradlew compileJava --stacktrace"
17 }
18 }
19
20 stage("Unit test") {
21 steps {
22 sh "sh ./gradlew test --tests com.kingfisher.deployment.audit.test.unit.suite.* --stacktrace"
23 publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/reports/tests/test', reportFiles: 'index.html', reportName: 'Unit Test Report', reportTitles: 'Unit tests by Junit'])
24 }
25 }
26
27 stage('Setup dev DB instance') {
28 steps{
29 sh "sh ./gradlew update -PrunList=dev --stacktrace"
30 }
31 }
32
33 stage("Integration test with dev DB") {
34 steps {
35 sh "sh ./gradlew test --tests com.kingfisher.deployment.audit.test.integration.suite.* --stacktrace"
36 publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/reports/tests/test', reportFiles: 'index.html', reportName: 'Integration Test Report', reportTitles: 'Unit tests by Junit'])
37 }
38 }
39
40 stage('Test Coverage') {
41 steps{
42 // sh "sh ./gradlew check"
43 sh "sh ./gradlew jacocoTestReport --stacktrace"
44 publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/reports/jacoco/test/html', reportFiles: 'index.html', reportName: 'Code Coverage Report', reportTitles: 'Code coverage by JaCoCo'])
45 }
46 }
47
48 stage("Package") {
49 steps {
50 // sh "sh ./gradlew -Dskip.tests build "
51 sh "sh ./gradlew build -x test "
52 }
53 }
54
55 stage("Docker build") {
56 steps {
57 sh "docker build -t registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:latest --build-arg arg_port=9090 --build-arg arg_profile=dev --build-arg arg_codecKey=$codecKey --build-arg arg_codecIV=$codecIV --build-arg arg_git_commit=$GIT_COMMIT ."
58 sh "docker build -t registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:${BUILD_NUMBER} --build-arg arg_port=9090 --build-arg arg_profile=dev --build-arg arg_codecKey=$codecKey --build-arg arg_codecIV=$codecIV ."
59 }
60 }
61
62 stage("Docker publish to registry") {
63 steps {
64 withDockerRegistry([ credentialsId: "srv-gitlab", url: "https://registry.gitlab.kfplc.com" ]) {
65 sh "docker push registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:latest"
66 sh "docker push registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api:${BUILD_NUMBER}"
67 }
68 }
69 }
70
71 stage("Deploy in dev") {
72 steps {
73
74 sshPublisher(publishers: [sshPublisherDesc(configName: 'INTAPPS_NONPROD', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'docker ps -aq|xargs -I {} docker stop {}; docker ps -aq|xargs -I {} docker rm {}; docker login registry.gitlab.kfplc.com -u $srv_gitlab_USR -p $srv_gitlab_PSW; docker pull registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api; docker run -d -p 9090:9090 registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api', execTimeout: 1200000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/cloud-user', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
75
76 }
77 }
78
79 /*stage("Sanity test in dev") {
80 steps {
81 script
82 {
83 sleep (2*60) // Sleep for 2 mins, waiting the application to be booted up in dev
84 currentGitCommit = sh(script: 'curl http://int-hos-intapps-nonprod-01.iaas.gha.kfplc.com:9090/v1/currentGitCommit', returnStdout: true)
85 if ( currentGitCommit != GIT_COMMIT ){
86 sh "exit 1"
87 }
88 }
89 }
90 }*/
91
92 stage('Setup prod DB instance') {
93 steps{
94 sh "sh ./gradlew update -PrunList=prod"
95 }
96 }
97
98 stage("Deploy in prod") {
99 steps {
100
101 sshPublisher(publishers: [sshPublisherDesc(configName: 'INTAPPS_PROD', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'docker ps -aq|xargs -I {} docker stop {}; docker ps -aq|xargs -I {} docker rm {}; docker login registry.gitlab.kfplc.com -u $srv_gitlab_USR -p $srv_gitlab_PSW; docker pull registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api; docker run -d -p 9090:9090 registry.gitlab.kfplc.com/integration_automation/int-deployment-audit-api', execTimeout: 1200000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/cloud-user', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
102
103 }
104 }
105 }
106 106 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Sumangal-IN/deployment-audit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Sumangal-IN/deployment-audit

Clone this repository using git:
git clone git://git.rocketgit.com/user/Sumangal-IN/deployment-audit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main