# Global Variables before_script: - "python3 -m pip install -U virtualenv" - "virtualenv env" - "source env/bin/activate" - "pip3 install -U -r requirements-dev.txt" stages: - test - build - docs image: python:3.6 services: - postgres:latest variables: POSTGRES_DB: passbook POSTGRES_USER: passbook POSTGRES_PASSWORD: 'EK-5jnKfjrGRm<77' include: - /allauth/.gitlab-ci.yml isort: script: - isort -c -sg env stage: test migrations: script: - python manage.py migrate stage: test prospector: script: - prospector stage: test pylint: script: - pylint passbook stage: test coverage: script: - coverage run manage.py test - coverage report stage: test bandit: script: - bandit -r passbook stage: test package-docker: image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] before_script: - echo "{\"auths\":{\"docker.$NEXUS_URL\":{\"auth\":\"$NEXUS_AUTH\"}}}" > /kaniko/.docker/config.json script: - /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.3-beta stage: build only: - tags - /^version/.*$/ package-helm: 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/.*$/ package-debian: before_script: - apt update - apt install -y --no-install-recommends build-essential debhelper devscripts equivs python3 python3-dev python3-venv 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 - python3 -m venv env - source env/bin/activate - pip install -U -r requirements-dev.txt - pip install --no-binary psycopg2 psycopg2 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/.*$/ # 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/"'