Commit 1e2a4895 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Finishing touches

parent 3578153d
module YamlHelper
def yaml_web_editor_link(project)
commits = project.ci_commits
if commits.any? && commits.last.ci_yaml_file
"#{project.gitlab_url}/edit/master/.gitlab-ci.yml"
else
"#{project.gitlab_url}/new/master"
end
end
end
......@@ -50,7 +50,6 @@ class CommitStatus < ActiveRecord::Base
scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)) }
scope :ordered, -> { order(:ref, :stage_idx, :name) }
scope :for_ref, ->(ref) { where(ref: ref) }
scope :has_coverage?, -> { where.not(coverage: nil).any? }
state_machine :status, initial: :pending do
event :run do
......@@ -88,8 +87,7 @@ class CommitStatus < ActiveRecord::Base
state :canceled, value: 'canceled'
end
delegate :sha, :short_sha, :project,
to: :commit, prefix: false
delegate :sha, :short_sha, to: :commit, prefix: false
# TODO: this should be removed with all references
def before_sha
......
......@@ -30,7 +30,7 @@ module Ci
tag: tag,
trigger_request: trigger_request,
user: user,
gl_project_id: commit.gl_project_id)
project: commit.project)
build = commit.builds.create!(build_attrs)
build.execute_hooks
......
......@@ -6,10 +6,8 @@
Add at least one runner to the project.
Go to #{link_to 'Runners page', runners_path(@project), target: :blank} for instructions.
%li
Put the .gitlab-ci.yml in the root of your repository. Examples can be found in #{link_to "Configuring project (.gitlab-ci.yml)", "http://doc.gitlab.com/ci/yaml/README.html", target: :blank}.
Put the .gitlab-ci.yml in the root of your repository. Examples can be found in
#{link_to "Configuring project (.gitlab-ci.yml)", "http://doc.gitlab.com/ci/yaml/README.html", target: :blank}.
You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}
%li
Visit #{link_to 'GitLab project settings', @project.gitlab_url + "/services/gitlab_ci/edit", target: :blank}
and press the "Test settings" button.
%li
Return to this page and refresh it, it should show a new build.
......@@ -22,6 +22,7 @@
%ul
- @ci_commit.yaml_errors.split(",").each do |error|
%li= error
You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}
- if @ci_commit.project.builds_enabled? && !@ci_commit.ci_yaml_file
.bs-callout.bs-callout-warning
......
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