From 81ea84ddea5ae4033c739e0838fec5b803569986 Mon Sep 17 00:00:00 2001
From: Henrik tom Woerden <henrik.tom-woerden@ds.mpg.de>
Date: Wed, 24 Jul 2019 12:57:27 +0200
Subject: [PATCH] Add style check to gitlab ci

---
 .docker/Dockerfile | 2 +-
 .gitlab-ci.yml     | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.docker/Dockerfile b/.docker/Dockerfile
index 60c5e5f..c240da2 100644
--- a/.docker/Dockerfile
+++ b/.docker/Dockerfile
@@ -1,6 +1,6 @@
 FROM debian:latest
 RUN apt-get update && \
-	 apt-get install docker.io tox curl python3-pip git  -y
+	 apt-get install docker.io tox curl python3-pip git python-autopep8 -y
 RUN pip3 install docker-compose
 COPY .docker/wait-for-it.sh /wait-for-it.sh
 RUN git clone https://gitlab.gwdg.de/bmp-caosdb/caosdb-pylib.git && \
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7cd6307..1054ef6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -62,10 +62,12 @@ services:
 
 stages: 
   - setup
+  - style
   - test
 
 test:
   tags: [docker]
+  stage: test
   image: 
     name: docker/compose:1.24.1
     entrypoint: ["/bin/sh", "-c"]
@@ -99,3 +101,10 @@ build-testenv:
         --cache-from $CI_REGISTRY_IMAGE:latest 
         -t $CI_REGISTRY_IMAGE:latest .
       - docker push $CI_REGISTRY_IMAGE:latest
+
+style:
+  tags: [docker]
+  stage: style
+  image: $CI_REGISTRY_IMAGE:latest
+  script:
+      - autopep8 -r --diff --exit-code .
-- 
GitLab