aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-09-03 21:46:38 +0200
committerGravatar Johannes Christ <[email protected]>2018-09-03 21:46:38 +0200
commit087a667f7de43b87d672ef7e0b2d235295431cdd (patch)
tree27ef17764c3f32b01e8b8391962060cbe253e8a2 /.gitlab-ci.yml
parentLinewrap import. (diff)
Try using local registry.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml26
1 files changed, 20 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c6eaac3d..e9b56759 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,9 @@ stages:
- lint
- test
- deploy
+ - cleanup
+services:
+ - registry
cache:
paths:
@@ -11,11 +14,11 @@ cache:
variables:
PIPENV_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
-build base image:
+build docker image:
image: docker:stable-git
stage: build
script:
- - sh scripts/deploy-ci.sh
+ - docker build -t registry:5000/django-ci .
tags:
- docker
only:
@@ -23,20 +26,20 @@ build base image:
- django
lint:
- image: registry.gitlab.com/python-discord/projects/site/django-base:latest
+ image: registry:5000/django-ci
stage: lint
script:
- pipenv install --dev --system
- flake8
test:
- image: registry.gitlab.com/python-discord/projects/site/django-base:latest
+ image: registry:5000/django-ci
stage: test
services:
- postgres:10-alpine
before_script:
+ - pipenv install --dev --system
- python manage.py migrate
- - pip install coverage
script:
- coverage run --source=api,home,pysite,wiki --branch manage.py test
after_script:
@@ -52,7 +55,6 @@ test:
pages:
stage: deploy
- image:
dependencies:
- test
before_script:
@@ -63,3 +65,15 @@ pages:
paths:
- public
expire_in: 30 days
+
+upload newest docker image:
+ image: docker:stable-git
+ stage: deploy
+ script:
+ - echo "$GITLAB_DOCKER_PASSWORD" | docker login --username "$GITLAB_DOCKER_USERNAME" --password-stdin registry.gitlab.com
+ - docker pull registry:5000/django-ci
+ - docker image tag registry.gitlab.com/python-discord/projects/site/django:latest registry:5000/django-ci
+ - docker push registry.gitlab.com/python-discord/projects/site/django:latest
+ only:
+ - master
+ - django