-
Notifications
You must be signed in to change notification settings - Fork 715
60 lines (57 loc) · 2.14 KB
/
test_networkschema.yml
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
52
53
54
55
56
57
58
59
60
##############################################################################################
# Copyright Accenture. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
##############################################################################################
name: Test Network.yaml samples
on:
pull_request:
branches: [ develop ]
types: [opened, edited, synchronize, reopened]
jobs:
sample-nets-schema-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
# install npm and ajv-cli
sudo apt-get update
sudo apt-get install npm
npm install -g ajv-cli
# export the bin path
export PATH=~/bin:$PATH
##########################################################################
- name: Test sample networks
run: |
WDIR=`pwd`
for PLATFORM in hyperledger-fabric \
hyperledger-besu \
hyperledger-indy \
r3-corda \
r3-corda-ent \
quorum \
substrate
do
echo "**********************************"
echo Validating ${PLATFORM}
echo "**********************************"
cd ${WDIR}/platforms/${PLATFORM}/configuration/samples
sed -i 's/aws_access_key/aaaaaaaaaaaaaaaaaaaa/g' *.yaml
sed -i 's/aws_secret_key/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/g' *.yaml
sed -i 's/vault_root_token/s.aaaaaaaaaaaaaaaaaaaaaaaa/g' *.yaml
sed -i 's/git_email/user@email\.com/g' *.yaml
sed -i 's/github_email/user@email\.com/g' *.yaml
sed -i 's/chaincode_version/00001/g' *.yaml
sed -i 's/<MINIKUBE_IP_ADDRESS>/0.0.0.1/g' *.yaml
sed -i 's/<YOUR DOCKER USERNAME>/dockeruser/g' *.yaml
for SAMPLE in *.yaml
do
echo Validating ${SAMPLE}
ajv validate -s ../../../network-schema.json -d ${SAMPLE}
done
done