Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
Switch to Snap-CI for all deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
snap-ci committed Jul 2, 2014
1 parent a17d32f commit 7b9550d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 72 deletions.
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# RapidFTR Guide

[![Build Status](https://travis-ci.org/rapidftr/guide.svg?branch=master)](https://travis-ci.org/rapidftr/guide)
[![Deployment Status](https://snap-ci.com/rapidftr/guide/branch/master/build_image)](https://snap-ci.com/rapidftr/guide/branch/master)

* Uses [GitBook](//gitbook.io) to generate book from markdown
* Commits are automatically compiled and deployed to GitHub pages using Travis
* Commits are automatically compiled and deployed to GitHub pages using Snap-CI
* Compiled website is **force-pushed** to gh-pages, so don't mess with the gh-pages branch in your development
* To access the documentation, browse to:
* [https://rapidftr.github.io/guide](//rapidftr.github.io/guide)
34 changes: 0 additions & 34 deletions deploy.sh

This file was deleted.

5 changes: 2 additions & 3 deletions build.sh → go/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env bash

npm rm -g gitbook-plugin-rapidftr
npm link gitbook-plugin-rapidftr
npm install
set -xe

export PATH=$(npm bin):$PATH

mkdir -p gh-pages
Expand Down
29 changes: 29 additions & 0 deletions go/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

echo "Reconstituting SSH key..."
echo $DEPLOY_KEY | sed 's/\\n/\'$'\n/g' > id_guide
chmod 600 id_guide

export GIT_SSH=$(pwd)/go/ssh.sh
export SSH_KEY=$(pwd)/id_guide

set -xe

echo "Cloning gh-pages..."
rm -Rf gh-pages
git config --global user.email "snap@snap-ci.org"
git config --global user.name "snap-ci"
git clone --quiet --branch=gh-pages git@github.com:rapidftr/guide.git gh-pages
(cd gh-pages && git rm -rfq *)

echo "Building site..."
go/build.sh

echo "Pushing result..."
cd gh-pages
git add -f .
git commit --amend --allow-empty -q -m "Built $SNAP_COMMIT_SHORT"
git push -fq origin gh-pages

echo "Cleaning up..."
rm -Rf ~/.ssh/id_guide*
7 changes: 7 additions & 0 deletions go/ssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ -z $SSH_KEY ]; then
ssh "$@"
else
ssh -i "$SSH_KEY" "$@"
fi
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"dependencies" : {
"gitbook" : "~0.5.2",
"gitbook-plugin-rapidftr" : "0.0.1"
},
"scripts" : {
"preinstall" : "npm install ./gitbook-plugin-rapidftr"
}
}

0 comments on commit 7b9550d

Please sign in to comment.