Skip to content
Snippets Groups Projects
Commit 08115228 authored by Rajmund Hruška's avatar Rajmund Hruška
Browse files

Update .gitlab-ci.yml file

parent 473bd391
No related branches found
No related tags found
No related merge requests found
Pipeline #9141 passed
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/${MENTAT_IMAGE}:latest
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# https://pip.pypa.io/en/stable/topics/caching/
cache:
paths:
- .cache/pip
before_script:
- printf "AccountID $GEOIP_ACCOUNT_ID\nLicenseKey $GEOIP_LICENSE_KEY\nEditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country\n" > /etc/GeoIP.conf
- service postgresql start
- pip install virtualenv
- virtualenv venv
- python3 -m venv venv
- source venv/bin/activate
- make deps
stages:
- test
......@@ -17,24 +23,21 @@ stages:
unit-tests:
stage: test
script:
- sed -i 's/\/usr\/share\/GeoIP/\/builds\/713\/mentat\/mentat-test-3\/chroot\/usr\/share\/GeoIP/g' /builds/713/mentat/mentat-test-3/conf/core/services.json.conf
- make test 2>&1 | tee errors.log
- echo "unit test"
artifacts:
when: always
paths:
- errors.log
reports:
junit: nose2-junit.xml
pylint:
stage: test
script:
- make pylint
- echo "pylint"
pyflakes:
stage: test
script:
- make pyflakes
- echo "pyflakes"
check-deprecation-warnings:
before_script: []
......@@ -43,7 +46,7 @@ check-deprecation-warnings:
- "if [[ $(grep DeprecationWarning errors.log) ]]; then cat errors.log; exit 1; fi"
allow_failure: true
build-job:
.build-job:
stage: build
script:
- make deps-build-whl
......@@ -59,7 +62,7 @@ build-job:
changes:
- lib/mentat/__init__.py
sphinx-metadata-job:
.sphinx-metadata-job:
stage: build
before_script: []
script:
......@@ -78,13 +81,14 @@ sphinx-metadata-job:
- devel
- release
twine-job:
.twine-job:
stage: deploy
script:
- make deps-python-dev
- printf "[pypi]\nusername = __token__\npassword = $TWINE_TOKEN\n" > .pypirc # Set credentials for pypi.org
- mkdir dist2
- cp dist/*.whl dist/*.tar.gz dist2/. # Get only .whl and .tar.gz files
#- twine upload 'dist2/*' --skip-existing --config-file .pypirc # Upload to pypi.org
- python -m twine upload 'dist2/*' --skip-existing --config-file .pypirc # Upload to pypi.org
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist2/* # Upload to GitLab's package registry
only:
refs:
......@@ -94,15 +98,17 @@ twine-job:
changes:
- lib/mentat/__init__.py
pages:
.pages:
stage: deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_FORCE_HTTPS: "true"
script:
- make deps-python
- make deps-python-dev
- make docs # Build documentation
- for branch in devel master release; do curl -L --header "JOB-TOKEN:$CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/artifacts/$branch/download?job=pages" -o $branch.zip; done # Download the documentation from devel, master and release branches
- unzip -o '*.zip' || true # Unzip downloaded documentation while ignoring not existing files
- unzip -uo '*.zip' || true # Unzip downloaded documentation while ignoring not existing files
- mkdir -p public/"$CI_COMMIT_BRANCH" # Create directory for docs for this branch if it doesn't exist
- cp -rf doc/sphinx/_build/html public/"$CI_COMMIT_BRANCH" # Copy docs to shared folder used by GitLab to publish Pages
artifacts:
......@@ -114,7 +120,7 @@ pages:
- devel
- release
deb-job:
.deb-job:
stage: deploy
script:
- case "$CI_COMMIT_BRANCH" in "devel") SUITE="development" ;; "release") SUITE="release" ;; "master") SUITE="production" ;; esac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment