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

Merge branch 'hruskraj-ci/cd' into 'devel'

CI/CD

See merge request 709/idea/idea!1
parents a53a7a46 961a579c
No related branches found
No related tags found
2 merge requests!2CI/CD,!1CI/CD
Pipeline #1482 passed
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/python:3.6
# 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"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
before_script:
- pip install virtualenv
- make show-version # Print out python version for debugging
- virtualenv venv
- source venv/bin/activate
- make deps
stages: # List of stages for jobs, and their order of execution
- test
- build
- deploy
unit-test-job:
stage: test
script:
- make test
pylint-test-job:
stage: test
script:
- make pylint
pyflakes-test-job:
stage: test
script:
- make pyflakes
build-job:
stage: build
script:
- make buildbot
- git clone https://gitlab-ci-token:$SIGNER_TOKEN@$SIGNER_REPO
- bash signer/init_keyring.sh
- python signer/signer.py --verbose $GPG_KEY "$PWD/dist"
artifacts:
paths:
- dist
only:
- devel
- master
sphinx-metadata-job:
stage: build
script:
- printf "{\n\"codename\":\"$CI_COMMIT_BRANCH\",\n" > metadata.json
- printf "\"suite\":$(if [ "$CI_COMMIT_BRANCH" == "master" ]; then echo \"stable\"; else echo \"unstable\"; fi),\n" >> metadata.json
- printf "\"bversion\":\"$(make show-version)\",\n" >> metadata.json
- printf "\"revision\":\"$CI_COMMIT_SHA\",\n" >> metadata.json
- printf "\"bnumber\":\"$CI_PIPELINE_ID\",\n" >> metadata.json
- printf "\"bdate\":\"$(date '+%Y-%m-%d %T')\"\n}\n" >> metadata.json
artifacts:
paths:
- metadata.json
only:
- master
- devel
twine-job:
stage: deploy
script:
- printf "[pypi]\nusername = __token__\npassword = $TWINE_TOKEN\n" > .pypirc
- mkdir dist2
- cp dist/*.whl dist/*.tar.gz dist2/.
- twine upload 'dist2/*' --skip-existing --config-file .pypirc
only:
- master
pages:
stage: deploy
script:
- make docs
- curl -L --header "JOB-TOKEN:$CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/artifacts/devel/download?job=pages" -o devel.zip
- curl -L --header "JOB-TOKEN:$CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/artifacts/master/download?job=pages" -o master.zip
- unzip -n '*.zip' || true # Ignore not existing zipfiles
- mkdir -p public/"$CI_COMMIT_BRANCH"
- mkdir -p public/"$CI_COMMIT_BRANCH"/files
- cp -rf doc/_build/html public/"$CI_COMMIT_BRANCH"
- cp -rf dist/* public/"$CI_COMMIT_BRANCH"/files/.
- cd public/"$CI_COMMIT_BRANCH"/files
- echo "<html><body><h1>Directory listing:</h1>" > ./index.html
- find -exec echo "<a href='{}'>{}</a><br/>" \; | sort >> ./index.html
- echo "</body></html>" >> ./index.html
artifacts:
name: "$CI_COMMIT_BRANCH"
paths:
- public
only:
- master
- devel
\ No newline at end of file
......@@ -105,7 +105,12 @@ show-version: FORCE
#-------------------------------------------------------------------------------
deps: deps-python
deps: deps-python deps-python-dev
deps-python-dev: FORCE
@echo "\n$(GREEN)*** Installing Python development dependencies ***$(NC)\n"
@pip3 install -r requirements-dev.pip
deps-python: FORCE
@echo "\n${GREEN}*** Installing Python dependencies ***${NC}\n"
......
......@@ -4,5 +4,5 @@
# Copyright (c) since 2016, CESNET, z. s. p. o.
# Use of this source is governed by an ISC license, see LICENSE file.
__version__ = '0.1.11'
__version__ = '0.1.13'
__author__ = 'Pavel Kácha <pavel.kacha@cesnet.cz>'
......@@ -58,7 +58,7 @@ def Timestamp(t):
return t
try:
# Try numeric type
return datetime.datetime.fromtimestamp(float(t))
return datetime.datetime.utcfromtimestamp(float(t))
except (TypeError, ValueError):
pass
# Try RFC3339 string
......@@ -101,7 +101,7 @@ def URI(s):
def Net4(ip):
for t in ipranges.IP4Net, ipranges.IP4Range, ipranges.IP4:
for t in ipranges.IP4, ipranges.IP4Net, ipranges.IP4Range:
try:
return t(ip)
except ValueError:
......@@ -110,7 +110,7 @@ def Net4(ip):
def Net6(ip):
for t in ipranges.IP6Net, ipranges.IP6Range, ipranges.IP6:
for t in ipranges.IP6, ipranges.IP6Net, ipranges.IP6Range:
try:
return t(ip)
except ValueError:
......
ipranges
typedcols
setuptools
wheel
twine
docutils<0.18
nose==1.3.7
pyflakes==2.1.0
pylint==2.2.2
sphinx==1.8.4
sphinx-rtd-theme==0.4.2
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