-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
51 lines (49 loc) · 1.67 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
#!/usr/bin/env groovy
pipeline{
agent any
environment {
GTRI_IMAGE_REGISTRY = credentials('gtri-image-registry')
GTRI_RANCHER_API_ENDPOINT = credentials('gtri-rancher-api-endpoint')
GTRI_HDAP_ENV_ID = credentials('hdap-aws-rancher-env')
CLARITYNLP_DOCKERHUB_CREDS = 'claritynlp-dockerhub'
formImage = ''
formImageVhost = ''
}
stages{
stage('Building image') {
steps{
script {
formImage = docker.build("claritynlp/form-builder:1.0", "--build-arg PUBLIC_URL=/form-v2 -f ./Dockerfile.prod ./")
formImageVhost = docker.build("claritynlp/form-builder:1.0-vhost", "--build-arg PUBLIC_URL=/ -f ./Dockerfile.prod ./")
}
}
}
stage('Push image to private registry'){
steps{
script{
docker.withRegistry("https://${GTRI_IMAGE_REGISTRY}"){
formImage.push("latest")
formImageVhost.push("latest-vhost")
}
}
}
}
stage('Push image to public registry'){
steps{
script{
docker.withRegistry('', CLARITYNLP_DOCKERHUB_CREDS){
formImage.push("latest")
formImageVhost.push("latest-vhost")
}
}
}
}
stage('Notify orchestrator'){
steps{
script{
rancher confirm: true, credentialId: 'gt-rancher-server', endpoint: "${GTRI_RANCHER_API_ENDPOINT}", environmentId: "${GTRI_HDAP_ENV_ID}", environments: '', image: "${GTRI_IMAGE_REGISTRY}/claritynlp/form-builder:latest-vhost", ports: '', service: 'ClarityNLP-Form/formbuilder', timeout: 120
}
}
}
}
}