-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
54 lines (49 loc) · 2.13 KB
/
Jenkinsfile
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
pipeline {
agent any
environment{
registry = "clms/typhon-polystore-api"
registryCredential = 'Nemo_account'
}
tools {
maven 'Maven 3.6.0'
}
stages {
// stage('Build') {
// steps {
// configFileProvider([configFile(fileId: 'c262b5dc-6fc6-40eb-a271-885950d8cf70', variable: 'MAVEN_SETTINGS')]) {
// withCredentials([usernamePassword(credentialsId: 'jib-creds', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWORD')]) {
// sh "mvn -U -gs $MAVEN_SETTINGS -f com.clms.typhonapi clean install jib:build"
// }
// }
// }
// }
stage('Deploy (master)') {
when {
expression { env.BRANCH_NAME == "master" }
}
steps{
configFileProvider([configFile(fileId: 'c262b5dc-6fc6-40eb-a271-885950d8cf70', variable: 'MAVEN_SETTINGS')]) {
withCredentials([usernamePassword(credentialsId: 'jib-creds', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWORD')]) {
// withCredentials([usernamePassword(credentialsId: 'Nemo_account', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWORD')]) {
// sh 'mvn -U -B -gs $MAVEN_SETTINGS clean compile jib:build -Djib.to.tags="latest,${BUILD_NUMBER}"'
sh 'mvn -U -gs $MAVEN_SETTINGS -f com.clms.typhonapi clean install jib:build -Djib.to.tags="latest,${BUILD_NUMBER},models2020"'
}
}
}
}
stage('Deploy (develop)') {
when {
expression { env.BRANCH_NAME == "dev" }
}
steps{
configFileProvider([configFile(fileId: 'c262b5dc-6fc6-40eb-a271-885950d8cf70', variable: 'MAVEN_SETTINGS')]) {
withCredentials([usernamePassword(credentialsId: 'jib-creds', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWORD')]) {
// withCredentials([usernamePassword(credentialsId: 'Nemo_account', usernameVariable: 'REGISTRY_USERNAME', passwordVariable: 'REGISTRY_PASSWORD')]) {
// sh 'mvn -U -B -gs $MAVEN_SETTINGS clean compile jib:build -Djib.to.tags="dev"'
sh 'mvn -U -gs $MAVEN_SETTINGS -f com.clms.typhonapi clean install jib:build -Djib.to.image="docker.io/clms/typhon-polystore-api:dev"'
}
}
}
}
}
}