2018-11-26 21:44:00 +00:00
|
|
|
# Global Variables
|
|
|
|
stages:
|
2019-04-18 08:15:44 +00:00
|
|
|
- build-buildimage
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
- docs
|
|
|
|
- deploy
|
2019-04-29 15:05:39 +00:00
|
|
|
image: docker.beryju.org/passbook/build-base:latest
|
2019-02-21 15:50:36 +00:00
|
|
|
services:
|
2019-04-18 08:15:44 +00:00
|
|
|
- postgres:latest
|
|
|
|
- redis:latest
|
2019-02-21 15:50:36 +00:00
|
|
|
|
|
|
|
variables:
|
2019-04-18 08:15:44 +00:00
|
|
|
POSTGRES_DB: passbook
|
|
|
|
POSTGRES_USER: passbook
|
|
|
|
POSTGRES_PASSWORD: "EK-5jnKfjrGRm<77"
|
2018-11-26 21:44:00 +00:00
|
|
|
|
2019-04-18 08:15:44 +00:00
|
|
|
create-build-image:
|
|
|
|
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-29 17:22:20 +00:00
|
|
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.build-base --destination docker.beryju.org/passbook/build-base:latest --destination docker.beryju.org/passbook/build-base:0.1.34-beta
|
2019-04-18 08:15:44 +00:00
|
|
|
stage: build-buildimage
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
2018-12-09 21:37:17 +00:00
|
|
|
|
2018-11-26 21:44:00 +00:00
|
|
|
isort:
|
2019-04-18 08:15:44 +00:00
|
|
|
script:
|
|
|
|
- isort -c -sg env
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
migrations:
|
2019-04-18 08:15:44 +00:00
|
|
|
script:
|
|
|
|
- python manage.py migrate
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
prospector:
|
2019-04-18 08:15:44 +00:00
|
|
|
script:
|
|
|
|
- prospector
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
pylint:
|
2019-04-18 08:15:44 +00:00
|
|
|
script:
|
|
|
|
- pylint passbook
|
|
|
|
stage: test
|
2018-11-26 21:44:00 +00:00
|
|
|
coverage:
|
2019-04-18 08:15:44 +00:00
|
|
|
script:
|
|
|
|
- python manage.py collectstatic --no-input
|
|
|
|
- coverage run manage.py test
|
|
|
|
- coverage report
|
|
|
|
stage: test
|
2018-12-09 16:44:54 +00:00
|
|
|
bandit:
|
2019-04-18 08:15:44 +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-04-18 08:15:44 +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-29 17:22:20 +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.1.34-beta
|
2019-04-18 08:15:44 +00:00
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
2019-02-08 14:09:15 +00:00
|
|
|
package-helm:
|
2019-04-18 08:15:44 +00:00
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
|
|
|
|
- helm init --client-only
|
|
|
|
- helm package helm/passbook
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-04-29 15:05:39 +00:00
|
|
|
- passbook-*.tgz
|
2019-04-18 08:15:44 +00:00
|
|
|
expire_in: 2 days
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
- /^version/.*$/
|
2019-03-12 16:30:57 +00:00
|
|
|
|
|
|
|
package-client-package-allauth:
|
2019-04-18 08:15:44 +00:00
|
|
|
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/**
|
2019-03-12 16:30:57 +00:00
|
|
|
|
|
|
|
package-client-package-sentry:
|
2019-04-18 08:15:44 +00:00
|
|
|
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/**
|