From 4e1d28ece6531e8b5ea763039db7b59ac8a7a950 Mon Sep 17 00:00:00 2001 From: Stu Sherwin Date: Tue, 21 Aug 2018 18:06:34 +0100 Subject: [PATCH] Deploy to server on master commit --- .gitlab-ci.yml | 15 ++------------- bin/deploy | 26 -------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) delete mode 100755 bin/deploy diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33e1ed0..08e634e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,28 +1,17 @@ image: ruby:2.4.2 stages: - - build - deploy -build: - stage: build - before_script: - - gem install jekyll - script: - - jekyll build -d public - artifacts: - paths: - - public - deploy: stage: deploy before_script: - gem install jekyll script: - jekyll build -d public - - ./bin/deploy + - rsync -avz --delete --no-group ./dist/ $SERVER_USER@autonomic.zone:/var/www/autonomic.zone/html/ artifacts: paths: - public only: - - tags + - master diff --git a/bin/deploy b/bin/deploy deleted file mode 100755 index f49d7eb..0000000 --- a/bin/deploy +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -GITUSERNAME="autonomicgitlabci" -GITUSEREMAIL="autonomicgitlabci@nowhere.com" -DEPLOYSCRIPT="https://github.com/X1011/git-directory-deploy/raw/master/deploy.sh" - -export GIT_DEPLOY_DIR="public" -export GIT_DEPLOY_BRANCH="production" -export GIT_DEPLOY_REPO="git@gitlab.com:autonomic-cooperative/autonomic-cooperative.gitlab.io.git" - -apt-get update -y -apt-get install -yqq wget openssh-client - -wget $DEPLOYSCRIPT && chmod +x deploy.sh - -git config --global user.email $GITUSEREMAIL -git config --global user.name $GITUSERNAME - -mkdir -p ~/.ssh -eval "$(ssh-agent -s)" -ssh-add <(echo "$SSH_PRIVATE_KEY") -echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - -./deploy.sh -m "Git tag: $(git describe --exact-match HEAD)" - -rm -Rfv .ssh