This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/.gitlab-ci.yml

133 lines
3.5 KiB
YAML
Raw Normal View History

2018-11-26 21:44:00 +00:00
# Global Variables
stages:
- build-base-image
- build-dev-image
- test
- build
- package
image: docker.beryju.org/passbook/dev:latest
2019-02-21 15:50:36 +00:00
variables:
POSTGRES_DB: passbook
POSTGRES_USER: passbook
POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77"
2018-11-26 21:44:00 +00:00
before_script:
# Ensure all dependencies are installed, even those not included in passbook/dev
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
create-base-image:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"docker.beryju.org\":{\"auth\":\"$DOCKER_AUTH\"}}}" > /kaniko/.docker/config.json
script:
2019-07-22 13:54:34 +00:00
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.base --destination docker.beryju.org/passbook/base:latest --destination docker.beryju.org/passbook/base:0.2.7-beta
stage: build-base-image
only:
refs:
- tags
- /^version/.*$/
build-dev-image:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"docker.beryju.org\":{\"auth\":\"$DOCKER_AUTH\"}}}" > /kaniko/.docker/config.json
script:
2019-07-22 13:54:34 +00:00
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.dev --destination docker.beryju.org/passbook/dev:latest --destination docker.beryju.org/passbook/dev:0.2.7-beta
stage: build-dev-image
only:
refs:
- tags
- /^version/.*$/
2018-12-09 21:37:17 +00:00
2018-11-26 21:44:00 +00:00
isort:
script:
- isort -c -sg env
stage: test
services:
- postgres:latest
- redis:latest
2018-11-26 21:44:00 +00:00
migrations:
script:
- python manage.py migrate
stage: test
services:
- postgres:latest
- redis:latest
2018-11-26 21:44:00 +00:00
prospector:
script:
- prospector
stage: test
services:
- postgres:latest
- redis:latest
2018-11-26 21:44:00 +00:00
pylint:
script:
2019-07-22 13:35:11 +00:00
- pylint passbook
stage: test
services:
- postgres:latest
- redis:latest
2018-11-26 21:44:00 +00:00
coverage:
script:
- coverage run manage.py test
- coverage report
- coverage html
stage: test
services:
- postgres:latest
- redis:latest
2018-11-26 21:44:00 +00:00
package-passbook-server:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"docker.beryju.org\":{\"auth\":\"$DOCKER_AUTH\"}}}" > /kaniko/.docker/config.json
script:
2019-07-22 13:54:34 +00:00
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination docker.beryju.org/passbook/server:latest --destination docker.beryju.org/passbook/server:0.2.7-beta
stage: build
only:
- tags
- /^version/.*$/
build-passbook-static:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"docker.beryju.org\":{\"auth\":\"$DOCKER_AUTH\"}}}" > /kaniko/.docker/config.json
script:
2019-07-22 13:54:34 +00:00
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.static --destination docker.beryju.org/passbook/static:latest --destination docker.beryju.org/passbook/static:0.2.7-beta
only:
- tags
- /^version/.*$/
# running collectstatic fully initialises django, hence we need that databases
services:
- postgres:latest
- redis:latest
package-helm:
image: debian:stretch-slim
stage: package
before_script:
- apt update && apt install -y curl
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
script:
- helm init --client-only
- helm dependency build helm/passbook
- helm package helm/passbook
artifacts:
paths:
- passbook-*.tgz
expire_in: 1 week
only:
- tags
- /^version/.*$/