Add ci pipeline with GitLab ()

* Add automated testing
* Create loop device while staging s3backer
This commit is contained in:
Cyrill Troxler 2018-08-03 20:30:46 +02:00 committed by GitHub
parent f603d84fc5
commit 9291d09baa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 4 deletions

View file

@ -4,17 +4,25 @@ LABEL description="csi-s3 testing image"
RUN apt-get update && \
apt-get install -y \
git wget && \
git wget make && \
rm -rf /var/lib/apt/lists/*
RUN wget -q https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz && \
tar -xf go1.10.3.linux-amd64.tar.gz && \
rm go1.10.3.linux-amd64.tar.gz && \
mv go /usr/local
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
# install dep
RUN wget -q https://raw.githubusercontent.com/golang/dep/master/install.sh && \
mkdir -p /go/bin && \
sh ./install.sh
RUN go get -u github.com/minio/minio && go install github.com/minio/minio/cmd
ENTRYPOINT ["/go/src/github.com/ctrox/csi-s3/test/test.sh"]
ADD test/test.sh /usr/local/bin
ENTRYPOINT ["/usr/local/bin/test.sh"]

View file

@ -3,6 +3,8 @@ export MINIO_ACCESS_KEY=FJDSJ
export MINIO_SECRET_KEY=DSG643HGDS
mkdir -p /tmp/minio
minio server --quiet /tmp/minio &
minio server --quiet /tmp/minio &>/dev/null &
sleep 5
cd $GOPATH/src/github.com/ctrox/csi-s3
if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi
go test github.com/ctrox/csi-s3/pkg/s3 -cover