Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 209 lines (125 sloc) 4.35 kb
b92800c0 » travis4all
2012-08-23 :gem: Travis CI image/link in readme :gem:
1 [![build status](https://secure.travis-ci.org/crcn/gittyup.png)](http://travis-ci.org/crcn/gittyup)
374a6687 »
2011-12-09 add ability to set branch to repos
2 Gittyup is a small node.js application deployment library similar to [n](/visionmedia/n).
f5c4ec09 »
2011-12-05 added use command line item
3
4
7b10a308 »
2011-12-05 updated readme
5 ### Features
b41c9f6c »
2011-09-15 testing markdown
6
374a6687 »
2011-12-09 add ability to set branch to repos
7 - Command Line Interface.
c3e9e201 »
2011-09-21 updated readme
8 - Rollback support.
5fd68f8e »
2011-09-21 updated readme
9 - Script testing before using.
c3e9e201 »
2011-09-21 updated readme
10 - Start/Stop/Restart checked out apps.
11 - Make a slug out of your app and easily move it quickly between servers.
b41c9f6c »
2011-09-15 testing markdown
12
13
2d2c8a26 »
2011-12-04 added ability to call gittyup from command line
14 ## Command Line
4d548da2 »
2011-09-21 updated readme
15
374a6687 »
2011-12-09 add ability to set branch to repos
16 gup checkout daisy --repo=https://github.com/crcn/daisy.git --branch=app-branch
f5c4ec09 »
2011-12-05 added use command line item
17 gup use daisy r5 #use a particular checkout
a9189b47 »
2011-12-04 fixed package typo
18
b104f255 »
2011-12-04 added more cli options
19 ### Options
f5c4ec09 »
2011-12-05 added use command line item
20 help
21 rollback :name Rollback a repositoriy
22 history :name Repo history
23 use :name :release Uses a repo
24 checkout :name :repo OR checkout :name checks out a repository
4d548da2 »
2011-09-21 updated readme
25
2ace2b47 »
2011-09-21 updated readme
26 ## Documentation
4d548da2 »
2011-09-21 updated readme
27
28
2ace2b47 »
2011-09-21 updated readme
29 ### .gittyup(rootDirectory)
4d548da2 »
2011-09-21 updated readme
30
31 root directory by default is /etc/gittyup/
66ae3a5a »
2011-09-18 initial push
32
33 ```javascript
34
4d548da2 »
2011-09-21 updated readme
35 var gittyup = require('gittyup')('/etc/bonsai/garden/'),
36 app = gittyup.app('myApp');
66ae3a5a »
2011-09-18 initial push
37
38
4d548da2 »
2011-09-21 updated readme
39 app.checkout('myProjectSource', function(err, result)
66ae3a5a »
2011-09-18 initial push
40 {
f247f2de »
2011-09-21 added readme
41
42 //something went wrong in the checkout phase - most likely in linking, rollback
d613a871 »
2011-10-26 print args
43 if(err) return app.rollback();
44
4d548da2 »
2011-09-21 updated readme
45
46 //test to make sure everythings good
47 app.test(function(err, result)
66ae3a5a »
2011-09-18 initial push
48 {
f247f2de »
2011-09-21 added readme
49 //something went wrong in the testing phase, rollback
4d548da2 »
2011-09-21 updated readme
50 if(err) return app.rollback();
51
52
f247f2de »
2011-09-21 added readme
53 //start upp the application
4d548da2 »
2011-09-21 updated readme
54 app.process(function(err, process)
66ae3a5a »
2011-09-18 initial push
55 {
4d548da2 »
2011-09-21 updated readme
56 process.start();
57 });
66ae3a5a »
2011-09-18 initial push
58 });
6f5b4b7f »
2011-09-20 don't use beet.
59 });
60
4d548da2 »
2011-09-21 updated readme
61 //...
62
63 ```
6f5b4b7f »
2011-09-20 don't use beet.
64
66ae3a5a »
2011-09-18 initial push
65
2ace2b47 »
2011-09-21 updated readme
66 ### .app(ops)
66ae3a5a »
2011-09-18 initial push
67
4d548da2 »
2011-09-21 updated readme
68 First argument can be either a string (app name), or object
69
2ace2b47 »
2011-09-21 updated readme
70 #### arguments
4d548da2 »
2011-09-21 updated readme
71
a3635ee1 »
2011-09-21 updated readme
72 * `name` - The name of the application.
73 * `group` - The group the application is in.
74 * `maxRecords` - Maximum number of application records to keep locally.
4d548da2 »
2011-09-21 updated readme
75
76
f5c4ec09 »
2011-12-05 added use command line item
77 ### .app().checkout(opsOrSource, callback)
78
79 - `opsOrSource` - Options (object) or the repo source (string) for the app.
80 - `repository` - repository of the project. Can be local directory, git repo, or .slug file
4d548da2 »
2011-09-21 updated readme
81
82 From a git repository:
83
84 ```javascript
85
86 gittyup.app('myApp').checkout('git@github.com:spiceapps/gittyup-test.git', function(err, result)
6f5b4b7f »
2011-09-20 don't use beet.
87 {
4d548da2 »
2011-09-21 updated readme
88 //do stuff!
6f5b4b7f »
2011-09-20 don't use beet.
89 });
90
4d548da2 »
2011-09-21 updated readme
91 ```
92
93 From a generated slug:
94
95 ```javascript
6f5b4b7f »
2011-09-20 don't use beet.
96
4d548da2 »
2011-09-21 updated readme
97 gittyup.app('myApp').checkout('http://mydomain.com/someApp.slug', function(err, result)
6f5b4b7f »
2011-09-20 don't use beet.
98 {
66ae3a5a »
2011-09-18 initial push
99 });
6f5b4b7f »
2011-09-20 don't use beet.
100
4d548da2 »
2011-09-21 updated readme
101 ```
102
103 From a local directory:
104
105 ```javascript
106
107 gittyup.app('myApp').checkout('/some/local/path', function(err, result)
108 {
109
110 });
111
112 ```
113
2ace2b47 »
2011-09-21 updated readme
114 ### .app().process(callback)
4d548da2 »
2011-09-21 updated readme
115
5fd68f8e »
2011-09-21 updated readme
116 Returns a runnable process of the current checked out item.
4d548da2 »
2011-09-21 updated readme
117
118
119 ````javascript
120
121
122 gittyup.app('myApp').process(function(err, process)
123 {
124
125 process.start(function(err, result)
126 {
127 //...
128 });
129
130 process.stop(function(err, result)
131 {
132 //...
133 });
134
135 process.restart(function(err, result)
136 {
137 //...
138 });
139 });
140
141
142 ```
143
144 #### .app().test(callback)
145
146 Tests the most recent checked out item. Make sure to include "scripts:test" in your package.json. Something like:
147
148 ```javascript
149
150
151 {
152 "name": "myApp",
153
154 "scripts": {
155 "test": "./test"
156 }
157 }
6f5b4b7f »
2011-09-20 don't use beet.
158 ````
4d548da2 »
2011-09-21 updated readme
159
160 When exiting the test program, an exit code of 0 tells gittyup the test was successful, whereas 1 tells gittyup the test failed.
161
22819cc3 »
2011-09-21 changed order of methods
162 ### .app().makeSlug(callback)
163
5fd68f8e »
2011-09-21 updated readme
164 Makes a slug out of the current checkout. Use this method if you need to move the application around between servers.
22819cc3 »
2011-09-21 changed order of methods
165 Once a slug is made, calling "makeSlug" on the same checkout will have no effect.
166
167
168 ```javascript
169
170 gittyup.app('myApp').makeSlug(function(err, item)
171 {
172 console.log(item.slug); // /etc/gittyup/apps/myApp/16767565434/slug/753a644f4e7aaa7fc9132be92d000002.tar.gz
c3e9e201 »
2011-09-21 updated readme
173
22819cc3 »
2011-09-21 changed order of methods
174 });
175
176 ```
4d548da2 »
2011-09-21 updated readme
177
c3e9e201 »
2011-09-21 updated readme
178 If you're moving the slug around, install gittyup on the other end and have something ready like this:
179
180 ```javascript
181
182 gittyup.app('myApp').checkout('http://myServer.com/myApp.slug', function(err, result)
183 {
184 //...do stuff with transported slug
185 })
186
187 ```
188
189
190
4d548da2 »
2011-09-21 updated readme
191 ### .app().current(callback)
192
193 Returns Information about the current checked out item.
194
195 ### .app().history(callback)
196
197 Returns checkout history of the given application.
198
199 ### .app().use(checkoutId)
200
201 Uses a previously used checkout item without removing the current one.
202
203 ### .app().remove(checkoutId, callback)
204
205 Removes a checked out item.
206
207 ### .app().destroy(callback)
208
209 Destroys the application, and all the checked out items.
210
211
212
213
Something went wrong with that request. Please try again.