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

Managing environment variables file application.yml #497

Closed
wonderer007 opened this issue Dec 27, 2016 · 3 comments
Closed

Managing environment variables file application.yml #497

wonderer007 opened this issue Dec 27, 2016 · 3 comments

Comments

@wonderer007
Copy link

Is there a better to way to manage your environment variable while continuous deployment using mina? Currently as suggested I have my application.yml in /shared/config whenever I update my env file in location I have to manually paste those changes in production because I have ignore application.yml in .gitignore. I am looking for a solution something sending the application.yml file to the server over same ssh connection mina has established or using scp along side ssh.

Thanks in advance.

@lnikell
Copy link

lnikell commented Dec 31, 2016

@wonderer007 if you are using rvm I guess .versions.conf file fit for your purposes.
you can create .versions.conf file with all necessary env variables and have different versions of that file on local and remote machine.

@ahbou
Copy link

ahbou commented Jan 27, 2017

Since v1.0 broke the scp plugin, here's my workaround if anyone else is struggling with this.
say you have:
set :shared_files, ['config/database.yml', 'config/application.yml']

and right before deploy do
run

run(:local){ 
    desc 'upload shared files' 
    fetch(:shared_files, []).each do |linked_dir|
      command "scp #{linked_dir} #{fetch(:user)}@#{fetch(:domain)}:#{fetch(:shared_path)}/#{linked_dir}"
    end
  }

@d4be4st
Copy link
Member

d4be4st commented Sep 8, 2017

as @ahbou wrote, use run(:local) to send your config/application.yml to a shared path

will update docs with this situation

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

No branches or pull requests

4 participants