From 4c8f008191a71fbb97bf799acf867c75f6224b9d Mon Sep 17 00:00:00 2001
From: Alejandro Lopez Gestoso <alopez@iri.upc.edu>
Date: Mon, 13 May 2019 11:58:13 +0200
Subject: [PATCH] Added gitLab Continuous Integration file to generate .deb
 packages on tag

---
 .gitlab-ci.yml | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..feff2a7
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,35 @@
+image: docker.io/alopeziri/labrobotica
+
+stages:
+  - build
+  - test
+  - deploy
+
+build-package:
+  stage: build
+  script:
+#  Uncomment to install dependencies
+#    - apt-get update
+#    - apt-get -y --allow-unauthenticated install iri-<package_name>-dev
+    - apt-get update
+    - apt-get -y --allow-unauthenticated install iri-iriutils-dev
+    - mkdir -pv build
+    - cd build
+    - cmake -D CMAKE_BUILD_TYPE=RELEASE -DCPACK_PACKAGE_VERSION=$CI_COMMIT_TAG ..
+    - make package -j $(nproc)
+  artifacts:
+    paths:
+      - build/*.deb
+    expire_in: 2 weeks
+  only:
+    - tags
+    
+update_repo:
+  stage: deploy
+  script:
+    - cd build
+    - "scp -i /root/.ssh/iriLabKeyNopwd -r *comm*.deb irilabo@147.83.76.226:packages/"
+    - "ssh irilabo@147.83.76.226 -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh comm"
+  only:
+    - tags
+
-- 
GitLab