Skip to content

Commit

Permalink
(fix): Export variables from entrypoint.sh and multiple chaos action …
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
uditgaurav authored May 17, 2020
1 parent a479b53 commit c398509
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ LABEL com.github.actions.description="Different Chaos Experiment for Kubernetes"
LABEL com.github.actions.icon="terminal"
LABEL com.github.actions.color="blue"

ENV GOPATH=/github/home/go
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

ARG KUBECTL_VERSION=1.17.0
ADD https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl /usr/local/bin/kubectl
RUN chmod +x /usr/local/bin/kubectl
Expand All @@ -18,9 +21,6 @@ RUN apt-get update && apt-get install -y git && \
apt-get install -y ssh && \
apt install ssh rsync

RUN export GOPATH=$HOME/go
RUN export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

COPY README.md /
COPY entrypoint.sh /entrypoint.sh
COPY experiments ./experiments
Expand Down
9 changes: 6 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ export KUBECONFIG=${HOME}/.kube/config

##Setup
mkdir -p $HOME/go/src/github.com/mayadata-io
rsync -az --delete ${GOPATH}/src/github.com/mayadata-io/
cd ${GOPATH}/src/github.com/mayadata-io/
dir=${GOPATH}/src/github.com/mayadata-io/chaos-ci-lib
if [ ! -d $dir ]
then
git clone https://github.com/mayadata-io/chaos-ci-lib.git
fi
cd chaos-ci-lib

##Install litmus if it is not already installed
if [ $INSTALL_LITMUS = true ]
if [ "$INSTALL_LITMUS" = "true" ]
then
go test tests/install-litmus_test.go -v -count=1
fi
Expand All @@ -24,7 +27,7 @@ fi
go test tests/${EXPERIMENT_NAME}_test.go -v -count=1

##litmus cleanup
if [ $LITMUS_CLEANUP = true ]
if [ "$LITMUS_CLEANUP" = "true" ]
then
go test tests/uninstall-litmus_test.go -v -count=1
fi
2 changes: 1 addition & 1 deletion experiments/pod-network-latency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
TARGET_CONTAINER: nginx
TOTAL_CHAOS_DURATION: 60
NETWORK_INTERFACE: eth0
NETWORK_LATENCY: 60000
NETWORK_LATENCY: 60000
##Select true if you want to uninstall litmus after chaos
LITMUS_CLEANUP: true
```
Expand Down

0 comments on commit c398509

Please sign in to comment.