File Jenkinsfile changed (mode: 100644) (index e43bcd9..2db5e08) |
... |
... |
pipeline{ |
25 |
25 |
|
|
26 |
26 |
stage('Setup dev DB instance') {
|
stage('Setup dev DB instance') {
|
27 |
27 |
steps{
|
steps{
|
28 |
|
sh "sh ./gradlew update"
|
|
|
28 |
|
sh "sh ./gradlew dev_db update"
|
29 |
29 |
}
|
}
|
30 |
30 |
}
|
}
|
31 |
31 |
|
|
|
... |
... |
pipeline{ |
87 |
87 |
}
|
}
|
88 |
88 |
}
|
}
|
89 |
89 |
}
|
}
|
|
90 |
|
|
|
91 |
|
stage('Setup dprod DB instance') {
|
|
92 |
|
steps{
|
|
93 |
|
sh "sh ./gradlew prod_db update"
|
|
94 |
|
}
|
|
95 |
|
}
|
|
96 |
|
|
|
97 |
|
stage("Deploy in dev") {
|
|
98 |
|
steps {
|
|
99 |
|
withCredentials([
|
|
100 |
|
usernamePassword(credentialsId: 'srv-gitlab', passwordVariable: 'docker_registry_password', usernameVariable: 'docker_registry_username')
|
|
101 |
|
]){
|
|
102 |
|
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 $docker_registry_username -p $docker_registry_password; 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)])
|
|
103 |
|
}
|
|
104 |
|
}
|
|
105 |
|
}
|
90 |
106 |
}
|
}
|
91 |
107 |
} |
} |
File build.gradle changed (mode: 100644) (index 8dcb1d5..c7f67b6) |
... |
... |
buildscript { |
23 |
23 |
classpath "org.liquibase:liquibase-gradle-plugin:1.1.1" |
classpath "org.liquibase:liquibase-gradle-plugin:1.1.1" |
24 |
24 |
} |
} |
25 |
25 |
} |
} |
26 |
|
/******** Load the properties file ********/ |
|
27 |
|
def devProps = new Properties() |
|
28 |
|
file("src/main/resources/application-dev.properties").withInputStream { |
|
29 |
|
stream -> devProps.load(stream) |
|
30 |
|
} |
|
31 |
|
|
|
32 |
|
def prodProps = new Properties() |
|
33 |
|
file("src/main/resources/application-prod.properties").withInputStream { |
|
34 |
|
stream -> devProps.load(stream) |
|
35 |
|
} |
|
36 |
|
|
|
37 |
|
/******** Get Key and IV from environment for password decryption ********/ |
|
38 |
|
def ENV = System.getenv() |
|
39 |
|
def codecKey = ENV['codecKey'] |
|
40 |
|
def codecIV = ENV['codecIV'] |
|
41 |
|
|
|
42 |
|
/******** Setup password decryptor by key and IV available in system environment ********/ |
|
43 |
|
Cipher deCipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); |
|
44 |
|
deCipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(new DESKeySpec(codecKey.getBytes()).getKey(), "DES"), new IvParameterSpec(codecIV.getBytes())); |
|
45 |
|
|
|
46 |
|
/******** LIQUIBASE ********/ |
|
47 |
|
apply plugin: 'liquibase' |
|
48 |
|
|
|
49 |
|
liquibase { |
|
50 |
|
def dbPassword = new String(deCipher.doFinal(devProps.getProperty('spring.datasource.password').decodeBase64())); |
|
51 |
|
activities { |
|
52 |
|
main { |
|
53 |
|
url devProps.getProperty('spring.datasource.url') |
|
54 |
|
username devProps.getProperty('spring.datasource.username') |
|
55 |
|
password dbPassword |
|
56 |
|
changeLogFile new File(rootProject.projectDir,devProps.getProperty('liquibase.change.log.file')) |
|
57 |
|
} |
|
58 |
|
} |
|
59 |
|
} |
|
60 |
|
|
|
61 |
|
/******** JACOCO ********/ |
|
62 |
|
apply plugin: 'jacoco' |
|
63 |
|
|
|
64 |
|
jacoco { |
|
65 |
|
toolVersion = "0.8.2" |
|
66 |
|
reportsDir = file("$buildDir/reports/jacoco") |
|
67 |
|
} |
|
68 |
26 |
|
|
69 |
27 |
apply plugin: 'java' |
apply plugin: 'java' |
70 |
28 |
compileJava.options.encoding = 'UTF-8' |
compileJava.options.encoding = 'UTF-8' |
|
... |
... |
dependencies { |
105 |
63 |
testCompile ('io.rest-assured:spring-web-test-client:3.3.0') |
testCompile ('io.rest-assured:spring-web-test-client:3.3.0') |
106 |
64 |
testCompile('io.rest-assured:rest-assured:3.1.0') |
testCompile('io.rest-assured:rest-assured:3.1.0') |
107 |
65 |
} |
} |
|
66 |
|
|
|
67 |
|
/******** JACOCO ********/ |
|
68 |
|
apply plugin: 'jacoco' |
|
69 |
|
|
|
70 |
|
jacoco { |
|
71 |
|
toolVersion = "0.8.2" |
|
72 |
|
reportsDir = file("$buildDir/reports/jacoco") |
|
73 |
|
} |
|
74 |
|
|
|
75 |
|
|
|
76 |
|
/******** Load the properties file ********/ |
|
77 |
|
def devProps = new Properties() |
|
78 |
|
file("src/main/resources/application-dev.properties").withInputStream { |
|
79 |
|
stream -> devProps.load(stream) |
|
80 |
|
} |
|
81 |
|
|
|
82 |
|
def prodProps = new Properties() |
|
83 |
|
file("src/main/resources/application-prod.properties").withInputStream { |
|
84 |
|
stream -> devProps.load(stream) |
|
85 |
|
} |
|
86 |
|
|
|
87 |
|
/******** Get Key and IV from environment for password decryption ********/ |
|
88 |
|
def ENV = System.getenv() |
|
89 |
|
def codecKey = ENV['codecKey'] |
|
90 |
|
def codecIV = ENV['codecIV'] |
|
91 |
|
|
|
92 |
|
/******** Setup password decryptor by key and IV available in system environment ********/ |
|
93 |
|
Cipher deCipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); |
|
94 |
|
deCipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(new DESKeySpec(codecKey.getBytes()).getKey(), "DES"), new IvParameterSpec(codecIV.getBytes())); |
|
95 |
|
|
|
96 |
|
/******** LIQUIBASE ********/ |
|
97 |
|
apply plugin: 'liquibase' |
|
98 |
|
task dev_db { |
|
99 |
|
liquibase { |
|
100 |
|
def dbPassword = new String(deCipher.doFinal(devProps.getProperty('spring.datasource.password').decodeBase64())); |
|
101 |
|
activities { |
|
102 |
|
main { |
|
103 |
|
url devProps.getProperty('spring.datasource.url') |
|
104 |
|
username devProps.getProperty('spring.datasource.username') |
|
105 |
|
password dbPassword |
|
106 |
|
changeLogFile new File(rootProject.projectDir,devProps.getProperty('liquibase.change.log.file')) |
|
107 |
|
} |
|
108 |
|
} |
|
109 |
|
} |
|
110 |
|
} |
|
111 |
|
|
|
112 |
|
task prod_db { |
|
113 |
|
liquibase { |
|
114 |
|
def dbPassword = new String(deCipher.doFinal(devProps.getProperty('spring.datasource.password').decodeBase64())); |
|
115 |
|
activities { |
|
116 |
|
main { |
|
117 |
|
url devProps.getProperty('spring.datasource.url') |
|
118 |
|
username devProps.getProperty('spring.datasource.username') |
|
119 |
|
password dbPassword |
|
120 |
|
changeLogFile new File(rootProject.projectDir,devProps.getProperty('liquibase.change.log.file')) |
|
121 |
|
} |
|
122 |
|
} |
|
123 |
|
} |
|
124 |
|
} |