Skip to content

Commit

Permalink
fix condition to apply patch during build gitlab
Browse files Browse the repository at this point in the history
rewrite patch applying with find | while read chain
`if [[ -f ]]` with globbing may not works
  • Loading branch information
kkimurak committed Jun 20, 2022
1 parent bc1a714 commit fbcdd29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/build/install.sh
Expand Up @@ -83,10 +83,10 @@ exec_as_git git config --global advice.detachedHead false
echo "Cloning gitlab-foss v.${GITLAB_VERSION}..."
exec_as_git git clone -q -b v${GITLAB_VERSION} --depth 1 ${GITLAB_CLONE_URL} ${GITLAB_INSTALL_DIR}

if [[ -d "${GITLAB_BUILD_DIR}/patches" && -f "${GITLAB_BUILD_DIR}/patches/*.patch" ]]; then
echo "Applying patches for gitlab-foss..."
exec_as_git git -C ${GITLAB_INSTALL_DIR} apply --ignore-whitespace < ${GITLAB_BUILD_DIR}/patches/*.patch
fi
find "${GITLAB_BUILD_DIR}/patches/" -name "*.patch" | while read -r patch_file; do
printf "Applying patch %s for gitlab-foss...\n" "${patch_file}"
exec_as_git git -C ${GITLAB_INSTALL_DIR} apply --ignore-whitespace < "${patch_file}"
done

GITLAB_SHELL_VERSION=${GITLAB_SHELL_VERSION:-$(cat ${GITLAB_INSTALL_DIR}/GITLAB_SHELL_VERSION)}
GITLAB_PAGES_VERSION=${GITLAB_PAGES_VERSION:-$(cat ${GITLAB_INSTALL_DIR}/GITLAB_PAGES_VERSION)}
Expand Down

0 comments on commit fbcdd29

Please sign in to comment.