Only use just
during development
This makes the CI tasks more verbose, but makes the whole setup much easier to manage
This commit is contained in:
parent
e2d5101a56
commit
c66acadd43
2 changed files with 18 additions and 24 deletions
|
@ -40,28 +40,14 @@ pip:
|
||||||
- ./env/
|
- ./env/
|
||||||
expire_in: 30 mins
|
expire_in: 30 mins
|
||||||
|
|
||||||
just:
|
|
||||||
stage: build
|
|
||||||
before_script:
|
|
||||||
- apt-get update && apt-get install -y curl
|
|
||||||
script:
|
|
||||||
- curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to $CI_PROJECT_DIR/.just-bin
|
|
||||||
artifacts:
|
|
||||||
name: 'pip-$CI_JOB_ID'
|
|
||||||
paths:
|
|
||||||
- $CI_PROJECT_DIR/.just-bin
|
|
||||||
expire_in: 30 mins
|
|
||||||
|
|
||||||
.python_test_template: &python_test_template
|
.python_test_template: &python_test_template
|
||||||
stage: test
|
stage: test
|
||||||
dependencies:
|
dependencies:
|
||||||
- pip
|
- pip
|
||||||
- collect_static
|
- collect_static
|
||||||
- static
|
- static
|
||||||
- just
|
|
||||||
before_script:
|
before_script:
|
||||||
- source env/bin/activate
|
- source env/bin/activate
|
||||||
- mv $CI_PROJECT_DIR/.just-bin/just /usr/local/bin/just
|
|
||||||
variables:
|
variables:
|
||||||
SECRET_KEY: super-secret
|
SECRET_KEY: super-secret
|
||||||
|
|
||||||
|
@ -71,11 +57,9 @@ collect_static:
|
||||||
dependencies:
|
dependencies:
|
||||||
- pip
|
- pip
|
||||||
- static
|
- static
|
||||||
- just
|
|
||||||
needs:
|
needs:
|
||||||
- pip
|
- pip
|
||||||
- static
|
- static
|
||||||
- just
|
|
||||||
script:
|
script:
|
||||||
- ./manage.py collectstatic --noinput -v2 --clear
|
- ./manage.py collectstatic --noinput -v2 --clear
|
||||||
artifacts:
|
artifacts:
|
||||||
|
@ -97,7 +81,22 @@ django_checks:
|
||||||
- ./manage.py check
|
- ./manage.py check
|
||||||
- ./manage.py makemigrations --check --noinput
|
- ./manage.py makemigrations --check --noinput
|
||||||
|
|
||||||
python_lint:
|
black:
|
||||||
<<: *python_test_template
|
<<: *python_test_template
|
||||||
script:
|
script:
|
||||||
- just lint
|
- black --check website
|
||||||
|
|
||||||
|
isort:
|
||||||
|
<<: *python_test_template
|
||||||
|
script:
|
||||||
|
- isort --check website
|
||||||
|
|
||||||
|
flake8:
|
||||||
|
<<: *python_test_template
|
||||||
|
script:
|
||||||
|
- flake8 website
|
||||||
|
|
||||||
|
mypy:
|
||||||
|
<<: *python_test_template
|
||||||
|
script:
|
||||||
|
- mypy website
|
||||||
|
|
|
@ -11,9 +11,4 @@ This project handles commands using [`just`](https://github.com/casey/just).
|
||||||
|
|
||||||
### `.env` file
|
### `.env` file
|
||||||
|
|
||||||
Local development secrets are stored in a `.env` file.
|
Local development secrets are stored in a `.env` file. This file is automatically loaded by `just`.
|
||||||
|
|
||||||
These values are required for the application to load
|
|
||||||
|
|
||||||
- `DEBUG` set to `false`
|
|
||||||
- `SECRET_KEY` set to [something](https://django-secret-key-generator.netlify.app/) semi-random
|
|
||||||
|
|
Loading…
Reference in a new issue