Commit 9879cf92 authored by Phil Hughes's avatar Phil Hughes
parent 75136cc0
.account-well.prepend-top-default.append-bottom-default
%ul
%li
The repository must be accessible over <code>http://</code>, <code>https://</code>, <code>ssh://</code> or <code>git://</code>.
%li
If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>.
%li
If your SSH repository is not publicly accessible, add the public SSH key of the GitLab server to the remote repository.
%li
The update action will time out after 10 minutes. For big repositories, use a clone/push combination.
- page_title "Mirror Repository" - page_title "Mirror Repository"
%h3.page-title
Mirror Repository
%p.light .row.prepend-top-default.append-bottom-default
A repository can be setup as a mirror of another repository, and can also have a remote mirror associated. .col-lg-3
%h4.prepend-top-0
%p.light Pull from a remote repository
When the repository is configured as a mirror, all of its branches, tags, and commits will automatically be updated from the repository configured in the %p.light
%strong Pull from a remote repository Set up your project to automatically have its branches, tags, and commits updated from an upstream repository every hour.
section. .col-lg-9
%h5.prepend-top-0
%p.light Set up mirror repository
When the repository has a remote mirror associated, it means that the remote repository configured in the <strong>Push to a remote repository</strong> section will automatically receive updates from the current repository. = form_for @project, url: namespace_project_mirror_path(@project.namespace, @project) do |f|
= form_errors(@project)
%hr.clearfix = render "shared/mirror_update_button"
- if @project.mirror_last_update_failed?
= form_for @project, url: namespace_project_mirror_path(@project.namespace, @project), html: { class: 'form-horizontal' } do |f| .panel.panel-danger
- if @project.errors.any? .panel-heading
.alert.alert-danger The repository failed to update #{time_ago_with_tooltip(@project.mirror_last_update_at)}.
- @project.errors.full_messages.each do |msg| - if @project.mirror_ever_updated_successfully?
%p= msg Last successful update #{time_ago_with_tooltip(@project.mirror_last_successful_update_at)}.
.panel-body
%h4 Pull from a remote repository %pre
%p.light :preserve
Set up your project to automatically have its branches, tags, and commits updated from an upstream repository every hour. #{@project.import_error.try(:strip)}
= render "shared/mirror_update_button" .form-group
- if @project.mirror_last_update_success? = f.check_box :mirror, class: "pull-left"
%span.prepend-left-default Successfully updated #{time_ago_with_tooltip(@project.mirror_last_successful_update_at)}. .prepend-left-20
%hr.clearfix = f.label :mirror, "Mirror repository", class: "label-light append-bottom-0"
%p.light.append-bottom-0
- if @project.mirror_last_update_failed? Automatically update this project's branches, tags, and commits from the upstream repository every hour.
.panel.panel-danger .form-group
.panel-heading = f.label :import_url, "Git repository URL", class: "label-light"
The repository failed to update #{time_ago_with_tooltip(@project.mirror_last_update_at)}. = f.text_field :import_url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git'
- if @project.mirror_ever_updated_successfully? = render "instructions"
Last successful update #{time_ago_with_tooltip(@project.mirror_last_successful_update_at)}. .form-group
.panel-body = f.label :mirror_user_id, "Mirror user", class: "label-light"
%pre = users_select_tag("project[mirror_user_id]", class: 'input-large', selected: @project.mirror_user_id || current_user.id,
:preserve first_user: true, current_user: true, push_code_to_protected_branches: true)
#{@project.import_error.try(:strip)}
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :mirror do
= f.check_box :mirror
%strong
Mirror repository
.help-block .help-block
Automatically update this project's branches, tags, and commits from the upstream repository every hour. This user will be the author of all events in the activity feed that are the result of an update,
like new branches being created or new commits being pushed to existing branches.
.form-group They need to have at least master access to this project.
= f.label :import_url, class: 'control-label' do - if @project.builds_enabled?
%span Git repository URL = render "shared/mirror_trigger_builds_setting", f: f
.col-sm-10 = f.submit "Update", class: "btn btn-save"
= f.text_field :import_url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git' .col-sm-12
.well.prepend-top-20 %hr
%ul .col-lg-3
%li %h4.prepend-top-0
The repository must be accessible over <code>http://</code>, <code>https://</code>, <code>ssh://</code> or <code>git://</code>. Push to a remote repository
%li %p.light
If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>. Set up the remote repository that you want to update with the content of the current repository every hour.
%li .col-lg-9
If your SSH repository is not publicly accessible, add the public SSH key of the GitLab server to the remote repository. = form_for @project, url: namespace_project_mirror_path(@project.namespace, @project) do |f|
%li = form_errors(@project)
The update action will time out after 10 minutes. For big repositories, use a clone/push combination. = render "shared/remote_mirror_update_button", remote_mirror: @remote_mirror
- if @remote_mirror.last_error.present?
.form-group .panel.panel-danger
= f.label :mirror_user_id, class: 'control-label' do .panel-heading
Mirror user The remote repository failed to update #{time_ago_with_tooltip(@remote_mirror.last_update_at)}.
.col-sm-10 - if @remote_mirror.last_successful_update_at
= users_select_tag("project[mirror_user_id]", class: 'input-large', selected: @project.mirror_user_id || current_user.id, Last successful update #{time_ago_with_tooltip(@remote_mirror.last_successful_update_at)}.
first_user: true, current_user: true, push_code_to_protected_branches: true) .panel-body
.help-block %pre
This user will be the author of all events in the activity feed that are the result of an update, :preserve
like new branches being created or new commits being pushed to existing branches. #{@remote_mirror.last_error.strip}
They need to have at least master access to this project. = f.fields_for :remote_mirrors, @remote_mirror do |rm_form|
.form-group
- if @project.builds_enabled? = rm_form.check_box :enabled, class: "pull-left"
= render 'shared/mirror_trigger_builds_setting', f: f .prepend-left-20
= rm_form.label :enabled, "Remote mirror repository", class: "label-light append-bottom-0"
%h4 Push to a remote repository %p.light.append-bottom-0
%p.light Automatically update the remote mirror's branches, tags, and commits from this repository every hour.
Set up the remote repository that you want to update with the content of the current repository every hour. .form-group.has-feedback
= render "shared/remote_mirror_update_button", remote_mirror: @remote_mirror = rm_form.label :url, "Git repository URL", class: "label-light"
- if @remote_mirror.last_successful_update_at = rm_form.text_field :url, class: "form-control", placeholder: 'https://username:password@gitlab.company.com/group/project.git'
%span.prepend-left-default Successfully updated #{time_ago_with_tooltip(@remote_mirror.last_successful_update_at)}. = render "instructions"
= f.submit "Update", class: "btn btn-create"
%hr.clearfix
- if @remote_mirror.last_error.present?
.panel.panel-danger
.panel-heading
The remote repository failed to update #{time_ago_with_tooltip(@remote_mirror.last_update_at)}.
- if @remote_mirror.last_successful_update_at
Last successful update #{time_ago_with_tooltip(@remote_mirror.last_successful_update_at)}.
.panel-body
%pre
:preserve
#{@remote_mirror.last_error.strip}
= f.fields_for :remote_mirrors, @remote_mirror do |rm_form|
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= rm_form.label :enabled do
= rm_form.check_box :enabled
%strong
Remote Mirror Repository
.help-block
Automatically update the remote mirror's branches, tags, and commits from this repository every hour.
.form-group.has-feedback
= rm_form.label :url, class: 'control-label' do
%span Git repository URL
.col-sm-10
= rm_form.text_field :url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git'
.well.prepend-top-20
The requirements for the URL format are the same mentioned in the <strong>Pull from a remote repository</strong> section.
.form-actions
= f.submit "Save Changes", class: "btn btn-create"
.form-group .form-group
.col-sm-offset-2.col-sm-10 = f.check_box :mirror_trigger_builds, class: "pull-left"
.checkbox .prepend-left-20
= f.label :mirror_trigger_builds do = f.label :mirror_trigger_builds, "Trigger builds for mirror updates", class: "label-light"
= f.check_box :mirror_trigger_builds %p.light.append-bottom-0
%strong Trigger builds when branches or tags are updated from the upstream repository.
Trigger builds for mirror updates Depending on the activity of the upstream repository, this may greatly increase the load on your CI runners.
.help-block Only enable this if you know they can handle the load.
Trigger builds when branches or tags are updated from the upstream repository.
Depending on the activity of the upstream repository, this may greatly increase the load on your CI runners.
Only enable this if you know they can handle the load.
- if @project.mirror? && can?(current_user, :push_code, @project) - if @project.mirror? && can?(current_user, :push_code, @project)
- if @project.updating_mirror? .append-bottom-default
%span.btn.disabled - if @project.updating_mirror?
= icon('refresh') %span.btn.disabled
Updating&hellip; = icon("refresh spin")
- else Updating&hellip;
= link_to update_now_namespace_project_mirror_path(@project.namespace, @project), method: :post, class: "btn" do - else
= icon('refresh') = link_to update_now_namespace_project_mirror_path(@project.namespace, @project), method: :post, class: "btn" do
Update Now = icon("refresh")
Update Now
- if @project.mirror_last_update_success?
%p.inline.prepend-left-10
Successfully updated #{time_ago_with_tooltip(@project.mirror_last_successful_update_at)}.
- if @project.has_remote_mirror? - if @project.has_remote_mirror?
- if remote_mirror.update_in_progress? .append-bottom-default
%span.btn.disabled - if remote_mirror.update_in_progress?
= icon('refresh') %span.btn.disabled
Updating&hellip; = icon("refresh spin")
- else Updating&hellip;
= link_to update_now_namespace_project_mirror_path(@project.namespace, @project, sync_remote: true), method: :post, class: "btn" do - else
= icon('refresh') = link_to update_now_namespace_project_mirror_path(@project.namespace, @project, sync_remote: true), method: :post, class: "btn" do
Update Now = icon("refresh")
Update Now
- if @remote_mirror.last_successful_update_at
%p.inline.prepend-left-10
Successfully updated #{time_ago_with_tooltip(@remote_mirror.last_successful_update_at)}.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment