-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
26 lines (26 loc) · 897 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
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'docker build -t faterek/portfolio-website .'
}
}
stage('Deploy') {
steps {
sh 'docker stop portfolio-website && docker rm portfolio-website || echo "container does not exist"'
configFileProvider([configFile(fileId: 'docker-config', variable: 'DOCKER_CONFIG')]) {
sh '''
source $DOCKER_CONFIG
docker run --name=portfolio-website --restart=always --network $DOCKER_NETWORK_NAME --ip $DOCKER_IP_ADDRESS -d faterek/portfolio-website
'''
}
}
}
stage('Test') {
steps {
sh 'curl -sSf https://fater.eu.org > /dev/null && echo "Success"'
}
}
}
}