This repository has been archived by the owner on Dec 19, 2021. It is now read-only.
forked from rachmadaniHaryono/flask-reverse-proxy-fix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
99 lines (84 loc) · 2.18 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
# == Notes ==
# - GitLab automatically passes artifacts from previous stages by default
# - Set required secret variables at: https://gitlab.data.bas.ac.uk/web-apps/flask-extensions/flask-reverse-proxy/settings/ci_cd
# = Secret variables
# - Variables are grouped by section in KEY: "value" format (e.g. FOO: "bar")
# Sensitive values are represented by "[Sensitive]"
#
# - Snyk
# > SNYK_TOKEN: "[Sensitive]"
#
# - PyPi (production)
# > PYPI_PASSWORD: "[Sensitive]"
#
# - PyPi (staging)
# > PYPI_TEST_PASSWORD: "[Sensitive]"
# == Global settings ==
stages:
- test
- lint
- build
- publish
variables:
APP_NAME: flask-middleware-reverse-proxy
SNYK_ORG: antarctica
SNYK_PROJECT: flask-middleware-reverse-proxy
PYPI_USERNAME: british-antarctic-survey
PYPI_TEST_USERNAME: british-antarctic-survey
image:
name: docker-registry.data.bas.ac.uk/web-apps/flask-extensions/flask-reverse-proxy:0.1.0-alpine
entrypoint: [""]
# == Jobs ==
test-app:
stage: test
variables:
FLASK_ENV: testing
script:
- "flask test"
dependencies-app:
stage: lint
image:
name: antarctica/snyk-cli:python-3
entrypoint: [""]
script:
- "pip install -r requirements.txt"
- "snyk test"
- "snyk monitor --project-name=$SNYK_PROJECT --org=$SNYK_ORG"
only:
- master
pep8-app:
stage: lint
script:
- "flake8 . --ignore=E501"
bandit-app:
stage: lint
script:
- "bandit -r ."
build-app:
stage: build
script:
- "python setup.py sdist bdist_wheel"
artifacts:
name: "$CI_BUILD_TOKEN-build"
paths:
- dist
expire_in: 1 month
publish-app-stage:
stage: publish
script:
- "python -m twine upload --repository-url https://test.pypi.org/legacy/ --username $PYPI_TEST_USERNAME --password $PYPI_TEST_PASSWORD --disable-progress-bar --verbose dist/*"
only:
- master
environment:
name: staging
url: https://test.pypi.org/project/flask-reverse-proxy-fix/
publish-app-prod:
stage: publish
script:
- "python -m twine upload --username $PYPI_USERNAME --password $PYPI_PASSWORD --disable-progress-bar --verbose dist/*"
only:
- tags
environment:
name: production
url: https://pypi.org/project/flask-reverse-proxy-fix/