0.1.4 • Published 9 years ago
roc-plugin-marathon-deploy v0.1.4
roc-plugin-marathon-deploy
Deploy to Marathon with ease.
Prerequisite
Install
$ npm i --save-dev roc-plugin-marathon-deploy
Usage
Deploy
# Will use marathon.production.json
$ roc deploy --production
# Will use marathon.staging.json
$ roc deploy --staging
List all options available
$ roc deploy --help
Roc config
module.exports = {
settings: {
deploy: {
docker: {
registry: 'docker.registry.url',
imageName: 'my-image-name' // used in marathon.json and docker
},
marathon: {
config: {} // Pass marathon config as an object instead of using a local file
}
}
}
};
Marathon config
At the moment you need to provide a marathon.production.json and marathon.staging.json file.
This will be moved to the plugin later on.
Example config
{
"endpoint": "http://marathon.endpoint.no",
"container": {
"type": "DOCKER",
"docker": {
"image": "{marathon.image}", // Name defined in roc.config.js
"portMappings": [
{
"containerPort": 3000,
"hostPort": 0,
"protocol": "tcp"
}
],
"network": "BRIDGE"
},
"volumes" : []
},
"healthChecks": [
{
"portIndex": 0,
"protocol": "HTTP",
"path": "/",
"gracePeriodSeconds": 60,
"intervalSeconds": 5,
"timeoutSeconds" : 10,
"maxConsecutiveFailures": 3
}
],
"id": "/my-app-name.production", // for staging '/my-app-name.staging'
"instances": 1,
"cpus": 1,
"mem": 128,
"ports": [0],
"env": {
"NODE_ENV": "production",
"PORT": "3000"
}
}
Dockerfile
Remember to provide a dockerfile.