Skip to content

Commit c398509

Browse files
authored
(fix): Export variables from entrypoint.sh and multiple chaos action support in a single github job (#2)
* (fix): Export variables from entrypoint.sh file Signed-off-by: Udit Gaurav <[email protected]> * Add support for multiple experiments in single github job Signed-off-by: Udit Gaurav <[email protected]>
1 parent a479b53 commit c398509

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ LABEL com.github.actions.description="Different Chaos Experiment for Kubernetes"
1010
LABEL com.github.actions.icon="terminal"
1111
LABEL com.github.actions.color="blue"
1212

13+
ENV GOPATH=/github/home/go
14+
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
15+
1316
ARG KUBECTL_VERSION=1.17.0
1417
ADD https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl /usr/local/bin/kubectl
1518
RUN chmod +x /usr/local/bin/kubectl
@@ -18,9 +21,6 @@ RUN apt-get update && apt-get install -y git && \
1821
apt-get install -y ssh && \
1922
apt install ssh rsync
2023

21-
RUN export GOPATH=$HOME/go
22-
RUN export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
23-
2424
COPY README.md /
2525
COPY entrypoint.sh /entrypoint.sh
2626
COPY experiments ./experiments

entrypoint.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ export KUBECONFIG=${HOME}/.kube/config
99

1010
##Setup
1111
mkdir -p $HOME/go/src/github.com/mayadata-io
12-
rsync -az --delete ${GOPATH}/src/github.com/mayadata-io/
1312
cd ${GOPATH}/src/github.com/mayadata-io/
13+
dir=${GOPATH}/src/github.com/mayadata-io/chaos-ci-lib
14+
if [ ! -d $dir ]
15+
then
1416
git clone https://github.com/mayadata-io/chaos-ci-lib.git
17+
fi
1518
cd chaos-ci-lib
1619

1720
##Install litmus if it is not already installed
18-
if [ $INSTALL_LITMUS = true ]
21+
if [ "$INSTALL_LITMUS" = "true" ]
1922
then
2023
go test tests/install-litmus_test.go -v -count=1
2124
fi
@@ -24,7 +27,7 @@ fi
2427
go test tests/${EXPERIMENT_NAME}_test.go -v -count=1
2528

2629
##litmus cleanup
27-
if [ $LITMUS_CLEANUP = true ]
30+
if [ "$LITMUS_CLEANUP" = "true" ]
2831
then
2932
go test tests/uninstall-litmus_test.go -v -count=1
3033
fi

experiments/pod-network-latency/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
TARGET_CONTAINER: nginx
4040
TOTAL_CHAOS_DURATION: 60
4141
NETWORK_INTERFACE: eth0
42-
NETWORK_LATENCY: 60000
42+
NETWORK_LATENCY: 60000
4343
##Select true if you want to uninstall litmus after chaos
4444
LITMUS_CLEANUP: true
4545
```

0 commit comments

Comments
 (0)