Skip to content
Snippets Groups Projects
Commit c79d1c9f authored by Thomas Wood's avatar Thomas Wood
Browse files

Dockerise the build/deployment

parent 244208a6
No related branches found
No related tags found
No related merge requests found
......@@ -9,47 +9,58 @@ update_publications:
- git checkout -B ${CI_BUILD_REF_NAME}
- git submodule update --init --remote
- git add publications
- git commit -m "[AUTO] Updating publications submodule" --author="Resource Reasoning Group Backup Bot <rr-gitlab-bot@example.com>" || exit 0
- git commit -m "[AUTO] Updating publications submodule\n\n[ci skip]" || exit 0
- git remote rm rw || true
- git remote add rw git@gitlab.doc.ic.ac.uk:${CI_PROJECT_PATH}.git
- eval `ssh-agent`
- echo "$PUSH_KEY" | ssh-add -
- git push rw ${CI_BUILD_REF_NAME}
- ssh-agent -k
variables:
GIT_AUTHOR_NAME: Resource Reasoning Group Backup Bot
GIT_COMMITTER_NAME: Resource Reasoning Group Backup Bot
GIT_AUTHOR_EMAIL: rr-gitlab-bot@example.com
EMAIL: rr-gitlab-bot@example.com
image: ignoredambience/github-gitlab-sync
tags:
- docker
only:
- triggers
.before_script: &before_script
- bundle install --without=development
- bundle exec rake init
test:
stage: test
before_script: *before_script
image: "ruby:2.4"
tags:
- docker
before_script:
- bundle install --without=development
- bundle exec rake init
script:
- bundle exec rake -s --suppress-backtrace . test
except:
- triggers
artifacts:
paths:
- _site/
expire_in: 1 day
deadlinks:
stage: deploy
image: "ruby:2.4"
tags:
- docker
before_script:
- bundle install --without="build development" --with=test
script:
- bundle exec rake -s --suppress-backtrace . testlinks
allow_failure: true
deploy:
stage: deploy
environment: production
before_script: *before_script
script:
- bundle exec rake -s --suppress-backtrace . deploy
- "umask 0002 && rsync --chmod=Dg+s,ug+rwX,o+rX --chown=:rr -igrp --delete _site/ /vol/rr/www"
tags:
- doc
- auth-rr
only:
- master
except:
- triggers
# Not a test stage to prevent race conditions with gem installations.
deadlinks:
stage: deploy
script:
- bundle exec rake -s --suppress-backtrace . testlinks
allow_failure: true
except:
- triggers
variables:
NOKOGIRI_USE_SYSTEM_LIBRARIES: "true"
source 'https://rubygems.org'
gem 'rake'
gem 'jekyll'
group :build do
gem 'jekyll'
end
group :default, :jekyll_plugins do
group :build, :jekyll_plugins do
gem 'jekyll-scholar', '~> 5.10'
#gem 'jekyll-scholar', :git => '/home/thomas/jekyll-scholar', :branch => 'master'
gem 'jekyll-redirect-from'
......
......@@ -34,8 +34,3 @@ desc "Build the site, rebuild when files are edited, and serve via a local http
task :serve do
sh "bundle exec jekyll serve"
end
desc "Deploy the site using rsync"
task :deploy => :build do
sh "umask 0002 && rsync --chmod=Dg+s,ug+rwX,o+rX --chown=:rr -igrp --delete _site/ /vol/rr/www"
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment