-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
36 lines (33 loc) · 1.1 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
pipeline {
agent any
options {
disableConcurrentBuilds()
}
stages {
stage('Checkout') {
steps {
git 'https://github.com/SirSkaro/Cook-Book-Client.git'
}
}
stage('Build') {
steps {
configFileProvider([configFile(fileId: '23250c9a-a573-4d86-9afa-163a6aa03a2c', targetLocation: '.env.local')]) {}
sh 'docker build -t cookbook-client .'
}
}
stage('Deploy') {
steps {
sh 'docker stop cookbook-client || true && docker rm cookbook-client || true'
withCredentials([string(credentialsId: 'e6484059-0aa9-45ca-a270-e8d2ae719ecc', variable: 'serverName')]) {
sh 'docker run -d \
--expose 80 \
--network casa-net \
--name cookbook-client \
--restart always \
-e VIRTUAL_HOST=$serverName \
cookbook-client'
}
}
}
}
}