-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
32 lines (25 loc) · 853 Bytes
/
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
node {
def app
// Mark the code checkout 'stage'....
stage('Checkout from Bitbucket') {
checkout scm
}
// Build and Deploy to ACR 'stage'...
stage('Build and Push to Azure Container Registry') {
app = docker.build('xxxxx.azurecr.io/event-service')
docker.withRegistry('https://xxxxx.azurecr.io', 'acr-cred') {
app.push("${env.BUILD_NUMBER}")
app.push('latest')
}
}
// Pull, Run, and Test on ACS 'stage'...
stage('ACS Docker Pull and Run') {
app = docker.image('xxxxx.azurecr.io/event-service:latest')
docker.withRegistry('https://xxxxx.azurecr.io', 'acr-cred') {
app.pull()
//app.run('--name event-service -p 8082:8082')
sh '/usr/local/bin/docker-compose down'
sh '/usr/local/bin/docker-compose up -d'
}
}
}