From 70def46c74d7ada5052699a801516e79ad560ee8 Mon Sep 17 00:00:00 2001 From: Dmytro <dbogatov@wpi.edu> Date: Tue, 11 Oct 2016 21:51:39 -0400 Subject: [PATCH] Add CI. --- .deploy.sh | 20 ++++++++++++++++++++ .gitlab-ci.yml | 6 ++++++ 2 files changed, 26 insertions(+) create mode 100755 .deploy.sh create mode 100644 .gitlab-ci.yml diff --git a/.deploy.sh b/.deploy.sh new file mode 100755 index 0000000..80b51ca --- /dev/null +++ b/.deploy.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +cd $DIR + +git fetch origin > /dev/null 2>> deploy.log +git reset --hard origin/master > /dev/null 2>> deploy.log + +bower install --allow-root > /dev/null 2>> deploy.log + +curl --request POST 'https://push.dbogatov.org/api/push/deploy' --data "project=Inara-CV" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..776915c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,6 @@ +production: + type: deploy + script: + - curl --request POST 'https://deploy.dbogatov.org/deploy' --data "token=$TOKEN" --data "project=Inara-CV" + only: + - master \ No newline at end of file -- GitLab