forked from IBM/blockchain-network-on-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerateArtifactsJob.yaml
35 lines (34 loc) · 1.75 KB
/
generateArtifactsJob.yaml
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
---
apiVersion: batch/v1
kind: Job
metadata:
name: utils
spec:
backoffLimit: 1
template:
metadata:
name: utils
spec:
restartPolicy: "Never"
volumes:
- name: sharedvolume
persistentVolumeClaim:
claimName: shared-pvc
- name: dockersocket
hostPath:
path: /var/run/docker.sock
containers:
- name: cryptogen
image: hyperledger/fabric-tools:x86_64-1.1.0
imagePullPolicy: Always
command: ["sh", "-c", "echo 'Cryptogen Starts'; ls -l /shared/artifacts; while [ ! -d /shared/artifacts ]; do echo Waiting for configFiles; sleep 1; done; cryptogen generate --config /shared/artifacts/crypto-config.yaml && cp -r crypto-config /shared/ && for file in $(find /shared/ -iname *_sk); do echo $file; dir=$(dirname $file); echo ${dir}; mv ${dir}/*_sk ${dir}/key.pem; done && find /shared -type d | xargs chmod a+rx && find /shared -type f | xargs chmod a+r && touch /shared/status_cryptogen_complete;"]
volumeMounts:
- mountPath: /shared
name: sharedvolume
- name: configtxgen
image: hyperledger/fabric-tools:x86_64-1.1.0
imagePullPolicy: Always
command: ["sh", "-c", "echo 'Configtxgen Starts'; ls -l /shared; sleep 1 && while [ ! -f /shared/status_cryptogen_complete ]; do echo Waiting for cryptogen; sleep 1; done; cp /shared/artifacts/configtx.yaml /shared/; cd /shared/; export FABRIC_CFG_PATH=$PWD; configtxgen -profile FourOrgsOrdererGenesis -outputBlock genesis.block && find /shared -type d | xargs chmod a+rx && find /shared -type f | xargs chmod a+r && touch /shared/status_configtxgen_complete && rm /shared/status_cryptogen_complete;"]
volumeMounts:
- mountPath: /shared
name: sharedvolume