• Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    CoffeeScript
  • License
    Other
  • Created about 11 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⛔️ currently unmaintained ⛔️

Ship

npm tests coverage dependencies

Multi-platform deployment with node.

We are no longer supporting the ship project.

Explanation: We have found that supporting these different deployment platforms is too difficult for us to keep up with right now. We may re-start this project in the future, but for now you should use it at your own risk

Why should you care?

If you often need to deploy files quickly to bunch of different platforms, or you have an app or library written in node and would like to give your users the ability to deploy files to a variety of platforms, ship is probably what you are looking for.

Ship is small library that deploys files smoothly to the platforms listed below:

And many more coming soon, like:

  • Linux VPS
  • FTP
  • Divshot
  • Tumblr
  • Dropbox
  • SiteLeaf
  • Email

Ship is also built on the adapter pattern, so if there's another platforms you'd like to deploy to, the project structure is easy to understand, and you can write a deployer, send a pull request, and we'd be happy to include it.

Installation

npm install ship -g

Usage

If you are using ship directly for your own deployments, its primary interface is through the command line. If you'd like to integrate it into your node app, skip to the section below on the javascript API.

The command line interface is simple -- just follow the format below

ship /path/to/folder -to deployer-name

For example, if I wanted to ship my desktop via s3 to my server (why? no idea), I could run ship /Users/jeff/Desktop -to s3. Ship would then prompt me for authentication details if needed, and send the files off to their destination. It will also place a file called ship.conf in the root of the folder you shipped, and if you have a gitignore, add it to your gitignore because you don't want to commit your sensitive information. Next time you ship it, you won't need to enter your details because they are already saved to that file.

After the first time running ship on a folder, you can skip the deployer name if you'd like to deploy to the same target. If you have deployed the same folder to multiple targets and you run it without the deployer argument, ship will deploy to all targets.

Finally, if you are inside the folder you want to deploy, you can run ship without the path argument. If you name your folder the same thing as one of the deployers, things will get confused, so don't do that please.

Available deployers are as such (linked to the documentation for authentication details, if needed):

ship.conf

This is a simple file used by ship to hold on to config values for various platforms. It's a yaml file and is quite straightforward. An example might look like this, if it was configured for amazon s3.

s3:
  access_key: 'xxxx'
  secret_key: 'xxxx'

If there are other network configs, they appear namespaced under the deployer name in a similar manner.

If you want to deploy to multiple environments, you can do this. Just drop an environment name after "ship" and before ".conf" like this: ship.staging.conf, and provide the environment in your command, like this ship -e staging, and ship will look for the appropriate environment file and use that.

Finally, some deployers support built in 'ignores'. If you'd like to ignore a file or folder from the deploy process, just add an ignore array to the ship.conf file and fill it with minimatch-compatible strings. Any deployer that supports ignores will automatically ignore ship*.conf because you do not want to deploy that file, ever.

Javascript API

The interface is fairly straightforward. An example is below. Please note that this is not a working example to be pasted into your project, it's a walkthrough of the public API at a high level.

// First thing's first, let's create a new instance of Ship with the deployer we
// want to deploy with and the folder we want to be deployed.

var Ship = require('ship');
var project = new Ship({ root: 'path/to/folder', deployer: 's3' });

// First, you might want to make sure the deployer has been configured. This
// means that either there's a yaml file at the project root called `ship.conf`
// with the relevant config details for that deployer, or you have manually
// configured the instance. You can quickly check whether the deployer has been
// configured or not as such:

project.is_configured(); // returns a boolean

// If the deployer has been configured already as indicated above, you can skip
// the part below discussing manual configuration. If it has not however, you
// need to manually configure the deployer. You can do this by calling
// `configure` directly with the config values as such:

project.configure({ token: 'xxxx', secret: 'xxxx' });

// Or you can use ship's command line prompt to collect the info. This method is
// async and returns a promise.

project.config_prompt()
  .then(function(){ console.log('configured!'); });

// You might want to write the details to a `ship.conf` file once they have been
// collected so you don't need to continually input them. A convenience method
// will do this for you quickly, and try to add `ship.conf` to a `.gitignore` if
// there is one present, since you don't want to deploy or push it.

project.write_config();

// To actually deploy, just call project.deploy(). This returns a promise so
// you know when it's done. It also emits progress events along the way, since
// some deployments take a while and you might want to keep track of progress.

// If you want to deploy a directory different than the root you passed to the
// ship constructor, pass the path in as an argument to the deploy function. If
// you don't it will just deploy the root passed to the constructor.

