Skip to content

Commit

Permalink
Merge pull request #93 from City-of-Helsinki/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
Pekka Lampila authored Oct 31, 2023
2 parents 5f31726 + 1807400 commit 9d07eab
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 152 deletions.
33 changes: 22 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ stages:
- deploy

variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
IMAGE_RELEASE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID
IMAGE_TEST_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID-test
CACHE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-cache
#CACHE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
APP_IMG_VER: $CI_COMMIT_SHORT_SHA

workflow:
Expand All @@ -32,33 +37,39 @@ workflow:
## Common CI/CD targets used with extends keyword
.build_image_base:
stage: build
image: docker:20.10.6
image: docker:20.10.16
services:
- docker:20.10.6-dind
- docker:20.10.16-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-$CI_PIPELINE_ID
CACHE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-cache
CACHE_TAG: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}-cache
before_script:
- set -x
- env
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN mcr.gitlab.montel.fi
script:
# defaults: --build-arg REQUIREMENTS=requirements_prod.txt
- 'eval docker pull $CACHE_TAG || true'
- 'eval docker build --build-arg APP_IMG_VER=$APP_IMG_VER $BUILD_EXTRA_ARGS --cache-from $CACHE_TAG --tag $IMAGE_TAG --tag $CACHE_TAG .'
- 'eval docker push $IMAGE_TAG'
- 'eval docker push $CACHE_TAG'
#- 'eval docker pull $CACHE_TAG || true'
- >
docker build
--network host
--build-arg APP_IMG_VER=$APP_IMG_VER $BUILD_EXTRA_ARGS
--cache-from $CACHE_TAG
--tag $IMAGE_TAG
--tag $CACHE_TAG .
- docker push $IMAGE_TAG
- docker push $CACHE_TAG


.test_image_base:
stage: test
image: docker:20.10.6
image: docker:20.10.16
services:
- docker:20.10.6-dind
- docker:20.10.16-dind
before_script:
- set -x
- env
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN mcr.gitlab.montel.fi
- apk add docker-compose
script:
- 'eval export TEST_IMG=$IMAGE_TEST_TAG'
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================
FROM helsinkitest/python:3.8-slim as appbase
FROM helsinkitest/python:3.9-slim as appbase
# ==============================
RUN mkdir /entrypoint

Expand All @@ -9,7 +9,7 @@ COPY --chown=appuser:appuser requirements-prod.txt /app/requirements-prod.txt
RUN apt-install.sh \
build-essential \
libpq-dev \
netcat \
netcat-traditional \
gdal-bin \
python3-gdal \
&& pip install -U pip \
Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Prerequisites:

Prerequisites:
* PostgreSQL 11
* Python 3.8
* Python 3.9


### Installing Python requirements
Expand Down Expand Up @@ -112,12 +112,4 @@ commit.
## Running tests

* Set the `DEBUG` environment variable to `1`.
* Run `pytest`.

## Demo frontend
Navigate to frontend folder.

To install `node_modules` run `yarn install`.
Create `.env` file, use `.env.example` as a base.

After installation is completed run application with `yarn start`. Application is now running and can be found at `localhost:3000`.
* Run `pytest`.
160 changes: 85 additions & 75 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,166 +1,176 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile requirements-dev.in
#
appdirs==1.4.4
# via black
asgiref==3.3.4
asgiref==3.7.2
# via
# -c requirements.txt
# django
attrs==21.1.0
asttokens==2.4.1
# via stack-data
attrs==23.1.0
# via
# -c requirements.txt
# flake8-bugbear
# pytest
autoflake==1.4
autoflake==2.2.1
# via -r requirements-dev.in
backcall==0.2.0
# via ipython
black==21.5b0
black==23.10.1
# via -r requirements-dev.in
certifi==2020.12.5
certifi==2023.7.22
# via
# -c requirements.txt
# requests
chardet==4.0.0
charset-normalizer==3.3.1
# via
# -c requirements.txt
# requests
click==7.1.2
click==8.1.7
# via
# -c requirements.txt
# black
coverage==5.5
# via pytest-cov
decorator==5.0.7
coverage[toml]==7.3.2
# via
# coverage
# pytest-cov
decorator==5.1.1
# via ipython
django==3.2.2
django==3.2.22
# via
# -c requirements.txt
# model-bakery
fastdiff==0.2.0
exceptiongroup==1.1.3
# via
# ipython
# pytest
executing==2.0.1
# via stack-data
fastdiff==0.3.0
# via snapshottest
flake8-bugbear==21.4.3
# via -r requirements-dev.in
flake8-polyfill==1.0.2
# via pep8-naming
flake8==3.9.1
flake8==6.1.0
# via
# -r requirements-dev.in
# flake8-bugbear
# flake8-polyfill
freezegun==1.1.0
# pep8-naming
flake8-bugbear==23.9.16
# via -r requirements-dev.in
freezegun==1.2.2
# via -r requirements-dev.in
idna==2.10
idna==3.4
# via
# -c requirements.txt
# requests
iniconfig==1.1.1
iniconfig==2.0.0
# via pytest
ipython-genutils==0.2.0
# via traitlets
ipython==7.23.1
ipython==8.17.1
# via -r requirements-dev.in
isort==5.8.0
isort==5.12.0
# via -r requirements-dev.in
jedi==0.18.0
jedi==0.19.1
# via ipython
matplotlib-inline==0.1.2
matplotlib-inline==0.1.6
# via ipython
mccabe==0.6.1
mccabe==0.7.0
# via flake8
model-bakery==1.3.1
model-bakery==1.17.0
# via -r requirements-dev.in
mypy-extensions==0.4.3
mypy-extensions==1.0.0
# via black
packaging==20.9
# via pytest
parso==0.8.2
packaging==23.2
# via
# -c requirements.txt
# black
# pytest
parso==0.8.3
# via jedi
pathspec==0.8.1
pathspec==0.11.2
# via black
pep8-naming==0.11.1
pep8-naming==0.13.3
# via -r requirements-dev.in
pexpect==4.8.0
# via ipython
pickleshare==0.7.5
# via ipython
pluggy==0.13.1
platformdirs==3.11.0
# via black
pluggy==1.3.0
# via pytest
prompt-toolkit==3.0.18
prompt-toolkit==3.0.39
# via ipython
ptyprocess==0.7.0
# via pexpect
py==1.10.0
# via pytest
pycodestyle==2.7.0
pure-eval==0.2.2
# via stack-data
pycodestyle==2.11.1
# via flake8
pyflakes==2.3.1
pyflakes==3.1.0
# via
# autoflake
# flake8
pygments==2.9.0
pygments==2.16.1
# via ipython
pyparsing==2.4.7
# via packaging
pytest-cov==2.11.1
# via -r requirements-dev.in
pytest-django==4.2.0
# via -r requirements-dev.in
pytest==6.2.4
pytest==7.4.3
# via
# -r requirements-dev.in
# pytest-cov
# pytest-django
python-dateutil==2.8.1
pytest-cov==4.1.0
# via -r requirements-dev.in
pytest-django==4.6.0
# via -r requirements-dev.in
python-dateutil==2.8.2
# via
# -c requirements.txt
# freezegun
pytz==2021.1
pytz==2023.3.post1
# via
# -c requirements.txt
# django
regex==2021.4.4
# via black
requests-mock==1.9.2
# via -r requirements-dev.in
requests==2.25.1
requests==2.31.0
# via
# -c requirements.txt
# requests-mock
requests-mock==1.11.0
# via -r requirements-dev.in
six==1.16.0
# via
# -c requirements.txt
# asttokens
# python-dateutil
# requests-mock
# snapshottest
snapshottest==0.6.0
# via -r requirements-dev.in
sqlparse==0.4.1
sqlparse==0.4.4
# via
# -c requirements.txt
# django
termcolor==1.1.0
stack-data==0.6.3
# via ipython
termcolor==2.3.0
# via snapshottest
toml==0.10.2
tomli==2.0.1
# via
# autoflake
# black
# coverage
# pytest
traitlets==5.0.5
traitlets==5.13.0
# via
# ipython
# matplotlib-inline
urllib3==1.26.4
typing-extensions==4.8.0
# via
# -c requirements.txt
# asgiref
# black
# ipython
urllib3==2.0.7
# via
# -c requirements.txt
# requests
wasmer==1.0.0
wasmer==1.1.0
# via fastdiff
wasmer-compiler-cranelift==1.1.0
# via fastdiff
wcwidth==0.2.5
wcwidth==0.2.8
# via prompt-toolkit

# The following packages are considered to be unsafe in a requirements file:
# setuptools
6 changes: 3 additions & 3 deletions requirements-prod.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile requirements-prod.in
#
uwsgi==2.0.19.1
uwsgi==2.0.22
# via -r requirements-prod.in
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django
Django~=3.2.22
django-environ
psycopg2
sentry_sdk
Expand Down
Loading

0 comments on commit 9d07eab

Please sign in to comment.