Skip to content

Commit 9d02bb4

Browse files
authored
Merge pull request #92 from jduimovich/defer-gitconfig
move the gitconfig to after local clones
2 parents 4260c5d + 9f4229e commit 9d02bb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

setup-local-dev-repos.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ GITLAB_GITOPS=$TMP_REPOS/gitlab-gitops
102102
JENKINS_BUILD=$TMP_REPOS/jenkins-build
103103
JENKINS_GITOPS=$TMP_REPOS/jenkins-gitops
104104

105-
# Avoid messing with your real $HOME/.gitconfig when running locally
106-
if [ -n "$LOCAL_SHELL_RUN" ]; then
107-
export GIT_CONFIG_GLOBAL=$(pwd)/$TMP_REPOS/.gitconfig
108-
echo GIT_CONFIG_GLOBAL=$GIT_CONFIG_GLOBAL
109-
fi
110-
111105
cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_REPO_SSH:-$TEST_BUILD_REPO} $TEST_BUILD_REPO $BUILD
112106
cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_REPO_SSH:-$TEST_GITOPS_REPO} $TEST_GITOPS_REPO $GITOPS
113107
cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_GITLAB_REPO_SSH:-$TEST_BUILD_GITLAB_REPO} $TEST_BUILD_GITLAB_REPO $GITLAB_BUILD
114108
cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_GITLAB_REPO_SSH:-$TEST_GITOPS_GITLAB_REPO} $TEST_GITOPS_GITLAB_REPO $GITLAB_GITOPS
115109
cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_JENKINS_REPO_SSH:-$TEST_BUILD_JENKINS_REPO} $TEST_BUILD_JENKINS_REPO $JENKINS_BUILD
116110
cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_JENKINS_REPO_SSH:-$TEST_GITOPS_JENKINS_REPO} $TEST_GITOPS_JENKINS_REPO $JENKINS_GITOPS
117111

112+
# Avoid messing with your real $HOME/.gitconfig when running locally
113+
if [ -n "$LOCAL_SHELL_RUN" ]; then
114+
export GIT_CONFIG_GLOBAL=$(pwd)/$TMP_REPOS/.gitconfig
115+
echo GIT_CONFIG_GLOBAL=$GIT_CONFIG_GLOBAL
116+
fi
117+
118118
# WARNING - if GITOPS_REPO_URL is set, update deployment will try to update
119119
# the gitops repo. Disable this here if the gitops repo is NOT a fork
120120
if [ $TEST_REPO_ORG == "redhat-appstudio" ]; then

0 commit comments

Comments
 (0)