Newer
Older
Michael Kohlhase
committed
image: kwarc/jekyll-website-deployer
stages:
- deploy
Michael Kohlhase
committed
# setup locales
- echo "en_US UTF-8" > /etc/locale.gen
- which locale-gen || ( apt-get update -y && apt-get install locales )
- export LANG=en_US.UTF-8
- export LANGUAGE=en_US:en
- export LC_ALL=en_US.UTF-8
Michael Kohlhase
committed
# install ssh-agent, unless already there
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# install rsync, unless already there
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
Michael Kohlhase
committed
# install bundler, unless already there
- 'which bundle || ( gem install bundler )'
Michael Kohlhase
committed
# and install the bundle
- bundle install
# setup ssh agent with the private key
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
Michael Kohlhase
committed
deploy_staging:
Michael Kohlhase
committed
# build the website
- bundle exec jekyll build -d _site
# copy over all the files into the deployment folder
- cd _site && rsync -rv -e "ssh -p $SSH_DEPLOY_PORT" --checksum --exclude='Gemfile' --delete-excluded --delete ./ root@deploy.kwarc.info:/root/data --delete