2018-12-16 20:39:08 +01:00
|
|
|
image: debian:testing
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- linting
|
|
|
|
- test
|
2020-05-14 18:54:52 +02:00
|
|
|
- renovate
|
2019-09-24 10:59:00 -07:00
|
|
|
- build_container
|
2018-12-16 20:39:08 +01:00
|
|
|
|
2019-08-28 08:33:28 -07:00
|
|
|
variables:
|
|
|
|
CONTAINER_TEST_IMAGE: registry.0xacab.org/jvoisin/mat2-web:$CI_BUILD_REF_NAME
|
|
|
|
CONTAINER_RELEASE_IMAGE: registry.0xacab.org/jvoisin/mat2-web:latest
|
|
|
|
|
2018-12-16 20:39:08 +01:00
|
|
|
pyflakes:
|
|
|
|
stage: linting
|
|
|
|
script:
|
|
|
|
- apt-get -qqy update
|
|
|
|
- apt-get -qqy install --no-install-recommends pyflakes3
|
|
|
|
- pyflakes3 ./main.py
|
|
|
|
|
|
|
|
mypy:
|
|
|
|
stage: linting
|
|
|
|
script:
|
|
|
|
- apt-get -qqy update
|
|
|
|
- apt-get -qqy install --no-install-recommends python3-pip
|
|
|
|
- pip3 install mypy
|
2021-06-13 10:58:02 +00:00
|
|
|
- pip3 install -r requirements-test.txt
|
|
|
|
- mypy --ignore-missing-imports matweb main.py
|
2018-12-16 20:39:08 +01:00
|
|
|
|
2020-05-21 17:22:58 +02:00
|
|
|
bandit:
|
|
|
|
image:
|
|
|
|
name: $CI_REGISTRY/georg/mat2-ci-images:linting
|
2020-05-21 17:28:54 +02:00
|
|
|
stage: linting
|
2020-05-21 17:22:58 +02:00
|
|
|
script:
|
|
|
|
- bandit -r ./matweb/ main.py
|
|
|
|
|
2018-12-16 20:39:08 +01:00
|
|
|
tests:debian:
|
|
|
|
stage: test
|
2021-03-18 16:13:00 +01:00
|
|
|
before_script:
|
|
|
|
- apt update
|
2018-12-16 20:39:08 +01:00
|
|
|
script:
|
|
|
|
- apt-get -qqy update
|
2019-07-09 14:56:21 -07:00
|
|
|
- apt-get -qqy install --no-install-recommends mat2 python3-flask python3-coverage python3-pip python3-setuptools
|
|
|
|
- pip3 install wheel
|
2020-07-14 15:28:08 +02:00
|
|
|
- pip3 install -r requirements.txt -r requirements-test.txt
|
2020-07-13 16:15:35 +02:00
|
|
|
- python3-coverage run --branch --include main.py,matweb/*.py -m unittest discover -s test
|
2018-12-16 20:39:08 +01:00
|
|
|
- python3-coverage report -m
|
2019-08-28 08:33:28 -07:00
|
|
|
|
|
|
|
build-docker:
|
2019-09-24 10:59:00 -07:00
|
|
|
stage: build_container
|
2019-08-28 08:33:28 -07:00
|
|
|
image:
|
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
|
|
entrypoint: [""]
|
|
|
|
script:
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
|
|
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.production --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
|
|
|
only:
|
|
|
|
- tags
|
2020-05-14 18:54:52 +02:00
|
|
|
- master
|
|
|
|
|
|
|
|
renovate:
|
|
|
|
stage: renovate
|
|
|
|
variables:
|
|
|
|
RENOVATE_TOKEN: $GITLAB_API_TOKEN
|
|
|
|
image:
|
|
|
|
name: renovate/renovate:19
|
|
|
|
entrypoint: ['']
|
|
|
|
script:
|
|
|
|
- node /usr/src/app/dist/renovate.js --platform gitlab --endpoint ${CI_API_V4_URL} --token ${GITLAB_API_TOKEN} ${CI_PROJECT_PATH}
|