* Fix #8 - Travis CI integration

* Review fixes

* Remove duplicate line
This commit is contained in:
Gideon Thomas 2016-08-18 15:52:30 -04:00 коммит произвёл GitHub
Родитель 50ba71dad4
Коммит 7368bb1d2d
3 изменённых файлов: 24 добавлений и 10 удалений

11
.travis.yml Normal file
Просмотреть файл

@ -0,0 +1,11 @@
language: node_js
node_js:
- node
cache:
directories:
- node_modules
after_success:
- npm run deploy
env:
global:
- secure: "HRNoCqrzyNjkIoO8jV+U0Q2botBTw3xLkRTsmpe0D/s0fqZe3w6sHwzw3YK4CgQvErt3zAT4y11j5hcLT+GNOr8vztaErqJiLbW5sSdZV/0FXONAiGKjHrLqN9uK62HSQgpw9RYK03YLm32WDSm0X5fnn3lwPBqkggao/TKuKt8cItWOQ2qE/D7QdwP6yPajnbZaBLyrLGOYMFngIpFijg0AnuSfO08uWTQ504JVFJ9Qr1ZkpWJ5BCu1dhCTjK2W/URfGVBVMjh98Dte9Fls0m5W41CmsF3qqEsURSNnqjEUv8e/TjSNXhbkMPGrV0cPH2quCPZhw5xVxmsv4znLYOdw9EuxAU54s3fU2fDIZOSdqeDqEMWhQRNKcvXNlKoZD/0+gk0q9WX5Xemgwf4NnFLbot6N4DJUZemSJ/yHSsMV53F3OClthCz6D9BzE8etUiYzaBX765J+DIGGJhInBpqsQlttBZSZEQLJbZyqYO/9giUdtR/FcRGjSGDM2FHE/eiZtz7YvjRC4Zl/a97sjRUsgL47DhYH7jsoKYVIcKfLtB/jLlCX9UJrJ2KQe1opa6BTHvWbJiSbW9EvTDR9M8DhXgZqB6GuINMx1CCjsc6kqUNwkY2eetw4xoxSkZfuxOB3P//33i44qwkxJ/tr9vrBL5hQ5T/fmem0vl6Ob8w="

Просмотреть файл

@ -1,5 +1,8 @@
# Women and Web Literacy
[![Build Status](https://travis-ci.org/mozilla/womenandweb.svg)](https://travis-ci.org/mozilla/woemnandweb)
[![Shipping fast with zenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.com)
This repository hosts the code used to power the Women and Web Literacy hub's website.
## Development

Просмотреть файл

@ -5,22 +5,22 @@ let pathToRepo = require(`path`).resolve(`.`);
let getStatus = (repo) => repo.getStatus();
let runDeploy = () => {
if(process.env.TRAVIS_PULL_REQUEST) {
shell.echo(`Skipping deployment for pull request!`);
return;
}
shell.echo(`Running deployment now...`);
shell.exec(`git checkout master`);
shell.exec(`git pull origin master`);
shell.exec(`git stash`);
shell.exec(`git fetch origin master:master`)
shell.exec(`git checkout --orphan gh-pages master`);
shell.rm(`-rf`,`node_modules`);
shell.exec(`npm i`);
shell.exec(`npm run build`);
shell.echo(`${new Date}\n\n\n`).to(`last-built.txt`);
shell.exec(`git log -n 1 >> last-built.txt`);
shell.exec(`git branch -D gh-pages`);
shell.exec(`git checkout --orphan gh-pages`);
shell.rm(`.gitignore`);
shell.echo(`/*\n`).toEnd(`.gitignore`);
@ -33,8 +33,8 @@ let runDeploy = () => {
shell.exec(`git reset`);
shell.exec(`git add .`);
shell.exec(`git commit -m 'deploy.js-ified'`);
shell.exec(`git push origin gh-pages -f`);
shell.exec(`git commit -m 'Deployed via Travis'`);
shell.exec(`git push -f https://${process.env.GH_TOKEN}@github.com/mozilla/womenandweb.git gh-pages:gh-pages`);
shell.echo(`Finished deploying!`);
};