Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-26 12:57:47 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-26 12:57:47 +0300
commit2fdf928afaed93958e86aa951897bf63757a578d (patch)
tree7c3fbf98d20e7d8e6e08ec22f18bfcb4248e7b14 /app
parent43e49f52e30199c9724329e71f375874eb76d554 (diff)
parent179bae9968e6da5c09a1789fba7c4b706e144804 (diff)
Merge branch 'ci-setup-info' into 'master'
Add links to CI setup documentation from project settings and builds pages For #14483 Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> See merge request !3384
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb12
-rw-r--r--app/views/projects/_builds_settings.html.haml8
-rw-r--r--app/views/projects/builds/index.html.haml3
3 files changed, 23 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 13154eb4205..908d765fb47 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -467,6 +467,18 @@ class Repository
end
end
+ def gitlab_ci_yml
+ return nil if !exists? || empty?
+
+ @gitlab_ci_yml ||= tree(:head).blobs.find do |file|
+ file.name == '.gitlab-ci.yml'
+ end
+ rescue Rugged::ReferenceError
+ # For unknow reason spinach scenario "Scenario: I change project path"
+ # lead to "Reference 'HEAD' not found" exception from Repository#empty?
+ nil
+ end
+
def head_commit
@head_commit ||= commit(self.root_ref)
end
diff --git a/app/views/projects/_builds_settings.html.haml b/app/views/projects/_builds_settings.html.haml
index 95ab9ecf3e8..9ae6964aaac 100644
--- a/app/views/projects/_builds_settings.html.haml
+++ b/app/views/projects/_builds_settings.html.haml
@@ -1,6 +1,14 @@
%fieldset.builds-feature
%legend
Builds:
+
+ - unless @repository.gitlab_ci_yml
+ .form-group
+ .col-sm-offset-2.col-sm-10
+ %p Builds need to be configured before you can begin using Continuous Integration.
+ = link_to 'Get started with Builds', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info'
+ %hr
+
.form-group
.col-sm-offset-2.col-sm-10
%p Get recent application code using the following command:
diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml
index 811d304ea75..aa85f495e39 100644
--- a/app/views/projects/builds/index.html.haml
+++ b/app/views/projects/builds/index.html.haml
@@ -27,6 +27,9 @@
= link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project),
data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
+ - unless @repository.gitlab_ci_yml
+ = link_to 'Get started with Builds', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info'
+
= link_to ci_lint_path, class: 'btn btn-default' do
= icon('wrench')
%span CI Lint