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
01333b96
Commit
01333b96
authored
Feb 06, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates documentation
parent
4c50e915
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
54 deletions
+18
-54
app/workers/update_all_mirrors_worker.rb
app/workers/update_all_mirrors_worker.rb
+1
-1
app/workers/update_all_remote_mirrors_worker.rb
app/workers/update_all_remote_mirrors_worker.rb
+1
-1
doc/administration/cron_jobs.md
doc/administration/cron_jobs.md
+0
-38
doc/workflow/repository_mirroring.md
doc/workflow/repository_mirroring.md
+16
-14
No files found.
app/workers/update_all_mirrors_worker.rb
View file @
01333b96
...
...
@@ -27,7 +27,7 @@ class UpdateAllMirrorsWorker
private
def
mirrors_to_sync
Project
.
mirror
.
where
(
"NOW() >= mirror_last_update_at + sync_time * interval '1 minute' OR sync_time IN (?)"
,
Gitlab
::
Mirror
.
sync_times
)
Project
.
mirror
.
where
(
sync_time:
Gitlab
::
Mirror
.
sync_times
)
end
def
try_obtain_lease
...
...
app/workers/update_all_remote_mirrors_worker.rb
View file @
01333b96
...
...
@@ -17,6 +17,6 @@ class UpdateAllRemoteMirrorsWorker
private
def
remote_mirrors_to_sync
RemoteMirror
.
where
(
"NOW() >= updated_at + sync_time * interval '1 minute' OR sync_time IN (?)"
,
Gitlab
::
Mirror
.
sync_times
)
RemoteMirror
.
where
(
sync_time:
Gitlab
::
Mirror
.
sync_times
)
end
end
doc/administration/cron_jobs.md
deleted
100644 → 0
View file @
4c50e915
# Cron jobs
## Adjusting synchronization times for repository mirroring
>**Notes:**
-
This is an
[
Enterprise Edition
][
ee
]
only feature.
-
For more information on the repository mirroring, see the
[
user documentation
](
../workflow/repository_mirroring.md
)
.
You can manually configure the repository synchronization times by setting the
following configuration values.
Please note that
`update_all_mirrors_worker_cron`
refers to the worker used for
pulling changes from a remote mirror while
`update_all_remote_mirrors_worker_cron`
refers to the worker used for pushing changes to the remote mirror.
>**Note:**
These are cron formatted values. You can use a crontab generator to create these
values, for example http://www.crontabgenerator.com/.
**Omnibus installations**
```
gitlab_rails['update_all_mirrors_worker_cron'] = "0 * * * *"
gitlab_rails['update_all_remote_mirrors_worker_cron'] = "30 * * * *"
```
**Source installations**
```
cron_jobs:
update_all_mirrors_worker_cron:
cron: "0 * * * *"
update_all_remote_mirrors_worker_cron:
cron: "30 * * * *"
```
[
ee
]:
https://about.gitlab.com/products
doc/workflow/repository_mirroring.md
View file @
01333b96
...
...
@@ -7,7 +7,7 @@ There are two kinds of repository mirroring features supported by GitLab:
to another location, whereas the
**pull**
method mirrors an external repository
in one in GitLab.
M
irror repositories are updated every hour, and all new branches, tags, and
By default m
irror repositories are updated every hour, and all new branches, tags, and
commits will be visible in the project's activity feed.
Users with at least
[
developer access
][
perms
]
to the project can also force an
...
...
@@ -51,8 +51,8 @@ whether you want to trigger builds for mirror updates.
Since the repository on GitLab functions as a mirror of the upstream repository,
you are advised not to push commits directly to the repository on GitLab.
Instead, any commits should be pushed to the upstream repository, and will end
up in the GitLab repository automatically within
an hour, or when a
[
forced update
](
#forcing-an-update
)
is initiated.
up in the GitLab repository automatically within
your project's configured
synchronization time, or when a
[
forced update
](
#forcing-an-update
)
is initiated.
If you do manually update a branch in the GitLab repository, the branch will
become diverged from upstream, and GitLab will no longer automatically update
...
...
@@ -72,8 +72,8 @@ repository to push to. Hit **Save changes** for the changes to take effect.
Similarly to the pull mirroring, since the upstream repository functions as a
mirror to the repository in GitLab, you are advised not to push commits directly
to the mirrored repository. Instead, any commits should be pushed to GitLab,
and will end up in the mirrored repository automatically within
an hour, or when
a
[
forced update
](
#forcing-an-update
)
is initiated.
and will end up in the mirrored repository automatically within
the configured time,
or when
a
[
forced update
](
#forcing-an-update
)
is initiated.
In case of a diverged branch, you will see an error indicated at the
**Mirror repository**
settings.
...
...
@@ -82,7 +82,7 @@ In case of a diverged branch, you will see an error indicated at the
## Forcing an update
While mirrors update
once an hour, you can
force an update (either
**push**
or
While mirrors update
at a pre-configured time (hourly by default), you can always
force an update (either
**push**
or
**pull**
) by using the
**Update now**
button which is exposed in various places:
-
in the commits page
...
...
@@ -92,22 +92,24 @@ While mirrors update once an hour, you can force an update (either **push** or
## Adjusting synchronization times
You can adjust the synchronization times for the repository mirroring if you
have access to the GitLab server. For more information, see
[
the administration documentation
][
sync-times
]
.
Your repository's default synchronization time is hourly.
However, you can adjust it by visiting the
**Mirror repository**
page
under the wheel icon in the upper right corner.
Check the Synchronization time section where you can choose to have your mirror
be updated once every fifteen minutes, hourly or daily and then hit
**Save changes**
at the bottom.
## Using both mirroring methods at the same time
Currently there is no bidirectional support without conflicts. That means that
if you configure a repository to both pull and push to a second one, there is
no guarantee that it will update correctly on both remotes. You could
[
adjust the synchronization times
][
sync-times
]
to a very low value and hop
e
t
hat no conflicts occur during the pull/push window time, but that is not a
solution to consider on a production environment. Another thing you could try
is
[
configuring custom Git hooks
][
hooks
]
on the GitLab server.
adjust the synchronization times on the mirror settings pag
e
t
o a very low value and hope that no conflicts occur during
the pull/push window time, but that is not a solution to consider on a
production environment. Another thing you could try
is
[
configuring custom Git hooks
][
hooks
]
on the GitLab server.
[
ee-51
]:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/51
[
perms
]:
../user/permissions.md
[
sync-times
]:
../administration/cron_jobs.md#adjusting-synchronization-times-for-repository-mirroring
[
hooks
]:
https://docs.gitlab.com/ee/administration/custom_hooks.html
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