Skip to content

Commit

Permalink
Revert "ci(merge): git clone cache"
Browse files Browse the repository at this point in the history
This reverts commit 489304d.
  • Loading branch information
byteplow committed Feb 6, 2024
1 parent 702ece0 commit 7a711a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 78 deletions.
35 changes: 0 additions & 35 deletions ci/gitlab-ci/lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,41 +238,6 @@
git_repo_clone () {
git clone ${CI_REPOSITORY_URL} --branch ${CI_COMMIT_REF_NAME} --depth 1 --single-branch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20
}
git_repo_clone_cached () {
set -x
targetDir=${1:-$CI_PROJECT_DIR}
cacheRepoPath=${CI_CUSTOM_CACHE_DIR}/git-cache/v1/$(echo "${CI_REPOSITORY_URL}" | cut -d '@' -f2)
mkdir -p $cacheRepoPath
pushd $cacheRepoPath
if ! git rev-parse --is-inside-work-tree 2> /dev/null; then
log "not a git repo. Initialzing new bare git repo ..."
git init --bare
fi
log "setting up remote"
if git remote | grep origin > /dev/null; then
git remote rm origin
fi
git remote add origin "${CI_REPOSITORY_URL}"
log "fetching from gitlab"
git fetch --force origin '*:*'
popd
log "cloning into working dir"
git clone $cacheRepoPath --branch "${CI_COMMIT_REF_NAME}" --local --no-hardlinks "${targetDir}"
pushd ${targetDir}
git remote rm origin
git remote add origin "${CI_REPOSITORY_URL}"
git fetch
popd
}
# lib/scripts/github.sh
github_get_release_by_tag() {
Expand Down
35 changes: 0 additions & 35 deletions ci/gitlab-ci/lib/scripts/git_repo.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
git_repo_clone () {
git clone ${CI_REPOSITORY_URL} --branch ${CI_COMMIT_REF_NAME} --depth 1 --single-branch ${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20
}

git_repo_clone_cached () {
set -x
targetDir=${1:-$CI_PROJECT_DIR}

cacheRepoPath=${CI_CUSTOM_CACHE_DIR}/git-cache/v1/$(echo "${CI_REPOSITORY_URL}" | cut -d '@' -f2)

mkdir -p $cacheRepoPath

pushd $cacheRepoPath
if ! git rev-parse --is-inside-work-tree 2> /dev/null; then
log "not a git repo. Initialzing new bare git repo ..."
git init --bare
fi

log "setting up remote"
if git remote | grep origin > /dev/null; then
git remote rm origin
fi

git remote add origin "${CI_REPOSITORY_URL}"

log "fetching from gitlab"
git fetch --force origin '*:*'
popd


log "cloning into working dir"
git clone $cacheRepoPath --branch "${CI_COMMIT_REF_NAME}" --local --no-hardlinks "${targetDir}"
pushd ${targetDir}
git remote rm origin
git remote add origin "${CI_REPOSITORY_URL}"
git fetch
popd
}
17 changes: 9 additions & 8 deletions ci/gitlab-ci/merge_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
GIT_STRATEGY: none
MERGENONINTERACTIVE: "true" # "false" is also true! Runs not interactive if the variable exists.
pushOptSkipCi: "true" # "false" is also true! Runs not interactive if the variable exists.
image: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/tine20/test:${BASE_MAJOR_COMMIT_REF_NAME}-${PHP_VERSION}
image: dockerregistry.metaways.net/tine20/tine20/composer:2.4 #composer:2.4
needs: []
tags:
- custom-cache
before_script:
- !reference [.lib, script]
- cp $DOCKER_GIT_CONFIG ~/.gitconfig
- git_repo_clone_cached
- git_repo_clone
- git config --global user.email "[email protected]"
- git config --global user.name "gitlabci"
- git_repo_clone_cached ${CI_BUILDS_DIR}/merge
- cd ${CI_BUILDS_DIR}
- git clone https://gitlab.metaways.net/tine20/tine20.git merge
- cd ${CI_BUILDS_DIR}/merge
- git config merge.pofile.name "merge po-files driver"
- git config merge.pofile.driver "${CI_BUILDS_DIR}/${CI_PROJECT_NAMESPACE}/tine20/scripts/git/merge-po-files %A %O %B"
Expand All @@ -24,9 +23,11 @@
- git remote add github https://github.com/tine-groupware/tine.git
- cd ${CI_BUILDS_DIR}/merge/tine20

# todo move custom merge to .abstract.merge and then delete this job
.abstract.merge_on_source_image:
extends: .abstract.merge
image: ${REGISTRY}/test-source-commit:${IMAGE_TAG}
needs:
- docker_build_source

include:
- local: '/ci/gitlab-ci/custom_merge_jobs.yml'
Expand All @@ -40,8 +41,8 @@ merge:
# BE changes < 2023.11 (TODO remove that when 2022.11 is obsolete)
- merge_merge_upwards tine20.com/2022.11-custom 2023.11
- merge_merge_upwards 2023.11 2024.11
- merge_merge_mirror customers 2024.11 github main
- merge_merge_mirror github main customers 2024.11
- merge_merge_mirror origin 2024.11 github main
- merge_merge_mirror github main origin 2024.11
- merge_trigger_next
rules:
- if: $AUTO_MERGE == "never"
Expand Down

0 comments on commit 7a711a0

Please sign in to comment.