Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8012ddaa
Commit
8012ddaa
authored
Feb 04, 2021
by
Rémy Coutable
Committed by
Albert Salim
Feb 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: Repack the Git repo after shallow clone in the 'cache-repo' job
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
4f838cf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
.gitlab/ci/cache-repo.gitlab-ci.yml
.gitlab/ci/cache-repo.gitlab-ci.yml
+2
-0
No files found.
.gitlab/ci/cache-repo.gitlab-ci.yml
View file @
8012ddaa
...
@@ -29,6 +29,7 @@ cache-repo:
...
@@ -29,6 +29,7 @@ cache-repo:
-
'
[
-z
"$CI_REPO_CACHE_CREDENTIALS"
]
||
gcloud
auth
activate-service-account
--key-file=$CI_REPO_CACHE_CREDENTIALS'
-
'
[
-z
"$CI_REPO_CACHE_CREDENTIALS"
]
||
gcloud
auth
activate-service-account
--key-file=$CI_REPO_CACHE_CREDENTIALS'
script
:
script
:
# Enable shallow repo caching only if the $ENABLE_SHALLOW_REPO_CACHING variable exists
# Enable shallow repo caching only if the $ENABLE_SHALLOW_REPO_CACHING variable exists
# The `git repack` call works around a Git bug with shallow clones: https://gitlab.com/gitlab-org/git/-/issues/86
-
if [ -n "$ENABLE_SHALLOW_REPO_CACHING" ]; then
-
if [ -n "$ENABLE_SHALLOW_REPO_CACHING" ]; then
cd .. && rm -rf $CI_PROJECT_NAME;
cd .. && rm -rf $CI_PROJECT_NAME;
today=$(date +%Y-%m-%d);
today=$(date +%Y-%m-%d);
...
@@ -38,6 +39,7 @@ cache-repo:
...
@@ -38,6 +39,7 @@ cache-repo:
echo "Cloning $CI_REPOSITORY_URL into $CI_PROJECT_NAME with commits from $one_year_ago.";
echo "Cloning $CI_REPOSITORY_URL into $CI_PROJECT_NAME with commits from $one_year_ago.";
time git clone --progress --no-checkout --shallow-since=$one_year_ago $CI_REPOSITORY_URL $CI_PROJECT_NAME;
time git clone --progress --no-checkout --shallow-since=$one_year_ago $CI_REPOSITORY_URL $CI_PROJECT_NAME;
cd $CI_PROJECT_NAME;
cd $CI_PROJECT_NAME;
time git repack -d;
echo "Archiving $CI_PROJECT_NAME into /tmp/$SHALLOW_CLONE_TAR_FILENAME.";
echo "Archiving $CI_PROJECT_NAME into /tmp/$SHALLOW_CLONE_TAR_FILENAME.";
time tar cf /tmp/$SHALLOW_CLONE_TAR_FILENAME .;
time tar cf /tmp/$SHALLOW_CLONE_TAR_FILENAME .;
echo "GZipping /tmp/$SHALLOW_CLONE_TAR_FILENAME.";
echo "GZipping /tmp/$SHALLOW_CLONE_TAR_FILENAME.";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment