aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-09-18 00:07:43 +0200
committerGravatar Johannes Christ <[email protected]>2018-09-18 00:10:37 +0200
commitedc3713678623a0ee934ceb51ff992275bb707fd (patch)
treeeb48ecb9e9f289151e1b997c1503a3d08b944fa9 /.gitlab-ci.yml
parentPass down postgres IP. (diff)
Build and push images to CI.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml60
1 files changed, 39 insertions, 21 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c4e615be..cdea2ca1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,7 +4,9 @@ stages:
- test
- publish
- deploy
-image: python:3.7-alpine
+variables:
+ BASE_IMAGE_URL: registry.gitlab.com/python-discord/projects/site/django-ci
+
.test-template: &test-template
stage: test
@@ -23,42 +25,58 @@ image: python:3.7-alpine
build-alpine-3.7:
stage: build
image: docker:dind
+ before_script:
+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- - docker build --build-arg EXTRAS=test,lint -t django:alpine-3.7 -f docker/app/alpine/3.7/Dockerfile .
- - docker save django:alpine-3.7 > django_alpine_py37.tar.gz
- artifacts:
- paths:
- - django_alpine_py37.tar.gz
+ - >
+ docker build
+ --build-arg EXTRAS=test,lint
+ -t $BASE_IMAGE_URL:alpine-3.7-$CI_COMMIT_REF_SLUG
+ -f docker/app/alpine/3.7/Dockerfile
+ .
+ - docker push $BASE_IMAGE_URL:alpine-3.7-$CI_COMMIT_REF_SLUG
build-alpine-3.6:
stage: build
image: docker:dind
+ before_script:
+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- - docker build --build-arg EXTRAS=test -t django:alpine-3.6 -f docker/app/alpine/3.6/Dockerfile .
- - docker save django:alpine-3.6 > django_alpine_py36.tar.gz
- artifacts:
- paths:
- - django_alpine_py36.tar.gz
+ - >
+ docker build
+ --build-arg EXTRAS=test,lint
+ -t $BASE_IMAGE_URL:alpine-3.6-$CI_COMMIT_REF_SLUG
+ -f docker/app/alpine/3.6/Dockerfile
+ .
+ - docker push $BASE_IMAGE_URL:alpine-3.6-$CI_COMMIT_REF_SLUG
build-stretch-3.7:
stage: build
image: docker:dind
+ before_script:
+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- - docker build --build-arg EXTRAS=test -t django:stretch-3.7 -f docker/app/stretch/3.7/Dockerfile .
- - docker save django:stretch-3.7 > django_stretch_py37.tar.gz
- artifacts:
- paths:
- - django_stretch_py37.tar.gz
+ - >
+ docker build
+ --build-arg EXTRAS=test,lint
+ -t $BASE_IMAGE_URL:stretch-3.7-$CI_COMMIT_REF_SLUG
+ -f docker/app/stretch/3.7/Dockerfile
+ .
+ - docker push $BASE_IMAGE_URL:stretch-3.7-$CI_COMMIT_REF_SLUg
build-stretch-3.6:
stage: build
image: docker:dind
+ before_script:
+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- - docker build --build-arg EXTRAS=test -t django:stretch-3.6 -f docker/app/stretch/3.6/Dockerfile .
- - docker save django:stretch-3.6 > django_stretch_py36.tar.gz
- artifacts:
- paths:
- - django_stretch_py36.tar.gz
+ - >
+ docker build
+ --build-arg EXTRAS=test,lint
+ -t $BASE_IMAGE_URL:stretch-3.6-$CI_COMMIT_REF_SLUG
+ -f docker/app/stretch/3.6/Dockerfile
+ .
+ - docker push $BASE_IMAGE_URL:stretch-3.6-$CI_COMMIT_REF_SLUg
lint:
stage: lint