Browse Source

Created scripts for automatic deployment

Nathan Schneider 4 years ago
parent
commit
feecf49bf4
3 changed files with 34 additions and 0 deletions
  1. 27 0
      .gitlab-ci.yml
  2. 3 0
      _scripts/build.sh
  3. 4 0
      _scripts/deploy_website.sh

+ 27 - 0
.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
+

+ 3 - 0
_scripts/build.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+bundle exec jekyll build --config _config.yml

+ 4 - 0
_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"