Permalink
Browse files

added use command line item

  • Loading branch information...
1 parent 8164259 commit f5c4ec09d170819b10114e4f923bb94e02889eb0 @crcn crcn committed Dec 5, 2011
Showing with 358 additions and 267 deletions.
  1. +14 −6 README.md
  2. +40 −16 bin/gittyup
  3. +58 −96 lib/app.js
  4. +5 −11 lib/checkout/fs.js
  5. +0 −27 lib/checkout/git
  6. +2 −5 lib/checkout/git.js
  7. +1 −2 lib/checkout/index.js
  8. +3 −6 lib/checkout/slug.js
  9. +5 −11 lib/factory.js
  10. +5 −11 lib/index.js
  11. +1 −2 lib/link/index.js
  12. +6 −12 lib/link/javascript.js
  13. +7 −17 lib/process.js
  14. +12 −25 lib/slug.js
  15. +7 −6 package.json
  16. +192 −14 project.sublime-workspace
View
@@ -1,4 +1,7 @@
-Gittyup is a node.js deplyment library with some slick features:
+Gittyup is a small node.js application deployment library similar to [n]()
+
+
+Gittyup is a node.js app deplyment library with some slick features:
- Rollback support.
- Script testing before using.
@@ -15,12 +18,14 @@ Gittyup is a node.js deplyment library with some slick features:
## Command Line
gup checkout daisy --repo=https://github.com/crcn/daisy.git
+ gup use daisy r5 #use a particular checkout
### Options
- help
- rollback :name Rollback a repositoriy
- history :name Repo history
- checkout :name :repo OR checkout :name checks out a repository
+ help
+ rollback :name Rollback a repositoriy
+ history :name Repo history
+ use :name :release Uses a repo
+ checkout :name :repo OR checkout :name checks out a repository
## Documentation
@@ -73,7 +78,10 @@ First argument can be either a string (app name), or object
* `maxRecords` - Maximum number of application records to keep locally.
-### .app().checkout(source, callback)
+### .app().checkout(opsOrSource, callback)
+
+- `opsOrSource` - Options (object) or the repo source (string) for the app.
+ - `repository` - repository of the project. Can be local directory, git repo, or .slug file
From a git repository:
View
@@ -9,6 +9,7 @@ function gup(app, max) {
return gittyup.app({ name: app, maxRecords: max });
}
+
celeri.onCommand({ command: 'checkout :name :repo OR checkout :name', desc: 'checks out a repository'}, function(request) {
var data = this.data,
@@ -38,6 +39,25 @@ celeri.onCommand({ command: 'checkout :name :repo OR checkout :name', desc: 'che
});
});
+celeri.onCommand({ command: 'use :name :release', desc: 'Uses a repo'}, function(request) {
+
+ var data = this.data, gap = gup(data.name);
+
+ gap.findCheckout({ release: data.release.substr(1) }, function(err, item) {
+ if(!item) return console.error('release does not exist');
+ gap.use(item._id, function(err, item) {
+
+ gap.process(function(err, process) {
+ process.restart(function(err, result) {
+
+ });
+ });
+ });
+ });
+
+
+});
+
celeri.onCommand({ command: 'history :name', desc: 'Repo history'}, function(request) {
var data = this.data,
@@ -46,22 +66,26 @@ celeri.onCommand({ command: 'history :name', desc: 'Repo history'}, function(req
gap.history(function(err, items) {
- items.sort(function(a, b) {
- return a.createdAt > b.createdAt ? 1 : -1;
- });
+ gap.current(function(err, cur) {
+
+ items.sort(function(a, b) {
+ return a.createdAt > b.createdAt ? 1 : -1;
+ });
- celeri.table(items, {
- columns: [{
- name: function(item) {
- return 'r'+item.release;
- }
- },
- {
- name: function(item) {
- return moment(item.createdAt).fromNow()
- }
- }]
- })
+ celeri.table(items, {
+ columns: [{
+ name: function(item) {
+ return (item.release == cur.release ? 'o' : '-')+' r'+item.release;
+ },
+ width: 10
+ },
+ {
+ name: function(item) {
+ return moment(item.createdAt).fromNow()
+ }
+ }]
+ });
+ });
});
});
@@ -85,4 +109,4 @@ celeri.onCommand({ command: 'rollback :name', desc: 'Rollback a repositoriy'}, f
-celeri.parse(process.argv.splice(2));
+celeri.parse(process.argv);
Oops, something went wrong.

0 comments on commit f5c4ec0

Please sign in to comment.