Skip to content
Snippets Groups Projects
Commit b0d252e5 authored by Henrik tom Woerden's avatar Henrik tom Woerden
Browse files

Merge branch 'f-ci' into 'dev'

F ci

See merge request bmp-caosdb/caosdb-pylib!3
parents bb02e16d be3063a0
Branches
Tags
No related merge requests found
......@@ -20,90 +20,72 @@
#
# ** end header
#
stages:
- setup
- code_style
- build
- test
#########
# Setup
#########
# install formatters
setup:install_formatters:python2.7:
tags: [ py27 ]
stage: setup
script:
- pip2 install --upgrade pycodestyle --user
setup:install_formatters:python3.4:
tags: [ py34 ]
stage: setup
script:
- pip3.4 install --upgrade pycodestyle --user
variables:
CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb-pylib-testenv
# When using dind service we need to instruct docker, to talk with the
# daemon started inside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using the Kubernetes executor, the variable should be set to
# tcp://localhost:2375/ because of how the Kubernetes executor connects services
# to the job container
# DOCKER_HOST: tcp://localhost:2375/
#
# For non-Kubernetes executors, we use tcp://docker:2375/
DOCKER_HOST: tcp://docker:2375/
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
DOCKER_DRIVER: overlay2
services:
- docker:dind
############
# code_style
############
image: $CI_REGISTRY_IMAGE:latest
code_style:pycodestyle:python2.7:
tags: [ py27 ]
stage: code_style
script:
- ~/.local/bin/pycodestyle --count ./
stages:
- code_style
- setup
- test
- deploy
code_style:pycodestyle:python3.4:
tags: [ py34 ]
code_style:
stage: code_style
script:
- ~/.local/bin/pycodestyle --count ./
#########
# Build
#########
# install python client (python 2.7)
build:pycaosdb:python2.7:
tags: [ py27 ]
stage: build
script:
- python2.7 setup.py install --user
# install python client (python 3.4)
build:pycaosdb:python3.4:
tags: [ py34 ]
stage: build
script:
- python3.4 setup.py install --user
- pycodestyle --count ./
- pylint3 --unsafe-load-any-extension=y -d all -e E,F src/caosdb/common
allow_failure: true
########
# Test
########
# unit tests for pycaosdb
test:pycaosdb:py34:
tags: [ py34 ]
# pylint tests for pycaosdb
test:
stage: test
script:
- touch ~/.pycaosdb.ini
- tox -r -e py34
- tox -r
test:pycaosdb:py27:
tags: [ py27 ]
stage: test
trigger_build:
stage: deploy
script:
- touch ~/.pycaosdb.ini
- tox -r -e py27
- echo $TOKEN
- /usr/bin/curl -X POST
-F token=$TOKEN
-F "variables[PYLIB]=$CI_COMMIT_REF_NAME"
-F ref=master https://gitlab.indiscale.com/api/v4/projects/14/trigger/pipeline
# pylint tests for pycaosdb (python 3.4)
.test:pycaosdb:python3.4:pylint:
stage: test
script:
- /usr/bin/env python3.4 /home/caosdb/.local/bin/pylint --unsafe-load-any-extension=y -d all -e E,F client/PyCaosDB/caosdb/common/models.py
# pylint tests for pycaosdb (python 2.7)
.test:pycaosdb:python2.7:pylint:
stage: test
build-testenv:
image: docker:latest
stage: setup
script:
- /usr/bin/env python2.7 /home/caosdb/.local/bin/pylint --unsafe-load-any-extension=y -d all -e E,F client/PyCaosDB/caosdb/common/models.py
- cd unittests/docker
- docker login -u testuser -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# use here general latest or specific branch latest...
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build
--pull
--build-arg COMMIT=$CI_COMMIT_SHORT_SHA
--cache-from $CI_REGISTRY_IMAGE:latest
-t $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:latest
[tox]
envlist= py27, py34, py35, py36
envlist= py27, py34, py35, py36, py37
skip_missing_interpreters = true
[testenv]
deps=nose
......
FROM debian:latest
RUN apt-get update && \
apt-get install pylint3 python3-pip tox git \
curl pycodestyle -y
ARG COMMIT="dev"
RUN git clone -b dev https://gitlab.gwdg.de/bmp-caosdb/caosdb-pylib.git && \
cd caosdb-pylib && git checkout $COMMIT && pip3 install .
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment