2018-11-26 21:44:00 +00:00
|
|
|
# Global Variables
|
|
|
|
before_script:
|
2019-03-12 16:30:57 +00:00
|
|
|
- "python3 -m pip install -U virtualenv"
|
|
|
|
- "virtualenv env"
|
|
|
|
- "source env/bin/activate"
|
|
|
|
- "pip3 install -U -r requirements-dev.txt"
|
2018-11-26 21:44:00 +00:00
|
|
|
stages:
|
2019-03-12 16:30:57 +00:00
|
|
|
- test
|
|
|
|
- build
|
|
|
|
- docs
|
|
|
|
- deploy
|
2019-02-21 15:50:36 +00:00
|
|
|
image: python:3.6
|
|
|
|
services:
|
2019-03-12 16:30:57 +00:00
|
|
|
- postgres:latest
|
2019-03-21 10:35:40 +00:00
|
|
|
- redis:latest
|
2019-02-21 15:50:36 +00:00
|
|
|
|
|
|
|
variables:
|
2019-03-12 16:30:57 +00:00
|
|
|
POSTGRES_DB: passbook
|
|
|
|
POSTGRES_USER: passbook
|
|
|
|
POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77"
|
2018-11-26 21:44:00 +00:00
|
|
|
|
2018-12-09 21:37:17 +00:00
|
|
|
include:
|
2019-03-12 16:30:57 +00:00
|
|
|
- /client-packages/allauth/.gitlab-ci.yml
|
2018-12-09 21:37:17 +00:00
|
|
|
|
2018-11-26 21:44:00 +00:00
|
|
|
isort:
|
2019-03-12 16:30:57 +00:00
|
|
|
script:
|
|
|
|
- isort -c -sg env
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
migrations:
|
2019-03-12 16:30:57 +00:00
|
|
|
script:
|
|
|
|
- python manage.py migrate
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
prospector:
|
2019-03-12 16:30:57 +00:00
|
|
|
script:
|
|
|
|
- prospector
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
pylint:
|
2019-03-12 16:30:57 +00:00
|
|
|
script:
|
|
|
|
- pylint passbook
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
coverage:
|
2019-03-12 16:30:57 +00:00
|
|
|
script:
|
2019-04-11 11:54:11 +00:00
|
|
|
- python manage.py collectstatic --no-input
|
2019-03-12 16:30:57 +00:00
|
|
|
- coverage run manage.py test
|
|
|
|
- coverage report
|
|
|
|
stage: test
|
2018-12-09 16:44:54 +00:00
|
|
|
bandit:
|
2019-03-12 16:30:57 +00:00
|
|
|
script:
|
|
|
|
- bandit -r passbook
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
|
2019-02-08 14:09:15 +00:00
|
|
|
package-docker:
|
2019-03-12 16:30:57 +00:00
|
|
|
image:
|
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
|
|
entrypoint: [""]
|
|
|
|
before_script:
|
|
|
|
- echo "{\"auths\":{\"docker.$NEXUS_URL\":{\"auth\":\"$NEXUS_AUTH\"}}}" > /kaniko/.docker/config.json
|
|
|
|
script:
|
2019-04-11 12:22:34 +00:00
|
|
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination docker.pkg.beryju.org/passbook:latest --destination docker.pkg.beryju.org/passbook:0.1.30-beta
|
2019-03-12 16:30:57 +00:00
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
2019-02-08 14:09:15 +00:00
|
|
|
package-helm:
|
2019-03-12 16:30:57 +00:00
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
|
|
|
|
- helm init --client-only
|
|
|
|
- helm package helm/passbook
|
|
|
|
- ./manage.py nexus_upload --method put --url $NEXUS_URL --auth $NEXUS_AUTH --repo helm *.tgz
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
2019-03-07 15:01:31 +00:00
|
|
|
package-debian:
|
2019-03-12 16:30:57 +00:00
|
|
|
before_script:
|
|
|
|
- apt update
|
|
|
|
- apt install -y --no-install-recommends build-essential debhelper devscripts equivs python3 python3-dev python3-pip libsasl2-dev libldap2-dev
|
|
|
|
- mk-build-deps debian/control
|
|
|
|
- apt install ./*build-deps*deb -f -y
|
|
|
|
- python3 -m pip install -U virtualenv pip
|
|
|
|
- virtualenv env
|
|
|
|
- source env/bin/activate
|
|
|
|
- pip3 install -U -r requirements.txt -r requirements-dev.txt
|
|
|
|
- ./manage.py collectstatic --no-input
|
|
|
|
image: ubuntu:18.04
|
|
|
|
script:
|
|
|
|
- debuild -us -uc
|
|
|
|
- cp ../passbook*.deb .
|
|
|
|
- ./manage.py nexus_upload --method post --url $NEXUS_URL --auth $NEXUS_AUTH --repo apt passbook*deb
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- passbook*deb
|
|
|
|
expire_in: 2 days
|
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
|
|
|
|
|
|
|
package-client-package-allauth:
|
|
|
|
script:
|
|
|
|
- cd client-packages/allauth
|
|
|
|
- python setup.py sdist
|
|
|
|
- twine upload --username $TWINE_USERNAME --password $TWINE_PASSWORD dist/*
|
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
|
|
|
changes:
|
|
|
|
- client-packages/allauth/**
|
|
|
|
|
|
|
|
package-client-package-sentry:
|
|
|
|
script:
|
|
|
|
- cd client-packages/sentry-auth-passbook
|
|
|
|
- python setup.py sdist
|
|
|
|
- twine upload --username $TWINE_USERNAME --password $TWINE_PASSWORD dist/*
|
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
|
|
|
changes:
|
|
|
|
- client-packages/sentry-auth-passbook/**
|
2018-11-26 21:44:00 +00:00
|
|
|
|
|
|
|
# docs:
|
|
|
|
# stage: docs
|
|
|
|
# only:
|
|
|
|
# - master
|
|
|
|
# - tags
|
|
|
|
# - /^debian/.*$/
|
|
|
|
# environment:
|
|
|
|
# name: docs
|
|
|
|
# url: "https://passbook.beryju.org/docs/"
|
|
|
|
# script:
|
|
|
|
# - apt update
|
|
|
|
# - apt install -y rsync
|
|
|
|
# - "mkdir ~/.ssh"
|
|
|
|
# - "cp .gitlab/known_hosts ~/.ssh/"
|
|
|
|
# - "pip3 install -U -r requirements-docs.txt"
|
|
|
|
# - "eval $(ssh-agent -s)"
|
|
|
|
# - "echo \"${CI_SSH_PRIVATE}\" | ssh-add -"
|
|
|
|
# - mkdocs build
|
|
|
|
# - 'rsync -avh --delete web/* "beryjuorg@ory1-web-prod-1.ory1.beryju.org:passbook.beryju.org/"'
|
|
|
|
# - 'rsync -avh --delete site/* "beryjuorg@ory1-web-prod-1.ory1.beryju.org:passbook.beryju.org/docs/"'
|
2019-03-10 16:08:33 +00:00
|
|
|
|
2019-03-11 08:47:06 +00:00
|
|
|
# deploy:
|
|
|
|
# environment:
|
|
|
|
# name: production
|
|
|
|
# url: https://passbook-prod.default.k8s.beryju.org/
|
|
|
|
# stage: deploy
|
|
|
|
# only:
|
|
|
|
# - tags
|
|
|
|
# - /^version/.*$/
|
|
|
|
# script:
|
|
|
|
# - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
|
|
|
|
# - helm init
|
|
|
|
# - helm upgrade passbook-prod helm/passbook --devel
|