From feecf49bf4ece13d846b16bdaddbfa6ff2dbfdfe Mon Sep 17 00:00:00 2001 From: Nathan Schneider Date: Wed, 10 Jul 2019 17:43:53 +0000 Subject: [PATCH] Created scripts for automatic deployment --- .gitlab-ci.yml | 27 +++++++++++++++++++++++++++ _scripts/build.sh | 3 +++ _scripts/deploy_website.sh | 4 ++++ 3 files changed, 34 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 _scripts/build.sh create mode 100644 _scripts/deploy_website.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ea5b498 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,27 @@ +// FTP auto-deploy +// instructions here: https://is.gd/D84vXz +image: ruby:2.4.1 +stages: + - deploy + +before_script: + - apt-get update -qq && apt-get install -y -qq libcurl4-openssl-dev lftp + - bundle install + - gem install jekyll + - gem install jekyll-theme-minima + +deploy_script: + stage: deploy + only: + - master + environment: + name: website + url: https://cmci.colorado.edu/cmci + script: + - echo "Building.." + - chmod +x ./_scripts/build.sh + - ./_scripts/build.sh + - echo "Deploying.." + - chmod +x ./_scripts/deploy_website.sh + - ./_scripts/deploy_website.sh + diff --git a/_scripts/build.sh b/_scripts/build.sh new file mode 100644 index 0000000..e0bbd8c --- /dev/null +++ b/_scripts/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +bundle exec jekyll build --config _config.yml \ No newline at end of file diff --git a/_scripts/deploy_website.sh b/_scripts/deploy_website.sh new file mode 100644 index 0000000..9b132e0 --- /dev/null +++ b/_scripts/deploy_website.sh @@ -0,0 +1,4 @@ +#!/bin/bash +echo "Uploading" +cd _site || exit +lftp -p 21 -u $CU_USR,$CU_PASSWORD $CU_HOSTNAME -e "set ftp:ssl-allow no; mirror -R . $CU_DIR; bye"