-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
1,277 additions
and
980 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules | ||
.DS_Store | ||
test/fixtures/deployers/**/*.conf | ||
test/fixtures/deployers/**/*.conf | ||
config.coffee | ||
encrypt-config.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test | ||
src | ||
examples | ||
Makefile | ||
contributing.md | ||
.editorconfig | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
language: node_js | ||
node_js: | ||
- 0.10 | ||
- 0.1 | ||
after_script: | ||
- npm run coveralls | ||
before_script: | ||
- openssl aes-256-cbc -k "$secret" -in config.coffee.enc -d -a -out config.coffee | ||
env: | ||
global: | ||
- secure: MBEFvlT4702JjIK0JUaI59np0jELZX0sV1BYvwotfo6cf245AXt4/ae6bsslZ+cxu3dGeVhCokQVBQJOCdUWN/lDsz9i3bTTA2w4DHD5e1Gz0ZVv58559HqMrrU921yRu5GZNpVcM8B+Az9qNwnznA1Fbh+sLh+gpQ3zmzd7JmA= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
U2FsdGVkX1/sRbll1blWaxdY5ERFFDefn36pUItH4yy+Bkhcs/d4FoeVqDF828r9 | ||
PuKhYGgPOesDrYitfdrrhA5zGDBTOuLA1y3cGoq69U7Kd/2DxXLl+yrGiK1SyMtN | ||
F5LL+pPVUdqKdIfBSoWYeeicBl8KR/KRuLep/fSXBFv6APbpADM4T73EE60wRkLp | ||
oDYai8rqA5Kiy4KVXZO2eB+PGHrR26yKZGxcMzEbv4xnHLILcm5uNlw/hOyCEhqn | ||
gpBUOQwTQ+8Gejlsr12Ha1KEzsHb4LgOxdA6C6L8BWL74Z309scRsLzsU2JzqFIz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Contributing to Ship | ||
|
||
Hello there! First of all, thanks for being interested in ship and helping out. We all think you are awesome, and by contributing to open source projects, you are making the world a better place. That being said, there are a few ways to make the process of contributing code to ship smoother, detailed below: | ||
|
||
### Filing Issues | ||
|
||
If you are opening an issue about a bug, make sure that you include clear steps for how we can reproduce the problem. _If we can't reproduce it, we can't fix it_. If you are suggesting a feature, make sure your explanation is clear and detailed. | ||
|
||
### Getting Set Up | ||
|
||
- Clone the project down | ||
- Make sure [nodejs](http://nodejs.org) has been installed and is above version `0.10.x` | ||
- Run `npm install` | ||
- Put in work | ||
|
||
### Testing | ||
|
||
This project is constantly evolving, and to ensure that things are secure and working for everyone, we need to have tests. If you are adding a new feature, please make sure to add a test for it. The test suite for this project uses [mocha](http://visionmedia.github.io/mocha/) and [should](https://github.com/visionmedia/should.js/)/ | ||
|
||
To run the test suite, make sure you have installed mocha (`npm install mocha -g`), then you can use the `npm test` or simply `mocha` command to run the tests. | ||
|
||
### Code Style | ||
|
||
To keep a consistant coding style in the project, we're using [Polar Mobile's guide](https://github.com/polarmobile/coffeescript-style-guide), with one difference begin that much of this project uses `under_scores` rather than `camelCase` for variable naming. For any inline documentation in the code, we're using [JSDoc](http://usejsdoc.org/). | ||
|
||
### Commit Cleanliness | ||
|
||
It's ok if you start out with a bunch of experimentation and your commit log isn't totally clean, but before any pull requests are accepted, we like to have a nice clean commit log. That means [well-written and clear commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) and commits that each do something significant, rather than being typo or bug fixes. | ||
|
||
If you submit a pull request that doesn't have a clean commit log, we will ask you to clean it up before we accept. This means being familiar with rebasing - if you are not, [this guide](https://help.github.com/articles/interactive-rebase) by github should help you to get started. And if you are still confused, feel free to ask! |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
path = require 'path' | ||
pkg = require '../package.json' | ||
ArgParse = require('argparse').ArgumentParser | ||
EventEmitter = require('events').EventEmitter | ||
util = require 'util' | ||
Ship = require './index' | ||
|
||
###* | ||
* @class CLI | ||
* @classdesc command line interface to sprout | ||
### | ||
|
||
class CLI extends EventEmitter | ||
|
||
###* | ||
* Sets up the arguments and program info through argparse | ||
* @param {Object} opts - additional options, currently only debug | ||
### | ||
|
||
constructor: (opts = {}) -> | ||
@parser = new ArgParse | ||
version: pkg.version | ||
description: pkg.description | ||
debug: opts.debug ? false | ||
|
||
@parser.addArgument ['-to', '--to'], | ||
help: "Where you'd like to deploy your site to" | ||
|
||
@parser.addArgument ['-e', '--env'], | ||
help: "The environment you'd like to deploy to" | ||
|
||
@parser.addArgument ['root'], | ||
nargs: '?' | ||
defaultValue: process.cwd() | ||
help: "Path to the folder you'd like to deploy, defaults to pwd" | ||
|
||
###* | ||
* Execute the deploy through the cli with the provided argument, configuring | ||
* if necessary. | ||
* | ||
* @param {Array|String} args - array or space-separated string of arguments | ||
* @return {Promise} promise for completed and configured deploy | ||
### | ||
|
||
run: (args) -> | ||
if typeof args is 'string' then args = args.split(' ') | ||
args = @parser.parseArgs(args) | ||
try ship = new Ship(root: args.root, deployer: args.to, env: args.env) | ||
catch err then return @emit('err', err) | ||
|
||
if not ship.is_configured() | ||
ship.config_prompt().with(ship) | ||
.then(ship.write_config) | ||
.then(deploy.bind(@, ship)) | ||
else | ||
deploy.call(@, ship) | ||
|
||
###* | ||
* Run a deploy, monitor the progress, and finish up emitting the right info | ||
* through the cli. | ||
* | ||
* @param {Ship} ship - a Ship instance | ||
* @return {Promise} promise for a finished deploy | ||
### | ||
|
||
deploy = (ship) -> | ||
ship.deploy() | ||
.progress(@emit.bind(@, 'info')) | ||
.done (res) => | ||
@emit("success", "deploy to #{res.deployer} successful!") | ||
if res.url then @emit("success", "Live at: #{res.url}") | ||
, @emit.bind(@, 'err') | ||
|
||
module.exports = CLI |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.