Coder Social home page Coder Social logo

How to ENV variables about mina HOT 10 CLOSED

mina-deploy avatar mina-deploy commented on May 18, 2024
How to ENV variables

from mina.

Comments (10)

simonc avatar simonc commented on May 18, 2024 2

Maybe you can set the bundle_bin variable to add the environment variables:

set :bundle_bin, 'GUSER=xxx GPASS=yyy bundle'

from mina.

lulalala avatar lulalala commented on May 18, 2024 2

@rstacruz

May I ask is there a doc for task :env do? It does not append ENV setting in the command.

I used set :bundle_prefix to achieve this.

from mina.

pricees avatar pricees commented on May 18, 2024 1

Can you believe there is still no environment variable option? Goodness grief! Well, I think we may fork this thang and add an env-var option but until then we are using a big time hack.

We store our variables locally in an .env file

under the settings we put:

# Non-cowboys, don't try this in production.
set :ssh_options, %{export #{File.open(".env").readlines.map(&:chomp).join(" ")}}

You get the gist and can make it pretty yourself. This is one way to Heroku-tize our deploy.

Happy hacking,
Best.
Ted

from mina.

AldanaQuintana avatar AldanaQuintana commented on May 18, 2024 1

@lulalala thanks, it worked for me!

I set bundle_prefix like this:

set :bundle_prefix, 'env $(cat .env | xargs) bundle exec '

from mina.

simonc avatar simonc commented on May 18, 2024

I agree, an environment_variables should be available to provide variables shared across commands while deploying.

from mina.

misteral avatar misteral commented on May 18, 2024

set :bundle_bin, 'GUSER=xxx GPASS=yyy bundle'

this is OK !!!! Thanks

from mina.

rstacruz avatar rstacruz commented on May 18, 2024

Try:

task :env do
queue %[NAME="hello"]
end

On Oct 30, 2012, at 6:11 PM, Simon COURTOIS [email protected]
wrote:

I agree, an environment_variables should be available to provide variables
shared across commands while deploying.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/65#issuecomment-9900324.

from mina.

rstacruz avatar rstacruz commented on May 18, 2024

As stated earlier, this should work:

task :env do
   queue %[NAME="hello"]
end

from mina.

rstacruz avatar rstacruz commented on May 18, 2024

Also, if you want to put it in .bashrc instead (IMHO a much better idea!), you should export the variables:

# .bashrc
export NAME="hello"

from mina.

phanhaiquang avatar phanhaiquang commented on May 18, 2024

I use Figaro

require 'yaml'

set :var_from_env, -> { YAML.load_file("./config/application.yml")["ENV_VAR"] }

from mina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.