{"_id":"54b361b1d8ea260b00e4e5eb","__v":1,"user":"54a3af95ad78941600ca2e2a","category":{"_id":"54b35d91aad2810b009507d8","pages":["54b35fe473abe90b00106f78","54b361b1d8ea260b00e4e5eb"],"version":"54b2c93f336cfb0b00608c28","__v":2,"project":"54b2c91287873d1f00dbebdb","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-01-12T05:37:21.902Z","from_sync":false,"order":1,"slug":"running-services","title":"Running Services"},"version":{"_id":"54b2c93f336cfb0b00608c28","forked_from":"54b2c91287873d1f00dbebde","project":"54b2c91287873d1f00dbebdb","__v":4,"createdAt":"2015-01-11T19:04:31.031Z","releaseDate":"2015-01-11T19:04:31.031Z","categories":["54b2c93f336cfb0b00608c29","54b2cb87db3c741400eac8c2","54b35d86aad2810b009507d7","54b35d91aad2810b009507d8"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.4.0","version":"0.4.0"},"project":"54b2c91287873d1f00dbebdb","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-01-12T05:54:57.291Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Whats Running?\"\n}\n[/block]\nTo see everything that is currently running, use the ps command:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"bosco ps\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nkzWQmjtQq2BUvVezGt1_Screen%20Shot%202015-01-12%20at%2005.59.39.png\",\n        \"Screen Shot 2015-01-12 at 05.59.39.png\",\n        \"1552\",\n        \"962\",\n        \"#a47f87\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Repository Regex\"\n}\n[/block]\nAlmost all commands allow you to specify any part of the repository name as a filter.  For example, if you have the following repositories:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"app-resource\\nservice-resource-author\\nservice-resource-reviews\\nservice-resource-list\\napp-resource-uploader\\nservice-resource-preview\\ninfra-mongodb\\ninfra-redis\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nYou can target them individually like follows:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"bosco run -r mongodb\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThis will start just **infra-mongodb**.  Whatever you provide to the -r parameter is converted to a regexp that is applied to the service name.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Tags\"\n}\n[/block]\nIn the bosco-service.json you can provide 'tags' that allow you to logically group pieces of your projects together.\n\nFor example, see the bosco-service.json file for a core project that is the backend of one of our largest pages:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"service\\\": {\\n        \\\"name\\\": \\\"app-resource\\\"\\n    },\\n    \\\"tags\\\": [\\\"upload\\\", \\\"summary\\\", \\\"author\\\"],\\n    \\\"build\\\":{\\n        \\\"command\\\":\\\"node_modules/.bin/gulp build\\\",\\n        \\\"watch\\\": {\\n            \\\"command\\\":\\\"node_modules/.bin/gulp\\\",\\n            \\\"ready\\\":\\\"Finished 'default'\\\"\\n        }\\n    },\\n    \\\"assets\\\": {\\n        \\\"basePath\\\": \\\"/src/public\\\",\\n        \\\"js\\\": {\\n            \\\"bottom\\\": [\\n                \\\"js/resources.js\\\",\\n                \\\"js/favourite.js\\\"\\n            ],\\n            \\\"bottom-v2\\\": [\\n                \\\"js/lib/adyen.encrypt.js\\\",\\n                \\\"js/lib/jquery.payment.js\\\",\\n                \\\"js/tes-resource.js\\\"\\n            ]\\n        },\\n        \\\"css\\\": {\\n            \\\"main\\\": [\\n                \\\"css/summary.css\\\",\\n                \\\"css/file-types.css\\\",\\n                \\\"css/form-elements.css\\\",\\n\\t\\t\\t\\t        \\\"css/favourite.css\\\"\\n            ],\\n            \\\"main-v2\\\": [\\n                \\\"css/main.css\\\"\\n            ]\\n        },\\n        \\\"img\\\": {\\n            \\\"edamame\\\":[\\n                \\\"img/lg-share-en.gif\\\",\\n                \\\"img/file-types.png\\\",\\n                \\\"img/form-elements.png\\\",\\n\\t\\t\\t\\t        \\\"img/favourite_sprite.png\\\"\\n            ]\\n        }\\n    }\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe tags defined within this project are:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"tags\\\": [\\\"upload\\\", \\\"summary\\\", \\\"author\\\"]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThis now gives you the ability to start this project with the following commands:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"bosco run -t summary\\nbosco run -t upload\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Watching Projects\"\n}\n[/block]\nBy default, bosco does not watch projects for changes.  The reason for this is performance - it often starts a large number of projects, and we found that watching all of them by default would slow people down too much.\n\nSo, to watch a project, simply provide the additional -w parameter (which is a regexp in the same way that the -r parameter is):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"bosco run -t summary -w app-resource\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThis will run all the projects with the summary tag, and put the app-resource project into watch mode - e.g. this is the project that you will actually be making changes to.  This change is then reflected in bosco ps:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Of0uYfNGRJu3cFy2njcc_Screen%20Shot%202015-01-12%20at%2006.06.54.png\",\n        \"Screen Shot 2015-01-12 at 06.06.54.png\",\n        \"1546\",\n        \"1010\",\n        \"#052d35\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"Some helpful tips for daily use when using Bosco to run stuff.","slug":"tips-and-tricks","type":"basic","title":"Tips and Tricks"}

Tips and Tricks

Some helpful tips for daily use when using Bosco to run stuff.

[block:api-header] { "type": "basic", "title": "Whats Running?" } [/block] To see everything that is currently running, use the ps command: [block:code] { "codes": [ { "code": "bosco ps", "language": "text" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/nkzWQmjtQq2BUvVezGt1_Screen%20Shot%202015-01-12%20at%2005.59.39.png", "Screen Shot 2015-01-12 at 05.59.39.png", "1552", "962", "#a47f87", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Repository Regex" } [/block] Almost all commands allow you to specify any part of the repository name as a filter. For example, if you have the following repositories: [block:code] { "codes": [ { "code": "app-resource\nservice-resource-author\nservice-resource-reviews\nservice-resource-list\napp-resource-uploader\nservice-resource-preview\ninfra-mongodb\ninfra-redis", "language": "text" } ] } [/block] You can target them individually like follows: [block:code] { "codes": [ { "code": "bosco run -r mongodb", "language": "text" } ] } [/block] This will start just **infra-mongodb**. Whatever you provide to the -r parameter is converted to a regexp that is applied to the service name. [block:api-header] { "type": "basic", "title": "Tags" } [/block] In the bosco-service.json you can provide 'tags' that allow you to logically group pieces of your projects together. For example, see the bosco-service.json file for a core project that is the backend of one of our largest pages: [block:code] { "codes": [ { "code": "{\n \"service\": {\n \"name\": \"app-resource\"\n },\n \"tags\": [\"upload\", \"summary\", \"author\"],\n \"build\":{\n \"command\":\"node_modules/.bin/gulp build\",\n \"watch\": {\n \"command\":\"node_modules/.bin/gulp\",\n \"ready\":\"Finished 'default'\"\n }\n },\n \"assets\": {\n \"basePath\": \"/src/public\",\n \"js\": {\n \"bottom\": [\n \"js/resources.js\",\n \"js/favourite.js\"\n ],\n \"bottom-v2\": [\n \"js/lib/adyen.encrypt.js\",\n \"js/lib/jquery.payment.js\",\n \"js/tes-resource.js\"\n ]\n },\n \"css\": {\n \"main\": [\n \"css/summary.css\",\n \"css/file-types.css\",\n \"css/form-elements.css\",\n\t\t\t\t \"css/favourite.css\"\n ],\n \"main-v2\": [\n \"css/main.css\"\n ]\n },\n \"img\": {\n \"edamame\":[\n \"img/lg-share-en.gif\",\n \"img/file-types.png\",\n \"img/form-elements.png\",\n\t\t\t\t \"img/favourite_sprite.png\"\n ]\n }\n }\n}\n", "language": "json" } ] } [/block] The tags defined within this project are: [block:code] { "codes": [ { "code": "\"tags\": [\"upload\", \"summary\", \"author\"]", "language": "json" } ] } [/block] This now gives you the ability to start this project with the following commands: [block:code] { "codes": [ { "code": "bosco run -t summary\nbosco run -t upload", "language": "text" } ] } [/block] [block:api-header] { "type": "basic", "title": "Watching Projects" } [/block] By default, bosco does not watch projects for changes. The reason for this is performance - it often starts a large number of projects, and we found that watching all of them by default would slow people down too much. So, to watch a project, simply provide the additional -w parameter (which is a regexp in the same way that the -r parameter is): [block:code] { "codes": [ { "code": "bosco run -t summary -w app-resource", "language": "text" } ] } [/block] This will run all the projects with the summary tag, and put the app-resource project into watch mode - e.g. this is the project that you will actually be making changes to. This change is then reflected in bosco ps: [block:image] { "images": [ { "image": [ "https://files.readme.io/Of0uYfNGRJu3cFy2njcc_Screen%20Shot%202015-01-12%20at%2006.06.54.png", "Screen Shot 2015-01-12 at 06.06.54.png", "1546", "1010", "#052d35", "" ] } ] } [/block]