Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for server environment variables in deploy.rb, (:env_vars) #161

Merged
merged 1 commit into from
Jan 23, 2015

Conversation

pricees
Copy link
Contributor

@pricees pricees commented Jan 10, 2014

Users may specify environment variables, as a string, to be passed to the ssh commands.

Idea: Our app is ported from a heroku environment. To use nina effectively, in the 12-factor-app paradigm, we need to be able to pass values at deploy time.

# deploy.rb

set :env_vars, "foo=1 bar=baz"

# .env stores key-value pairs
set :env_vars, { File.open(".env").readlines.map(&:chomp).join(" ") }

@pedroassumpcao
Copy link

Nice stuff.

@fnando
Copy link

fnando commented Apr 16, 2014

+1

3 similar comments
@aoqfonseca
Copy link

+1

@brain-geek
Copy link

+1

@mhluska
Copy link

mhluska commented Jan 23, 2015

+1

d4be4st added a commit that referenced this pull request Jan 23, 2015
Adding support for server environment variables in deploy.rb, (:env_vars)
@d4be4st d4be4st merged commit 406bf76 into mina-deploy:master Jan 23, 2015
@mhluska
Copy link

mhluska commented Jan 23, 2015

This doesn't seem to be working. I'm getting:

bash: line 0: export: `-t': not a valid identifier
       bash: line 0: export: `--': not a valid identifier
       bash: line 0: export: `-----> Using RVM environment 'ruby-2.1.5@default'': not a valid identifier

Using the --simulate flag gives:

#!/usr/bin/env bash
# Executing the following via 'ssh [...] -p [...] export RACK_ENV=production -t':
#

@pricees
Copy link
Contributor Author

pricees commented Jan 23, 2015

Not sure under what context you are using it. Also, it's been a year since that pull request, have things changed?

@mhluska
Copy link

mhluska commented Jan 23, 2015

Unless I'm missing something, $ ssh [hostname] -p [port] export RACK_ENV=production -t is invalid syntax.

@pricees
Copy link
Contributor Author

pricees commented Jan 23, 2015

:( --- It worked. Once. My contribution is for not. Close the PR, then.

d4be4st added a commit that referenced this pull request Jan 24, 2015
@d4be4st
Copy link
Member

d4be4st commented Jan 24, 2015

Fixed it, moved the env_vars to the top of the commands list so it would set the env_vars before anything.

@pricees
Copy link
Contributor Author

pricees commented Jan 24, 2015

Awesome. Thanks.
On Jan 24, 2015 12:23 AM, "štef" [email protected] wrote:

Fixed it, moved the env_vars to the top of the commands list so it would
set the env_vars before anything.


Reply to this email directly or view it on GitHub
#161 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants