Skip to content

Commit 82e88ff

Browse files
committed
create terraform state directory based on new configuration variables during datadir initialization
#2501
1 parent 7374743 commit 82e88ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

assets/runtime/functions

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,11 +1544,11 @@ initialize_datadir() {
15441544
chown ${GITLAB_USER}: ${GITLAB_LFS_OBJECTS_DIR}
15451545

15461546
# create terraform_state directory
1547-
# TODO : parametarize path and replace with it (e.g. GITLAB_TERRAFORM_STATE_STORAGE_PATH) - see sameersbn/gitlab#2438
1548-
# TODO : wrap with "if [[ _ENABLED == true ]]" condition
1549-
mkdir -p ${GITLAB_SHARED_DIR}/terraform_state
1550-
chmod u+rwX ${GITLAB_SHARED_DIR}/terraform_state
1551-
chown ${GITLAB_USER}: ${GITLAB_SHARED_DIR}/terraform_state
1547+
if [[ ${GITLAB_TERRAFORM_STATE_ENABLED} == true ]]; then
1548+
mkdir -p ${GITLAB_TERRAFORM_STATE_STORAGE_PATH}
1549+
chmod u+rwX ${GITLAB_TERRAFORM_STATE_STORAGE_PATH}
1550+
chown ${GITLAB_USER}: ${GITLAB_TERRAFORM_STATE_STORAGE_PATH}
1551+
fi
15521552

15531553
# create registry dir
15541554
if [[ ${GITLAB_REGISTRY_ENABLED} == true ]]; then

0 commit comments

Comments
 (0)