From efdf54f25a83462a750cacd4ea7919c7d38e67d1 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 10 Jul 2015 14:56:09 +0200 Subject: Allow to specify flexible list of types in yaml ``` types: - test - deploy - notify rspec: script: "rspec" rubocop: script: "rubocop" staging: type: deploy script: "echo deploy" only: - master production: type: deploy script: "echo production" only: - tags dockerhub: type: notify script: "curl http://docker/hub/web/hook" downstream: type: notify script: "curl http://build/downstream/jobs" ``` This will trigger two test jobs in parallel, when finished it will trigged either staging or production, when finished it will trigger dockerhub and downstream in parallel. --- app/views/builds/_build.html.haml | 10 ++------ app/views/commits/_commit.html.haml | 4 ++++ app/views/commits/show.html.haml | 4 ++-- app/views/lints/_create.html.haml | 48 +++++++++++++------------------------ 4 files changed, 25 insertions(+), 41 deletions(-) (limited to 'app/views') diff --git a/app/views/builds/_build.html.haml b/app/views/builds/_build.html.haml index f2a340d..598f734 100644 --- a/app/views/builds/_build.html.haml +++ b/app/views/builds/_build.html.haml @@ -7,14 +7,8 @@ %strong Build ##{build.id} %td - - if build.commit.tag? - Tag - · - #{build.ref} - - else - Commit - · - #{build.short_sha} + = build.job_type + %td = build.name .pull-right diff --git a/app/views/commits/_commit.html.haml b/app/views/commits/_commit.html.haml index e5068d2..7fae74e 100644 --- a/app/views/commits/_commit.html.haml +++ b/app/views/commits/_commit.html.haml @@ -1,6 +1,10 @@ %tr.build.alert{class: commit_status_alert_class(commit)} %td.status = commit.status + - if commit.running? + · + = commit.job_type + %td.build-link = link_to project_ref_commit_path(commit.project, commit.ref, commit.sha) do diff --git a/app/views/commits/show.html.haml b/app/views/commits/show.html.haml index b1b586c..5925b9d 100644 --- a/app/views/commits/show.html.haml +++ b/app/views/commits/show.html.haml @@ -68,7 +68,7 @@ %tr %th Status %th Build ID - %th Trigger + %th Type %th Name %th Duration %th Finished at @@ -86,7 +86,7 @@ %tr %th Status %th Build ID - %th Trigger + %th Type %th Name %th Duration %th Finished at diff --git a/app/views/lints/_create.html.haml b/app/views/lints/_create.html.haml index 70b6f8c..f82b406 100644 --- a/app/views/lints/_create.html.haml +++ b/app/views/lints/_create.html.haml @@ -10,37 +10,23 @@ %th Parameter %th Value %tbody - - @builds.each do |build| - %tr - %td Job - #{build[:name]} - %td - %pre - = simple_format build[:script] - - %b Tag list: - = build[:tags] - %br - %b Refs only: - = build[:only] && build[:only].join(", ") - %br - %b Refs except: - = build[:except] && build[:except].join(", ") + - @types.each do |type| + - @builds.select { |build| build[:type] == type }.each do |build| + %tr + %td #{type.capitalize} Job - #{build[:name]} + %td + %pre + = simple_format build[:script] - - @deploy_builds.each do |build| - %tr - %td Deploy Job - #{build[:name]} - %td - %pre - = simple_format build[:script] - - %b Tag list: - = build[:tags] - %br - %b Refs only: - = build[:only] && build[:only].join(", ") - %br - %b Refs except: - = build[:except] && build[:except].join(", ") + %br + %b Tag list: + = build[:tags] + %br + %b Refs only: + = build[:only] && build[:only].join(", ") + %br + %b Refs except: + = build[:except] && build[:except].join(", ") -else %p @@ -49,5 +35,5 @@ %i.icon-remove.incorrect-syntax %b Error: = @error - + \ No newline at end of file -- cgit v1.2.1