project.deploy('path/to/folder/public')
  .progress(console.log.bind(console))
  .done(function(res){
    console.log('successfully deployed!');
    console.log(res);
  }, function(err){
    console.log('there was an error : (');
    console.log(err);
  });

// The response returned by the deployer contains as much useful information as
// possible. If possible, it will contain a `url`, so you can open up the site
// and check it on the spot. Each deployer has a slightly different response,
// you can find more specific details in that deployer's docs.

So in summary, require ship, initialize it with a folder and deployer, make sure it's configured, run deploy, then celebrate great success!

License & Contributing

Ship is licensed under MIT. See contributing.md for more information on contributing to ship.

More Repositories

1

share-button

⚠️ ⚠️ Currently Unmaintained ⚠️ ⚠️ - fast, beautiful, and painless social shares:
JavaScript
2,958
star
2

sprout

🌱 simple project templating & skeletons
JavaScript
86
star
3

roots-contentful

A roots extension to work with data from Contentful's API. https://www.contentful.com/
CoffeeScript
82
star
4

sprout-static-cms

A sprout template for building a static CMS with Roots, Contentful, and Netlify.
CoffeeScript
54
star
5

globtester

A little tool for testing minimatch
CSS
53
star
6

roots-wordpress

Pull your wordpress posts into a roots project
CoffeeScript
45
star
7

roots-dynamic-content

Dynamic content extension for roots v3
CoffeeScript
34
star
8

roots-www

Shiny new website for roots v3
HTML
29
star
9

tumblr-theme-parser

a Tumblr theme parser / compiler
CoffeeScript
28
star
10

we-are-hiring

the current dev positions available at carrot
Shell
26
star
11

terraform-api-gateway-cors-module

Terraform modules which creates an OPTIONS method and apply CORS configuration for a resource in API Gateway.
HCL
26
star
12

go-pinterest

A Go client for the Pinterest API
Go
26
star
13

recycler-core

Multiple view type handling in RecyclerViews with 90% less tears
Java
25
star
14

roots-records

Parse JSON conveniently as roots locals to be used with any template engine.
CoffeeScript
24
star
15

gulp-accord

Simple unified interface for compiling js languages with gulp
CoffeeScript
24
star
16

charge

A bundle of useful middleware and tools for serving static sites
CoffeeScript
22
star
17

burrow

⚡ Carrot's base API scaffolding for Go
Go
22
star
18

roots-browserify

Roots v3 extension that uses browserify as a javascript pipeline
CoffeeScript
21
star
19

roots-wordpress-example

Roots can turn a wordpress site into a static site. Here's how.
CoffeeScript
17
star
20

p3p

This gem simply inserts P3P headers into IE responses allowing your application to serve cookies when within an iframe.
Ruby
17
star
21

roots-cms

easily manage roots dynamic content in your browser
CoffeeScript
16
star
22

roots-client-templates

Roots v3 extension that precompiles templates for the client side
CoffeeScript
15
star
23

hygienist-middleware

Providing clean urls for static sites since 1776
CoffeeScript
14
star
24

android-social-ui

a library of android widgets that work well for social apps
Java
14
star
25

terraform-api-gateway-method-module

Ease the pain of resourcing an API Gateway method.
HCL
14
star
26

restful-api-spec

Carrots spec/process for building RESTful APIs
14
star
27

roots-yaml

Load YAML data files into your roots project
CoffeeScript
12
star
28

rooftop-node

A node api client for rooftop cms
JavaScript
11
star
29

roots-js-pipeline

sprockets-y js build extension for roots
CoffeeScript
10
star
30

roots-netlify

Configure your Netlify hosted Roots project
CoffeeScript
10
star
31

ash-github

An Ash module that interfaces with the Github API
Shell
10
star
32

android-animation-arsenal

Arsenal of Animations for Android - Makes your life easier. The library works hard for you so you don't waste precious time implementing animations.
Java
9
star
33

roll

A simple, extensible parallax library.
JavaScript
9
star
34

roots-template-blog

A roots template for a very simple markdown blog
CSS
9
star
35

roots-config

Simple configuration for roots, shared throughout the whole project
CoffeeScript
8
star
36

roots-buildpack

A Heroku buildpack for static sites built with Roots
Shell
8
star
37

accord-cli

compile any language from the command line
CoffeeScript
8
star
38

apology-middleware

delivering custom error pages since 1919
CoffeeScript
8
star
39

skrilla

A clean JS object based interface to the skrollr animation library
JavaScript
7
star
40

roots-util

a tool for simplifying roots extensions
CoffeeScript
7
star
41

roots-css-pipeline

get your css together
CoffeeScript
7
star
42

cream

An extremely flexible caching library for Android.
Java
7
star
43

