From a174db1b27685670d2046e1b7b25284bb91a1050 Mon Sep 17 00:00:00 2001 From: James Gibson Date: Fri, 2 Aug 2019 17:21:09 -0600 Subject: [PATCH 1/3] add more info to readme about remote-image --- readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From ffc07b74bb8bf746a18914c581ebf5bc2b815949 Mon Sep 17 00:00:00 2001 From: James Gibson Date: Fri, 2 Aug 2019 17:23:25 -0600 Subject: [PATCH 2/3] add hostVars, env variable per server --- src/command-handlers.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/command-handlers.js b/src/command-handlers.js index 264202d..f33d326 100644 --- a/src/command-handlers.js +++ b/src/command-handlers.js @@ -97,15 +97,33 @@ 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 } }; + } + } + }); + + console.log('hello0', __dirname) 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`, From 60e873b4ca95b216f701c454e68a460c809a8b12 Mon Sep 17 00:00:00 2001 From: James Gibson Date: Fri, 2 Aug 2019 17:37:46 -0600 Subject: [PATCH 3/3] remove test console.log --- src/command-handlers.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/command-handlers.js b/src/command-handlers.js index f33d326..040eef6 100644 --- a/src/command-handlers.js +++ b/src/command-handlers.js @@ -113,7 +113,6 @@ export function reconfig(api, nodemiral) { } }); - console.log('hello0', __dirname) list.copy('Sending Environment Variables', { src: api.resolvePath(__dirname, 'assets/env.list'), dest: `/opt/${config.name}/config/env.list`,