-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
46 lines (46 loc) · 1.49 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('Stop') {
parallel {
stage('Stop Fabric') {
steps {
sh 'docker rm -f $(docker ps | grep "hyperledger/fabric" | cut -d" " -f1) | exit 0'
sh 'docker rm -f $(docker ps | grep "dev-peer" | cut -d" " -f1) | exit 0'
}
}
stage('Clean Fabric') {
steps {
sh 'docker rmi -f $(docker images | grep "hyperledger/fabric" | cut -d" " -f1) | exit 0'
sh 'docker rmi -f $(docker images | grep passport | cut -d" " -f1) | exit 0'
sh 'docker rmi -f $(docker images | grep visa | cut -d" " -f1) | exit 0'
sh 'docker rmi -f $(docker images | grep "hyperledger/fabric" | cut -d" " -f1) | exit 0'
sh 'docker rmi -f $(docker images | grep "dev-peer" | cut -d" " -f1) | exit 0'
}
}
stage('Stop back-end') {
steps {
sh 'docker rm -f -v nip-back | exit 0'
}
}
}
}
stage('Build') {
steps {
sh './create_bin.sh'
}
}
stage('Start Fabric') {
steps {
sh 'cd nip && ./startFabric.sh'
sh 'cd nip && ./actionsPostStart.sh'
}
}
stage('Restart back') {
steps {
sh '''docker run -d --name nip-back -v /var/lib/jenkins/workspace/blockchain_master/nip-network/:/app/nip-network -v /var/lib/jenkins/workspace/blockchain_master/nip/javascript/wallet:/app/nip/javascript/wallet --net=host nip/back
'''
}
}
}
}