From 2ffc8522d82a49a4acb2f1e6e768e3e0dda04e2d Mon Sep 17 00:00:00 2001
From: Alejandro Lopez Gestoso <alopez@iri.upc.edu>
Date: Wed, 29 May 2019 12:20:53 +0200
Subject: [PATCH] Added gitlab Continuous Integration; Adapted to .deb packages
 generation.

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..9896336
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,36 @@
+image: docker.io/alopeziri/labrobotica
+
+stages:
+  - build
+  - test
+  - deploy
+
+build-package:
+  stage: build
+  script:
+#  Uncomment to install dependencies
+#    - apt update
+#    - apt -y install iri-<package_name>-dev
+    - apt update
+    - apt -y install iri-iriutils-dev iri-comm-dev iri-trajectory-dev iri-dynamixel-dev
+    - apt install -y libxerces-c-dev xsdcxx libboost-all-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 *dynamixel_motor_cont*.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 dynamixel_motor_cont"
+  only:
+    - tags
+
-- 
GitLab