This repository was archived by the owner on Jan 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
templates/default/bitbucket Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 6464 notifies :restart , "service[#{ node [ 'stash' ] [ 'product' ] } ]" , :delayed
6565 only_if { node [ 'stash' ] [ 'product' ] == 'bitbucket' }
6666end
67+
68+ if stash_version >= Chef :: Version . new ( '4.6.0' )
69+ template "#{ node [ 'stash' ] [ 'install_path' ] } /bitbucket/bin/set-bitbucket-home.sh" do
70+ source 'bitbucket/set-bitbucket-home.sh.erb'
71+ owner node [ 'stash' ] [ 'user' ]
72+ mode '0755'
73+ notifies :restart , "service[#{ node [ 'stash' ] [ 'product' ] } ]" , :delayed
74+ only_if { node [ 'stash' ] [ 'product' ] == 'bitbucket' }
75+ end
76+
77+ template "#{ node [ 'stash' ] [ 'install_path' ] } /bitbucket/bin/set-bitbucket-user.sh" do
78+ source 'bitbucket/set-bitbucket-user.sh.erb'
79+ owner node [ 'stash' ] [ 'user' ]
80+ mode '0755'
81+ notifies :restart , "service[#{ node [ 'stash' ] [ 'product' ] } ]" , :delayed
82+ only_if { node [ 'stash' ] [ 'product' ] == 'bitbucket' }
83+ end
84+ end
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # One way to set the BITBUCKET_HOME path is here via this variable. Simply uncomment it and set a valid path like
4+ # /bitbucket/home. You can of course set it outside in the command terminal; that will also work.
5+ #
6+
7+ if [ " x${BITBUCKET_HOME} " = " x" ]; then
8+ export BITBUCKET_HOME=" <%= node['stash']['home_path'] %>"
9+ fi
10+
11+ # When upgrading from the packaged distribution BITBUCKET_HOME may not be set. Fallback to legacy STASH_HOME
12+ # and output a message for the user recommending that they update their environment
13+ if [ " x${BITBUCKET_HOME} " = " x" ]; then
14+ if [ ! " x${STASH_HOME} " = " x" ]; then
15+ BITBUCKET_HOME=${STASH_HOME}
16+ echo " "
17+ echo " --------------------------------------------------------------------------------------"
18+ echo " WARNING: STASH_HOME has been deprecated and replaced with BITBUCKET_HOME."
19+ echo " We recommend you set BITBUCKET_HOME instead of STASH_HOME."
20+ echo " Future versions of Bitbucket may not support the STASH_HOME variable."
21+ echo " --------------------------------------------------------------------------------------"
22+ fi
23+ fi
24+
25+ echo $BITBUCKET_HOME | grep -q " "
26+ if [ $? -eq 0 ]; then
27+ echo " "
28+ echo " -------------------------------------------------------------------------------"
29+ echo " BITBUCKET_HOME \" $BITBUCKET_HOME \" contains spaces."
30+ echo " Using a directory with spaces is likely to cause unexpected behaviour and is"
31+ echo " not supported. Please use a directory which does not contain spaces."
32+ echo " -------------------------------------------------------------------------------"
33+ exit 1
34+ fi
35+
36+ echo " BITBUCKET_HOME set to $BITBUCKET_HOME "
Original file line number Diff line number Diff line change 1+ # START INSTALLER MAGIC ! DO NOT EDIT !
2+ BITBUCKET_USER="<%= node['stash']['user'] %> " ##
3+ # END INSTALLER MAGIC ! DO NOT EDIT !
4+
5+ export BITBUCKET_USER
You can’t perform that action at this time.
0 commit comments