Tips and Tricks

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

Whats Running?

To see everything that is currently running, use the ps command:

bosco ps
1552

Repository Regex

Almost all commands allow you to specify any part of the repository name as a filter. For example, if you have the following repositories:

app-resource
service-resource-author
service-resource-reviews
service-resource-list
app-resource-uploader
service-resource-preview
infra-mongodb
infra-redis

You can target them individually like follows:

bosco run -r mongodb

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.

Tags

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:

{
    "service": {
        "name": "app-resource"
    },
    "tags": ["upload", "summary", "author"],
    "build":{
        "command":"node_modules/.bin/gulp build",
        "watch": {
            "command":"node_modules/.bin/gulp",
            "ready":"Finished 'default'"
        }
    },
    "assets": {
        "basePath": "/src/public",
        "js": {
            "bottom": [
                "js/resources.js",
                "js/favourite.js"
            ],
            "bottom-v2": [
                "js/lib/adyen.encrypt.js",
                "js/lib/jquery.payment.js",
                "js/tes-resource.js"
            ]
        },
        "css": {
            "main": [
                "css/summary.css",
                "css/file-types.css",
                "css/form-elements.css",
                        "css/favourite.css"
            ],
            "main-v2": [
                "css/main.css"
            ]
        },
        "img": {
            "edamame":[
                "img/lg-share-en.gif",
                "img/file-types.png",
                "img/form-elements.png",
                        "img/favourite_sprite.png"
            ]
        }
    }
}

The tags defined within this project are:

"tags": ["upload", "summary", "author"]

This now gives you the ability to start this project with the following commands:

bosco run -t summary
bosco run -t upload

Watching Projects

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):

bosco run -t summary -w app-resource

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:

1546