-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
27 lines (24 loc) · 1.03 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
pipeline {
agent any
environment {
DOCKER_TLS_VERIFY='1'
COMPOSE_TLS_VERSION='TLSv1_2'
DOCKER_CERT_PATH='/home/jenkins/admincerts'
DOCKER_HOST='tcp://<UCP FQDN>:443'
DTR_FQDN_PORT='<DTR_FQDN>:4443'
}
stages {
stage('Build') {
environment {
DTR_ACCESS_KEY = credentials('jenkins-dtr-access-token')
}
steps {
script {
docker image build -t ${DTR_FQDN_PORT}/engineering/jenkins-demo:build-${BUILD_ID} .
docker login -u jenkins -p ${DTR_ACCESS_KEY} ${DTR_FQDN_PORT}
docker image push ${DTR_FQDN_PORT}/engineering/jenkins-demo:build-${BUILD_ID}
}
}
}
}
}