This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
53 lines (51 loc) · 1.95 KB
/
ci-k8s.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
name: Test k8scc on Kubernetes
on: [push, pull_request]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --tag k8scc:latest
- name: Setup kind
uses: engineerd/[email protected]
with:
version: "v0.11.1"
- name: Show Clusterinfo
run: |
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
- name: Create PersistentVolumes
run: kubectl create -f ci/pv.yaml
- name: Import k8scc image into kind
run: kind load docker-image k8scc:latest
- name: Install Hyperledger Fabric binaries
run: |
wget -q https://github.com/hyperledger/fabric/releases/download/v2.2.1/hyperledger-fabric-linux-amd64-2.2.1.tar.gz
tar -xvf hyperledger-fabric-linux-amd64-2.2.1.tar.gz bin/
- name: Deploy network
working-directory: ./example/demo/
timeout-minutes: 3
run: |
export PATH="$GITHUB_WORKSPACE/bin:$PATH"
./network.sh up -o kind
- name: Install and run chaincode
timeout-minutes: 5
run: |
sleep 40 # wait until the peers become available. TODO: better implementation
kubectl exec -i $(kubectl get pod -l app=cli.peer0.org1.example.com -o jsonpath="{.items[0].metadata.name}") -- bash -x -e -c "$(cat ci/cli1.sh)"
kubectl exec -i $(kubectl get pod -l app=cli.peer0.org2.example.com -o jsonpath="{.items[0].metadata.name}") -- bash -x -e -c "$(cat ci/cli2.sh)"
- name: Show Kubernetes resources
run: |
kubectl get pods -o wide
kubectl get configmaps -o wide
kubectl get pvc -o wide
if: ${{ always() }}
- name: Describe Pods and Nodes on failure
run: |
kubectl describe pods
kubectl -n kube-system describe pods
kubectl describe nodes
if: ${{ failure() }}