-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile.chaincode.groovy
51 lines (45 loc) · 1.14 KB
/
Jenkinsfile.chaincode.groovy
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
51
pipeline {
agent any
environment {
JAVA_SRC_PATH="chaincode/fabcar/java"
CC_SRC_PATH="chaincode/fabcar/java/build/install/fabcar"
CC_RUNTIME_LANGUAGE="java"
}
parameters {
string(name: 'VERSION', defaultValue: '1', description: 'The version of chaincode')
}
stages {
stage('Compiling Chaincode') {
steps {
dir(env.JAVA_SRC_PATH) {
sh './gradlew installDist'
}
}
}
stage('Package Chaincode') {
steps {
sh '''
peer lifecycle chaincode package fabcar.tar.gz \
--path ${CC_SRC_PATH} \
--lang ${CC_RUNTIME_LANGUAGE} \
--label fabcar_${VERSION}
'''
}
}
stage('Commit Chaincode') {
steps {
sh '''
peer lifecycle chaincode commit \
-o localhost:7050 \
--ordererTLSHostnameOverride orderer.example.com \
--tls --cafile $ORDERER_CA \
--channelID $CHANNEL_NAME \
--name fabcar $PEER_CONN_PARMS \
--version ${VERSION} \
--sequence ${VERSION} \
--init-required
'''
}
}
}
}