Problem creating deploy hook

Hey guys, I’m having an issue creating a deploy hook and was hoping you could have a look. I don’t want to include config/secrets.yml in my git, so I have secrets.yml.example in place. Now I need to copy this file on every deployment:

staging: # tried to use production here too, but didn't work
after_bundle:
- command: cd $STACK_PATH && cp config/secrets.yml.example config/secrets.yml
target: rails
apply_during: all
run_on: all_servers

It’s not working though. Please advise.

Hi there, please give this a try (before the symlink is created, the $STACK_PATH may not exist):

staging: 
  after_checkout:
    - command: cd $STACK_PATH && cp config/secrets.yml.example config/secrets.yml
      target: rails
      apply_during: all
      run_on: all_servers

I recommend to use Environment Variables and check in your secrets.yml to your repo. e.g.: production: secret_key_base: <%= ENV[“SECRET_KEY_BASE”] %> devise: secret_key: <%= ENV[“DEVISE_SECRET_KEY”] %> smtp: address: <%= ENV[“SMTP_ADDRESS”] %> user_name: <%= ENV[“SMTP_USERNAME”] %> password: <%= ENV[“SMTP_PASSWORD”] %> flickr: key: <%= ENV[“FLICKR_KEY”] %> secret: <%= ENV[“FLICKR_SECRET”] %>

You must be logged in to answer this question