aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml30
-rw-r--r--gitlab-ci.yml40
-rw-r--r--scripts/deploy.sh2
3 files changed, 41 insertions, 31 deletions
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 4d70f870e..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-language: python
-python:
- - "3.6"
-
-branches:
- only:
- - "master"
-
-sudo: required
-
-services:
- - docker
-
-env:
- global:
- - PIPENV_VENV_IN_PROJECT=1
- - PIPENV_IGNORE_VIRTUALENVS=1
-
-install:
- - pip install pipenv
- - pipenv sync --dev --three
-script:
- - pipenv run python -m flake8
-after_success:
- - bash scripts/deploy.sh
-
-cache: pip
-
-notifications:
- email: false
diff --git a/gitlab-ci.yml b/gitlab-ci.yml
new file mode 100644
index 000000000..0b7ffbc56
--- /dev/null
+++ b/gitlab-ci.yml
@@ -0,0 +1,40 @@
+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
+
+stages:
+ - test
+ - build
+
+test:
+ stage: test
+ cache:
+ paths:
+ - ".venv"
+
+ script:
+ - pip install pipenv
+ - pipenv sync --dev --three
+ - pipenv run python -m flake8
+
+build:
+ services:
+ - docker:dind
+
+ stage: build
+ script:
+ - apk add docker curl
+ - sh scripts/deploy.sh
diff --git a/scripts/deploy.sh b/scripts/deploy.sh
index d8a5a0176..50ec87f59 100644
--- a/scripts/deploy.sh
+++ b/scripts/deploy.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Build and deploy on master branch
-if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
+if [[ $CI_COMMIT_REF_SLUG == 'master' ]]; then
echo "Connecting to docker hub"
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin