Skip to content

Commit

Permalink
Merge 81ad97f into 17e176d
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Escalante committed Jul 22, 2014
2 parents 17e176d + 81ad97f commit a7ac305
Show file tree
Hide file tree
Showing 59 changed files with 1,196 additions and 830 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
4 changes: 3 additions & 1 deletion .gitignore
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
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test
src
examples
Makefile
contributing.md
.editorconfig
.travis.yml
9 changes: 8 additions & 1 deletion .travis.yml
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=
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
build:
mv lib src
coffee -o lib -c src
cp -R lib src
coffee -c lib
find lib -iname "*.coffee" -exec rm '{}' ';'

unbuild:
rm -rf lib
Expand Down
5 changes: 5 additions & 0 deletions config.coffee.enc
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
30 changes: 30 additions & 0 deletions contributing.md
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!
34 changes: 25 additions & 9 deletions lib/arg_parser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class ArgsParser
@errors =
missing_deployer: "Make sure to specify a deployer!"
deployer_not_found: "I don't think we have that deployer in stock :("
path_nonexistant: "It doesn't look like you have specified a path to a folder"
path_nonexistant: "It doesn't look like you have specified a path to a
folder"

# ship
if args.length < 1
Expand All @@ -27,10 +28,17 @@ class ArgsParser
if args.length == 1

# if the arg passed is a deployer, assume path is cwd
if is_deployer(args[0]) then return { path: @path, config: find_conf_file(@path, env), deployer: args[0] }
if is_deployer(args[0])
return {
path: @path
config: find_conf_file(@path, env)
deployer: args[0]
}

# if the arg passed is not a deployer, assume it's a path
if not path_exists(args[0]) then return new Error(@errors.path_nonexistant)
if not path_exists(args[0])
return new Error(@errors.path_nonexistant)

config = find_conf_file(args[0], env)
if not config then return new Error(@errors.missing_deployer)
return { path: args[0], config: config, deployer: false }
Expand All @@ -39,14 +47,22 @@ class ArgsParser
if args.length > 1

# two args, both path and deployer must exist
if not path_exists(args[0]) then return new Error(@errors.path_nonexistant)
if not is_deployer(args[1]) then return new Error(@errors.deployer_not_found)
return { path: args[0], config: find_conf_file(@path, env), deployer: args[1] }
if not path_exists(args[0])
return new Error(@errors.path_nonexistant)

if not is_deployer(args[1])
return new Error(@errors.deployer_not_found)

#
return {
path: args[0]
config: find_conf_file(@path, env)
deployer: args[1]
}

#
# @api private
#
#

find_conf_file = (p, env) ->
env = if env? and env != '' then ".#{env}" else ''
p = path.join(p, "ship#{env}.conf")
Expand Down
22 changes: 14 additions & 8 deletions lib/commands/default.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,25 @@ class DefaultCommand
console.error(error.stack.red)
cb(err)

#
#
# @api private
#
#

check_deployer_config = ->
deferred = W.defer()
if @deployer then configure_deployer.call(@, deferred) else deferred.resolve()
if @deployer
configure_deployer.call(@, deferred)
else
deferred.resolve()
return deferred.promise

configure_deployer = (deferred) ->
if not @deployer then return deferred.resolve()
if not @config then return create_conf_with_deployer.call(@, deferred)
if not contains_deployer(@) then return add_deployer_to_conf.call(@, deferred)
if not @deployer
return deferred.resolve()
if not @config
return create_conf_with_deployer.call(@, deferred)
if not contains_deployer(@)
return add_deployer_to_conf.call(@, deferred)
deferred.resolve()

contains_deployer = (t) ->
Expand All @@ -84,7 +90,7 @@ class DefaultCommand
nodefn
.call(async.map, @deployers, (d, cb) => d.configure(@config, cb))
.yield(@deployers)

deploy_async = (deployers) ->
nodefn.call async.map, deployers, (d, cb) ->
if process.env.NODE_ENV == 'test' then d.mock_deploy(cb) else d.deploy(cb)
Expand Down
30 changes: 0 additions & 30 deletions lib/deployers/deployer.coffee

This file was deleted.

68 changes: 0 additions & 68 deletions lib/deployers/dropbox/index.coffee

This file was deleted.

21 changes: 0 additions & 21 deletions lib/deployers/dropbox/readme.md

This file was deleted.

Loading

0 comments on commit a7ac305

Please sign in to comment.