0

Was looking at the docs to set up a few apps deployed to strong-pm but ran into a cart-before-the-horse type issue:

It's not possible to set environment variables using slc ctl env-set <service> FOO=bar... before an app is deployed and given a service name.

This means that you are forced to run your app initially in a failure state upon first deploy, which is inconvenient and probably not a huge deal, but was curious if this is known.

Would be awesome if the slc ctl env-set command could set up a service name just like slc deploy does, but without the deploy itself.

As an aside, was curious if slc pm-install/sl-pm-install -e "FOO=bar" actually works to set common/shared/global env vars, but I couldn't find where these vars were set when the command was run.

notbrain
  • 3,366
  • 2
  • 32
  • 42

1 Answers1

1

When you deploy an app for the first time it auto-creates a service if one doesn't exist as part of the process. This can also be done manually with slc ctl create default. If you do that manually, you can modify the environment with slc ctl env-set default FOO=bar BAR=foo before running slc deploy.

Note that default is just a name, and if you want to use a name other then default you will have to specify it when you deploy with slc deploy -s customName since default is the default name.

Ryann Graham
  • 8,079
  • 2
  • 29
  • 32
  • Ran into a strange state where I used `slc ctl create svcname` and ended up with 2 services when I used `slc deploy -s svcname`. One was #3 and the other #4, neither of them were started. – notbrain Jun 19 '15 at 00:52
  • Doesn't seem like this is that robust yet...I used `slc create` and then `slc deploy` using the same service name, but still have strange behavior with `env-set`. Some env vars are remembered across `slc ctl remove` ops, which is unexpected. I'm still racing to set env vars so my app doesn't stall with a bunch of mongo conn failures at boot, making it impossible to use `slc ctl` for anything; just get "socket hang up" after 90s or so... – notbrain Jun 19 '15 at 01:47
  • @Brian can you open an issue? https://github.com/strongloop/strong-pm/issues (including `slc version` from the client and `sl-pm --version` from the server) – Ryann Graham Jun 19 '15 at 06:38