[chef] Re: symlinking issues


Chronological Thread 
  • From: Jasna Benčić < >
  • To:
  • Subject: [chef] Re: symlinking issues
  • Date: Fri, 14 Feb 2014 18:32:14 +0100

forget my question, it is resolved ..... I got just a N00b tip for you: if you are looking into cookbooks too long you will start to read code by memory as I did. So I got a review from an experienced Chef. I have created files in wrong directories and that's why I got broken symlink.


On Thu, Feb 13, 2014 at 10:23 PM, Jasna Benčić < " target="_blank"> > wrote:
Ohai,

I got problems with symlink_before_migrate part - it is connected with deploying ruby applications on a server from GitHub repository.

So, below is the snippet of code I am using

deploy "application_name" do
  repo application['git']['repository']
  branch application['git']['branch']
  user "ruby"
  group "ruby"
  deploy_to application['approot']
  action :deploy
  ssh_wrapper "#{application['approot']}/wrap-ssh4git.sh"
  symlink_before_migrate
({
   "config/database.yml" => "config/database.yml",
   "config/something_else.yml" => "config/something_else.yml"
  })

I get perfectly nice symlink in "current/config" directory, database.yml points to it's double created in "shared/config"

What bothers me and I can't figure it out why o why is database under current/config empty? It is full under /shared/config and that's just because I have filled it before deployment with embedded ruby template. Since deployment does symlinking with current/config directory file should be full in apps root directory and it is not.

Could you please enlighten me what am I doing wrong. Everytime I get symlink looking like example below I know it is going to be empty on one side.

database.yml -> /path/to/application_name/shared/config/database.yml

symlink should look like:

database.yml -> /path/to/application_name/shared/config/database.yml

Or am I wrong?  I really don't understand what part with symlink_before_migrate did I fail so I get file empty on one side and full on the other side







Archive powered by MHonArc 2.6.16.

§