Commit 3b1543cd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Detect build setup state based on gitlab_ci.yml presense

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent d21b3a02
......@@ -467,6 +467,10 @@ class Repository
end
end
def gitlab_ci_yml
@gitlab_ci_yml ||= blob_at(head_commit.sha, '.gitlab-ci.yml') unless empty?
end
def head_commit
@head_commit ||= commit(self.root_ref)
end
......
......@@ -2,7 +2,7 @@
%legend
Builds:
- unless @project.builds.any?
- unless @repository.gitlab_ci_yml
.form-group
.col-sm-offset-2.col-sm-10
%p Before you can use Builds (Continuous Integration) feature you need to setup it.
......
......@@ -27,7 +27,7 @@
= 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 @project.builds.any?
- 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
......
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