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

F ci

parent 42e5a7af
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,32 @@
# ** end header
#
variables:
CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb-webui-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
image: $CI_REGISTRY_IMAGE:latest
stages:
- setup
- linting
......@@ -31,24 +57,7 @@ stages:
# setup
#######
# install pylint
setup:install-pylint:
stage: setup
tags: [ py36 ]
script:
- pip3 install pylint --user
#########
# linting
#########
# pylint everything
linting:pylint:python3:
stage: linting
tags: [ py36 ]
script:
- make pylint
### TODO !!! use respective docker image
######
# test
######
......@@ -56,18 +65,41 @@ linting:pylint:python3:
# run qunit tests
test:qunit:
stage: test
tags: [ py36 ]
#tags: [ py36 ]
artifacts:
paths:
- public/qunit.log
- screenlog.*
script:
- make run-qunit
- make pylint
# TODO fix the following
# - make run-qunit
trigger_build:
stage: deploy
script:
- echo $TOKEN
- /usr/bin/curl -X POST
-F token=$TOKEN
-F "variables[PYLIB]=$CI_COMMIT_REF_NAME"
-F "variables[WEBUI]=$CI_COMMIT_REF_NAME"
-F ref=master https://gitlab.indiscale.com/api/v4/projects/14/trigger/pipeline
build-testenv:
image: docker:latest
stage: setup
script:
- echo $TRIGGERED_BY
- echo $MYSQLBACKEND
- ping -4 -c 3 registry.indiscale.com
- echo $PYLIB
- cd test/docker
- echo $CI_REGISTRY_PASSWORD
- echo $CI_REGISTRY
- 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
--cache-from $CI_REGISTRY_IMAGE:latest
-t $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:latest
......@@ -173,11 +173,11 @@ unzip:
for f in $(LIBS_ZIP); do unzip -o -d libs $$f; done
PYLINT = pylint -d all -e E,F
PYLINT = pylint3 -d all -e E,F
PYTHON_FILES = $(subst $(ROOT_DIR)/,,$(shell find $(ROOT_DIR)/ -iname "*.py"))
pylint: $(PYTHON_FILES)
for f in $(PYTHON_FILES); do $(PYLINT) $$f || exit 1; done
PYLINT_LOCAL = /usr/bin/pylint -d all -e E,F
PYLINT_LOCAL = /usr/bin/pylint3 -d all -e E,F
pylint-local: $(PYTHON_FILES)
for f in $(PYTHON_FILES); do $(PYLINT_LOCAL) $$f || exit 1; done
FROM debian:latest
RUN apt-get update && \
apt-get install firefox-esr pylint3 python3-pip python3-httpbin git \
curl -y
RUN git clone -b dev https://gitlab.gwdg.de/bmp-caosdb/caosdb-pylib.git && \
cd caosdb-pylib && pip3 install .
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