-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
46 lines (30 loc) · 1.31 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
37
38
39
40
41
42
43
44
45
46
pipeline {
agent any
stages {
stage("Preparing environment") {
steps {
echo ' Executing command for preparing '
withCredentials([file(credentialsId: 'FEenv' , variable: 'Env')]){
sh 'chmod 700 $WORKSPACE/.env || :'
sh 'rm -rf $WORKSPACE/.env || :'
sh 'cp $Env $WORKSPACE'
} // End .env step
withCredentials([file(credentialsId: 'FEenvdev', variable: 'envDev')]){
sh 'chmod 700 $WORKSPACE/.env.development || :'
sh 'rm -rf $WORKSPACE/.env.development || :'
sh 'cp $envDev $WORKSPACE'
}// End .env.production step
echo ' ------------------------------ '
} // End steps
} // End stage preparing environment
stage("Deployment"){
steps{
echo ' Executing command for deployment '
sh 'docker-compose down --rmi local || :'
sh 'docker-compose up -d --build'
sh 'docker ps -a'
echo ' ------------------------------ '
} // End steps
}// End stage deployment
} // End stages
} // End pipeline