From 41a4fbdf37336d6104c5ffd81ebe827da53fe0cd Mon Sep 17 00:00:00 2001
From: Tim Schubert <tim.schubert@tu-braunschweig.de>
Date: Mon, 23 Apr 2018 14:03:55 +0200
Subject: [PATCH] Add sync CI task

---
 .gitlab-ci.yml | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4134a73..2f3f45c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,13 @@
 stages:
+  - sync
   - deadlines
   - plagiates
 
+before_script:
+  - cp python-gitlab.cfg $HOME/.python-gitlab.cfg
+  - echo "private_token = ${PRIVATE_API_TOKEN}" >> $HOME/.python-gitlab.cfg
+  - pip install -r requirements.txt
+
 create_tags:
   image: python:3
   stage: deadlines
@@ -12,7 +18,16 @@ create_tags:
     - abgabesystem
 
   script:
-    - cp python-gitlab.cfg $HOME/.python-gitlab.cfg
-    - echo "private_token = ${PRIVATE_API_TOKEN}" >> $HOME/.python-gitlab.cfg
-    - pip install -r requirements.txt
     - python abgabesystem.py deadlines
+
+sync_students:
+  image: python:3
+  stage: sync
+  only:
+    - master
+
+  tags:
+    - abgabesystem
+
+  script:
+    - python abgabesystem.py sync
\ No newline at end of file