From 9897a024fcb7728d0f7a534128d5b3b5acbeec44 Mon Sep 17 00:00:00 2001
From: JosephK <josephk@framasoft.org>
Date: Thu, 14 Dec 2017 15:23:02 +0100
Subject: [PATCH] =?UTF-8?q?D=C3=A9ploiement=20en=20CI=20sur=20funky.framas?=
 =?UTF-8?q?oft.org?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..9c9bb7da
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,46 @@
+image: php
+stages:
+  - deploy
+  - funky
+pages:
+  stage: deploy
+  before_script:
+  - apt-get update -yqq
+  - apt-get install zip unzip git -yqq
+  - curl --silent --show-error https://getcomposer.org/installer | php
+  script:
+  - latesttag=$(git describe --tags)
+  - git checkout ${latesttag}
+  - php composer.phar install
+  - mkdir tpl_c
+  - zip -r latest.zip .
+  - mkdir .public
+  - cp latest.zip .public
+  - mv .public public
+  artifacts:
+    paths:
+    - public
+  only:
+  - master
+  
+funky:
+  stage: funky
+  before_script:
+  - apt-get update -y -qq
+  - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq zip unzip git
+  - curl --silent --show-error https://getcomposer.org/installer | php
+  script:
+  - git checkout funky
+  - php composer.phar install
+  - mkdir tpl_c
+  - mkdir .public
+  - cp -r * .public
+  - mv .public public
+  - mkdir "${HOME}/.ssh"
+  - chmod 700 "${HOME}/.ssh"
+  - if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
+  - eval `ssh-agent -s`
+  - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}" | base64 --decode -i); fi
+  - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude errors/ public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
+  only:
+    - funky
-- 
GitLab