diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-08-03 16:25:16 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-08-03 16:25:16 +0200 |
commit | 79aeaec98b55ef68bae9bf0a5cb61fbe4e649279 (patch) | |
tree | 12f124b08711f4ebf899031294745015c0df9119 /app | |
parent | 09e2d0dd59d74c2ae58150d8a3b633b9a6a45986 (diff) | |
download | gitlab-ci-79aeaec98b55ef68bae9bf0a5cb61fbe4e649279.tar.gz |
Rename all occurrences of type to stage
Diffstat (limited to 'app')
-rw-r--r-- | app/models/commit.rb | 26 | ||||
-rw-r--r-- | app/views/builds/_build.html.haml | 2 | ||||
-rw-r--r-- | app/views/commits/_commit.html.haml | 2 | ||||
-rw-r--r-- | app/views/commits/show.html.haml | 6 | ||||
-rw-r--r-- | app/views/lints/_create.html.haml | 6 |
5 files changed, 21 insertions, 21 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index eea3653..7c1a015 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -93,17 +93,17 @@ class Commit < ActiveRecord::Base recipients.uniq end - def job_type + def stage return unless config_processor - job_types = builds_without_retry.select(&:active?).map(&:job_type) - config_processor.types.find { |job_type| job_types.include? job_type } + stages = builds_without_retry.select(&:active?).map(&:stage) + config_processor.stages.find { |stage| stages.include? stage } end - def create_builds_for_type(job_type) + def create_builds_for_type(stage) return if skip_ci? return unless config_processor - builds_attrs = config_processor.builds_for_type_and_ref(job_type, ref, tag) + builds_attrs = config_processor.builds_for_stage_and_ref(stage, ref, tag) builds_attrs.map do |build_attrs| builds.create!({ project: project, @@ -112,7 +112,7 @@ class Commit < ActiveRecord::Base tag_list: build_attrs[:tags], options: build_attrs[:options], allow_failure: build_attrs[:allow_failure], - job_type: build_attrs[:type] + stage: build_attrs[:stage] }) end end @@ -121,10 +121,10 @@ class Commit < ActiveRecord::Base return if skip_ci? return unless config_processor - build_types = builds.group_by(&:job_type) + stages = builds.group_by(&:stage) - config_processor.types.any? do |job_type| - !build_types.include?(job_type) && create_builds_for_type(job_type).present? + config_processor.stages.any? do |stage| + !stages.include?(stage) && create_builds_for_type(stage).present? end end @@ -132,8 +132,8 @@ class Commit < ActiveRecord::Base return if skip_ci? return unless config_processor - config_processor.types.any? do |job_type| - create_builds_for_type(job_type).present? + config_processor.stages.any? do |stage| + create_builds_for_type(stage).present? end end @@ -150,9 +150,9 @@ class Commit < ActiveRecord::Base def builds_without_retry_sorted return builds_without_retry unless config_processor - job_types = config_processor.types + stages = config_processor.stages builds_without_retry.sort_by do |build| - [job_types.index(build.job_type) || -1, build.name || ""] + [stages.index(build.stage) || -1, build.name || ""] end end diff --git a/app/views/builds/_build.html.haml b/app/views/builds/_build.html.haml index 598f734..4fa90c1 100644 --- a/app/views/builds/_build.html.haml +++ b/app/views/builds/_build.html.haml @@ -7,7 +7,7 @@ %strong Build ##{build.id} %td - = build.job_type + = build.stage %td = build.name diff --git a/app/views/commits/_commit.html.haml b/app/views/commits/_commit.html.haml index a273f09..59e116a 100644 --- a/app/views/commits/_commit.html.haml +++ b/app/views/commits/_commit.html.haml @@ -3,7 +3,7 @@ = commit.status - if commit.running? · - = commit.job_type + = commit.stage %td.build-link diff --git a/app/views/commits/show.html.haml b/app/views/commits/show.html.haml index d335754..2c1f40c 100644 --- a/app/views/commits/show.html.haml +++ b/app/views/commits/show.html.haml @@ -49,7 +49,7 @@ - unless @commit.push_data[:ci_yaml_file] .bs-callout.bs-callout-warning \.gitlab-ci.yml not found in this commit - + %h3 Status .build.alert{class: commit_status_alert_class(@commit)} @@ -68,7 +68,7 @@ %tr %th Status %th Build ID - %th Type + %th Stage %th Name %th Duration %th Finished at @@ -86,7 +86,7 @@ %tr %th Status %th Build ID - %th Type + %th Stage %th Name %th Duration %th Finished at diff --git a/app/views/lints/_create.html.haml b/app/views/lints/_create.html.haml index f82b406..458af71 100644 --- a/app/views/lints/_create.html.haml +++ b/app/views/lints/_create.html.haml @@ -10,10 +10,10 @@ %th Parameter %th Value %tbody - - @types.each do |type| - - @builds.select { |build| build[:type] == type }.each do |build| + - @stages.each do |stage| + - @builds.select { |build| build[:stage] == stage }.each do |build| %tr - %td #{type.capitalize} Job - #{build[:name]} + %td #{stage.capitalize} Job - #{build[:name]} %td %pre = simple_format build[:script] |