diff --git a/readme.md b/readme.md index 8725b65..2968fd9 100644 --- a/readme.md +++ b/readme.md @@ -21,6 +21,9 @@ mup init Open the config, and make the following adjustments: +Make sure to add to the plugins section: +- `plugins: ['mup-docker-deploy']` + For each server: - host - Usually is the IP Address of the server - server authentication - You can use a password or set pem to the path to a private key. If neither are set, it uses ssh-agent @@ -31,6 +34,11 @@ In the `app` section: - path: Path to the app, relative to the config. - type: Set to `docker-image` to let mup know that this plugin will manage the app +For deploying from a docker repository: + +- type: Set to `remote-image` to let mup know that this plugin will manage the app +- image: The name of your image with a tag, ex `mycompany/webapp:v3.1.0` + Third, setup the server. Mup will install everything needed to run the app. Run: ```bash diff --git a/src/command-handlers.js b/src/command-handlers.js index 264202d..040eef6 100644 --- a/src/command-handlers.js +++ b/src/command-handlers.js @@ -97,15 +97,32 @@ export function reconfig(api, nodemiral) { env.PORT = exposedPort; + const hostVars = {}; + Object.keys(config.servers).forEach(key => { + if (config.servers[key].env) { + hostVars[servers[key].host] = { env: config.servers[key].env }; + } + if (config.servers[key].settings) { + const settings = JSON.stringify(api.getSettingsFromPath( + config.servers[key].settings)); + if (hostVars[servers[key].host]) { + hostVars[servers[key].host].env.METEOR_SETTINGS = settings; + } else { + hostVars[servers[key].host] = { env: { METEOR_SETTINGS: settings } }; + } + } + }); + list.copy('Sending Environment Variables', { src: api.resolvePath(__dirname, 'assets/env.list'), dest: `/opt/${config.name}/config/env.list`, + hostVars, vars: { env: env || {}, appName: config.name, }, }); - + list.copy('Sending Start Script', { src: api.resolvePath(__dirname, 'assets/start.sh'), dest: `/opt/${config.name}/config/start.sh`,