aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml23
-rw-r--r--Pipfile3
-rw-r--r--docker/ci.Dockerfile20
3 files changed, 26 insertions, 20 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 47a08a02a..3d13ef5f1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,19 +1,4 @@
-image: python:3.6-alpine3.7
-
-variables:
- PIPENV_VENV_IN_PROJECT: 1
- PIPENV_IGNORE_VIRTUALENVS: 1
-
-
-before_script:
- - apk add --update tini
- - apk add --update build-base
- - apk add --update libffi-dev
- - apk add --update zlib
- - apk add --update jpeg-dev
- - apk add --update libxml2 libxml2-dev libxslt-dev
- - apk add --update zlib-dev
- - apk add --update freetype-dev
+image: pythondiscord/bot-ci:latest
stages:
- test
@@ -29,9 +14,8 @@ test:
- ".venv"
script:
- - pip install pipenv
- - pipenv sync --dev --three
- - pipenv run python -m flake8
+ - pipenv sync --dev
+ - pipenv run lint
build:
tags:
@@ -42,5 +26,4 @@ build:
stage: build
script:
- - apk add docker curl
- sh scripts/deploy.sh
diff --git a/Pipfile b/Pipfile
index e6d1366c6..9b0e530ec 100644
--- a/Pipfile
+++ b/Pipfile
@@ -39,7 +39,10 @@ python_version = "3.6"
[scripts]
start = "python -m bot"
+lint = "python -m flake8"
build = "docker build -t pythondiscord/bot:latest -f docker/Dockerfile ."
push = "docker push pythondiscord/bot:latest"
buildbase = "docker build -t pythondiscord/bot-base:latest -f docker/Dockerfile.base ."
pushbase = "docker push pythondiscord/bot-base:latest"
+buildci = "docker build -t pythondiscord/bot-ci:latest -f docker/ci.Dockerfile ."
+pushci = "docker push pythondiscord/bot-ci:latest"
diff --git a/docker/ci.Dockerfile b/docker/ci.Dockerfile
new file mode 100644
index 000000000..fd7e25239
--- /dev/null
+++ b/docker/ci.Dockerfile
@@ -0,0 +1,20 @@
+FROM python:3.6-alpine3.7
+
+RUN apk add --update docker \
+ curl \
+ tini \
+ build-base \
+ libffi-dev \
+ zlib \
+ jpeg-dev \
+ libxml2 libxml2-dev libxslt-dev \
+ zlib-dev \
+ freetype-dev
+
+RUN pip install pipenv
+
+ENV LIBRARY_PATH=/lib:/usr/lib
+ENV PIPENV_VENV_IN_PROJECT=1
+ENV PIPENV_IGNORE_VIRTUALENVS=1
+ENV PIPENV_NOSPIN=1
+ENV PIPENV_HIDE_EMOJIS=1