diff --git a/setup-local-dev-repos.sh b/setup-local-dev-repos.sh index 61e0f0e..ab7fbb8 100755 --- a/setup-local-dev-repos.sh +++ b/setup-local-dev-repos.sh @@ -102,12 +102,6 @@ GITLAB_GITOPS=$TMP_REPOS/gitlab-gitops JENKINS_BUILD=$TMP_REPOS/jenkins-build JENKINS_GITOPS=$TMP_REPOS/jenkins-gitops -# Avoid messing with your real $HOME/.gitconfig when running locally -if [ -n "$LOCAL_SHELL_RUN" ]; then - export GIT_CONFIG_GLOBAL=$(pwd)/$TMP_REPOS/.gitconfig - echo GIT_CONFIG_GLOBAL=$GIT_CONFIG_GLOBAL -fi - cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_REPO_SSH:-$TEST_BUILD_REPO} $TEST_BUILD_REPO $BUILD cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_REPO_SSH:-$TEST_GITOPS_REPO} $TEST_GITOPS_REPO $GITOPS cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_GITLAB_REPO_SSH:-$TEST_BUILD_GITLAB_REPO} $TEST_BUILD_GITLAB_REPO $GITLAB_BUILD @@ -115,6 +109,12 @@ cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_GITLAB_REPO_SSH:-$TEST_GITOPS_GITL cloneRepo $UPSTREAM_BUILD_REPO ${TEST_BUILD_JENKINS_REPO_SSH:-$TEST_BUILD_JENKINS_REPO} $TEST_BUILD_JENKINS_REPO $JENKINS_BUILD cloneRepo $UPSTREAM_GITOPS_REPO ${TEST_GITOPS_JENKINS_REPO_SSH:-$TEST_GITOPS_JENKINS_REPO} $TEST_GITOPS_JENKINS_REPO $JENKINS_GITOPS +# Avoid messing with your real $HOME/.gitconfig when running locally +if [ -n "$LOCAL_SHELL_RUN" ]; then + export GIT_CONFIG_GLOBAL=$(pwd)/$TMP_REPOS/.gitconfig + echo GIT_CONFIG_GLOBAL=$GIT_CONFIG_GLOBAL +fi + # WARNING - if GITOPS_REPO_URL is set, update deployment will try to update # the gitops repo. Disable this here if the gitops repo is NOT a fork if [ $TEST_REPO_ORG == "redhat-appstudio" ]; then