Skip to content

Latest commit

 

History

History
102 lines (75 loc) · 3.63 KB

README.md

File metadata and controls

102 lines (75 loc) · 3.63 KB

FINE Developer Pages

We do work. Plus, we share.

DO NOT commit/edit documentation files or delete the automated-build branch.

Adding projects

Documentation

Projects should be added with their own directory and an index.md or index.html.

Although front matter is required, it is handled by the automatic deploys. Instead, meta is generated from _config.yml:

Key Required Description
title required Project name. (i.e. "Fryr")
slug required Project location on github.io docs
tagline required Project description (i.e. "A command-line lint warrior")
logo File name, with the file located in the _includes folder (i.e. maximus.svg). Assumes title if not supplied
js_download Links directly to <project-slug>.js in the project's root folder, master branch. Accepts true (leave undefined if false)
zip_download Links directly to GitHub's ZIP of the project. Accepts true (leave undefined if false)
show_demo Support a demo page (must be demo.html). Accepts true (leave undefined if false)

Travis CI

Projects automatically through the Travis deploy. On each successful build, projects notify this repo and trigger a fresh build to recompile the docs.

cd into the cloned GitHub repo (very important because Travis needs to detect the project), and specify the files that should be copied to the documentation site in wearefine.github.io.manfiest.txt. For example:

README.md
fryr.js

Next, add the notification script notify.sh:

#!/bin/bash

REPO_NAME=${PWD##*/}
AUTHOR_EMAIL=`git log -1 --format=%ae`
SHA=`git rev-parse --verify HEAD`

# ENV variables are passed to the deploy.sh script and used in the commit message
body='{
  "request": {
    "message": "Automated: New build started by '$AUTHOR_EMAIL' on wearefine/'$REPO_NAME'@'$SHA'",
    "branch": "automated-build",
    "config": {
      "env": {
        "TRIGGER_REPO": "'$REPO_NAME'",
        "TRIGGER_SHA": "'$SHA'",
        "AUTHOR_EMAIL": "'$AUTHOR_EMAIL'"
      }
    }
  }
}'

# $AUTH_TOKEN is an encrypted variable that must be generated per project
# See https://github.com/wearefine/wearefine.github.io/blob/master/README.md#travis-ci
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token $AUTH_TOKEN" \
  -d "$body" \
  https://api.travis-ci.org/repo/wearefine%2Fwearefine.github.io/requests

Add the .travis.yml config:

language: generic # Or relevant language

after_success:
- chmod ugo+x notify.sh
- '[ "${TRAVIS_PULL_REQUEST}" != "false" ] || ./notify.sh'

Using the Travis CI CLI gem, login, generate a token, and encrypt it. The token is automatically added to .travis.yml.

travis login --org
travis encrypt AUTH_TOKEN=$(travis token --org) --add

Note: A new encrypted token must be generated for each repo, it cannot be copied between projects.

Finally, add the GitHub repo slug to REPOS_TO_COMPILE in deploy.sh script:

REPOS_TO_COMPILE='fae fine-forever frob-core fryr maximus slim-gym fun-fancy-project'

Local Development

  1. git clone [email protected]:wearefine/wearefine.github.io.git
  2. ruby 2.2 <=
  3. bundle install

Run jekyll server to serve the site at http://localhost:4000. Some links will not work because they rely on variables generated by GitHub on build. Again, DO NOT edit documentation files directly as they are autogenerated.