Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 6206f63

Browse files
committed
Merge pull request #127 from linc01n/home-path
Set home path to 3.x default when it exists
2 parents 272b259 + 5bd6528 commit 6206f63

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

attributes/default.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
default['stash']['version'] = '4.1.0'
44
default['stash']['product'] = Chef::Version.new(node['stash']['version']) >= Chef::Version.new('4.0.0') ? 'bitbucket' : 'stash'
55

6-
default['stash']['home_path'] = "/var/atlassian/application-data/#{node['stash']['product']}"
6+
if Dir.exist?('/var/atlassian/application-data/stash')
7+
default['stash']['home_path'] = '/var/atlassian/application-data/stash'
8+
else
9+
default['stash']['home_path'] = "/var/atlassian/application-data/#{node['stash']['product']}"
10+
end
11+
712
default['stash']['install_path'] = '/opt/atlassian'
813
default['stash']['install_type'] = 'standalone'
914
default['stash']['service_type'] = 'init'

recipes/configuration.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
action :create
2323
recursive true
2424
end
25+
26+
bash 'update home path permission' do
27+
code <<-EOH
28+
chown -R #{node['stash']['user']}:#{node['stash']['user']} #{node['stash']['home_path']}
29+
EOH
30+
end
2531
else
2632
config_path = '/stash-config.properties'
2733
end

0 commit comments

Comments
 (0)