Configure CI

This commit is contained in:
Mehran Kholdi 2020-04-23 18:18:27 +04:30
parent 6f23dbe067
commit 18abfa1ec4
3 changed files with 29 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
.git/
Dockerfile
deploy/

13
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,13 @@
build:
stage: build
image: docker:stable
variables:
IMAGE_REPO: hamravesh/rawfile-csi
script:
- mkdir -p ~/.docker/; echo $DOCKER_AUTH_CONFIG >~/.docker/config.json
- export IMAGE="$REGISTRY/$IMAGE_REPO"
- docker build -t $IMAGE:$CI_COMMIT_SHORT_SHA -t $IMAGE:$CI_COMMIT_REF_SLUG .
- docker push $IMAGE:$CI_COMMIT_SHORT_SHA
- docker push $IMAGE:$CI_COMMIT_REF_SLUG
tags:
- docker

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM python:3-alpine3.11
WORKDIR /app/
ENV PIP_NO_CACHE_DIR 1
ADD ./requirements.txt ./
RUN apk add --no-cache gcc linux-headers make musl-dev python-dev g++
RUN pip install -r ./requirements.txt
ADD ./ ./
ENTRYPOINT ["/usr/bin/env", "python3", "/app/rawfile.py"]
CMD ["csi-driver"]