-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
50 lines (50 loc) · 1.46 KB
/
Copy pathJenkinsfile
File metadata and controls
50 lines (50 loc) · 1.46 KB
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
#!groovy
pipeline {
agent any
options{
//Time display
timestamps()
}
stages {
stage('Git clone config files for development') {
steps {
// cleanWs()
// Get code from a GitHub repository
sh "rm -rf /wordpress/*"
dir("/tmp/wp"){
sh "rm -rf *"
git 'https://github.com/ausard/EP-wp-docker-compose.git'
}
}
}
stage('Get latest version of Wordpress'){
steps{
dir("/tmp/wp"){
sh "chmod +x install.sh"
sh label: 'Get Wordpress', script: "./install.sh"
}
}
}
stage('Build images for docker'){
steps{
dir("/tmp/wp"){
sh "chmod +x remove_old_containers.sh"
sh label: 'Stop and remove old containers', script: "./remove_old_containers.sh"
sh "docker-compose build"
}
}
}
stage('Up and run the containers'){
steps{
dir("/tmp/wp"){
sh label: "Up and run the containers", script: "docker-compose up -d"
}
}
}
}
post{
success{
echo "Open your browser at http://localhost:8081/"
}
}
}