What is the purpose of cwd attribute in script resource? For some reason the running the first block works but the second one doesn't work as intended (i.e. cloning the git repo under /var/apps
)
script 'clone_repo' do
interpreter "bash"
code <<-EOH
cd /var/apps
git clone https://gitlab.com/dsura/test-go-web-app.git
EOH
not_if { ::File.directory?("/var/apps/test-go-web-app") }
end
and
script 'clone_repo' do
interpreter "bash"
cwd ::File.dirname('/var/apps')
code <<-EOH
git clone https://gitlab.com/dsura/test-go-web-app.git
EOH
not_if { ::File.directory?("/var/apps/test-go-web-app") }
end