roots-template-react

A basic roots template for building react apps
CSS
6
star
44

sprout-cli

command-line interface for sprout
JavaScript
6
star
45

roots-webpack

webpack extension for roots
CoffeeScript
6
star
46

pergola

Tame the Vine API with Pergola
Ruby
5
star
47

sprout-node

Base template for node projects
JavaScript
5
star
48

base

base template for roots.cx
CoffeeScript
5
star
49

parm-genie

A sandbox PARM app.
CoffeeScript
4
star
50

sprout-roots-marionette

Sprout template for roots v3 paired with marionette and browserify
CoffeeScript
4
star
51

roots-inline-css

a roots extension for inlining your CSS properties into the style attribute in an html file
CoffeeScript
4
star
52

sprout-es2015

A simple starter template for node/es2015 projects
JavaScript
4
star
53

carrot-traffic-control

a way to better understand the work you've staged
4
star
54

10k-stopwatch

A start/stop time tracker that hooks into 10kft
CoffeeScript
4
star
55

contentful-migrations

Programmatic content model migrations for contentful
JavaScript
4
star
56

alchemist-middleware

Procuring static files since 1802
CoffeeScript
4
star
57

salty-carrots

Salt Stack based provisioning for Carrot Creative servers
Shell
4
star
58

roots-tumblr

A roots extension to make building Tumblr themes less awful
CoffeeScript
4
star
59

sprout-roots-extension

a sprout template for creating roots extensions
CoffeeScript
4
star
60

roots-react-playground

just messing with react a little bit
CSS
3
star
61

static-hybrid-example

An example of splitting API content between static and dynamic using Carrot's public API
CSS
3
star
62

hw

Hemingway is a tool to easily create, manage, run, and collaborate on miscellaneous tasks.
Ruby
3
star
63

sprout-gcore

A Sprout template for gcore
CoffeeScript
3
star
64

roots-component

component functionality for roots
CoffeeScript
3
star
65

publicist-middleware

locking static sites down since 1888
CoffeeScript
3
star
66

gcore

⛔️ no longer maintained. see -> https://github.com/carrot/go-base-api
Go
3
star
67

archivist-middleware

Providing the highest quality browser cacheing since 1824
CoffeeScript
3
star
68

escapist-middleware

Making trapdoors for secret files since 1748
CoffeeScript
3
star
69

pathologist-middleware

Handling custom static routes since 1967
JavaScript
3
star
70

pg-backup

a small tool for backing up postgres databases to backblaze b2
JavaScript
3
star
71

sprout-sprout

a sprout template for creating sprout templates
CoffeeScript
3
star
72

share-button-bower

share-button distribution resources for bower
JavaScript
3
star
73

polytest

Run multiple tests with multiple different package.json files
CoffeeScript
2
star
74

bash-hockey-puck

⛔️ no longer maintained. see ->
Shell
2
star
75

swap

The easy way to switch between popular android applications
Java
2
star
76

language-coil

Coil support for http://atom.io
CoffeeScript
2
star
77

Shortcake

Parsing shortcodes in Java - easy as... cake!
Java
2
star
78

sprout-roots-tumblr

a sprout/roots template for building tumblr themes with roots
HTML
2
star
79

sprout-www

a docs site for sprout
CSS
2
star
80

android-typeface-views

Android views with out of the box custom font support
Java
2
star
81

sprout-hull

Sprout template utlizing Roots & Hull
CoffeeScript
1
star
82

roots-ignore

Set up ignore rules for your roots project for speedier compiles.
CoffeeScript
1
star
83

roots-yell

a sample roots extension for v3
CoffeeScript
1
star
84

slapp-nag

nag feature for slapp-based slackbots
JavaScript
1
star
85

sprout-middleware

A sprout template for creating connect/express middleware
CoffeeScript
1
star
86

carrot-api-client-base

Node client base implementation of https://github.com/carrot/restful-api-spec
JavaScript
1
star
87

roots-buildpack-sample

A sample Roots site for testing roots-buildpack
HTML
1
star
88

ble-example-android

Java
1
star
89

ash-slapshot

An Ash module for building + uploading to HockeyApp
Shell
1
star
90

tumblroots

Building a Tumblr Theme on Roots? Start Here!
CSS
1
star
91

senior-dibs-a-bot

a cool bot to use in the free for all channel that makes sure people aren't winning more than they should
JavaScript
1
star
92

sprout-gulp-browserify

Leveraging useful Gulp recipes and the power of browserify to create a nice front-end workflow
CoffeeScript
1
star
93

sprout-example

an example sprout template to demonstrate sprout's features
CoffeeScript
1
star