Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Commit

Permalink
concourse: extract a basic PR pipeline from original
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
flavorjones committed Jan 19, 2019
1 parent fa028e4 commit 8e344af
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 244 deletions.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ RSpec::Core::RakeTask.new(:spec)

task :default => :spec

Concourse.new("chromedriver-helper", fly_target: "flavorjones").create_tasks!
Concourse.new("chromedriver-helper", fly_target: "flavorjones") do |c|
c.add_pipeline "chromedriver-helper", "chromedriver-helper.yml"
c.add_pipeline "chromedriver-helper-pr", "chromedriver-helper-pr.yml"
end
72 changes: 72 additions & 0 deletions concourse/chromedriver-helper-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# TODO update to new resource
resource_types:
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr

resources:
- name: ci
type: git
source:
uri: https://github.com/flavorjones/chromedriver-helper/
branch: master
disable_ci_skip: true # always get the latest pipeline configuration

# TODO update to new resource
- name: chromedriver-helper-pr
type: pull-request
source:
repo: flavorjones/chromedriver-helper
access_token: {{github-repo-status-access-token}}
ignore_paths:
- concourse/**

% ruby_version = RUBIES[:mri].last
jobs:
- name: pr-pending
public: true
plan:
- get: ci
- get: chromedriver-helper-pr
trigger: true
version: every
- put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: pending}

- name: ruby-<%= ruby_version %>
public: true
max_in_flight: 1
plan:
- get: ci
- get: chromedriver-helper-pr
trigger: true
version: every
passed: [pr-pending]
- task: rake-test
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ruby, tag: "<%= ruby_version %>"}
inputs:
- name: ci
- name: chromedriver-helper-pr
path: chromedriver-helper
run:
path: ci/concourse/tasks/rake-test/run.sh
on_failure:
put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: failure}

- name: pr-success
public: true
disable_manual_trigger: true
plan:
- get: chromedriver-helper-pr
trigger: true
version: every
passed:
- ruby-<%= ruby_version %>
- put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: success}
71 changes: 71 additions & 0 deletions concourse/chromedriver-helper-pr.yml.generated
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# TODO update to new resource
resource_types:
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr

resources:
- name: ci
type: git
source:
uri: https://github.com/flavorjones/chromedriver-helper/
branch: master
disable_ci_skip: true # always get the latest pipeline configuration

# TODO update to new resource
- name: chromedriver-helper-pr
type: pull-request
source:
repo: flavorjones/chromedriver-helper
access_token: {{github-repo-status-access-token}}
ignore_paths:
- concourse/**

jobs:
- name: pr-pending
public: true
plan:
- get: ci
- get: chromedriver-helper-pr
trigger: true
version: every
- put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: pending}

- name: ruby-2.6
public: true
max_in_flight: 1
plan:
- get: ci
- get: chromedriver-helper-pr
trigger: true
version: every
passed: [pr-pending]
- task: rake-test
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ruby, tag: "2.6"}
inputs:
- name: ci
- name: chromedriver-helper-pr
path: chromedriver-helper
run:
path: ci/concourse/tasks/rake-test/run.sh
on_failure:
put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: failure}

- name: pr-success
public: true
disable_manual_trigger: true
plan:
- get: chromedriver-helper-pr
trigger: true
version: every
passed:
- ruby-2.6
- put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: success}
129 changes: 0 additions & 129 deletions concourse/chromedriver-helper.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
anchors:
notify_failure_to_pr: &notify_failure_to_pr
put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: failure}

groups:
- name: master
jobs:
% RUBIES[:mri].last(2).each do |ruby_version|
- ruby-<%= ruby_version %>
% end
% RUBIES[:jruby].last(2).each do |ruby_version|
- jruby-<%= ruby_version %>
% end

- name: PRs
jobs:
- pr-pending
% RUBIES[:mri].last(1).each do |ruby_version|
- ruby-<%= ruby_version %>-pr
% end
% RUBIES[:jruby].last(1).each do |ruby_version|
- jruby-<%= ruby_version %>-pr
% end
- pr-success

- name: allow-failure
jobs:
% RUBIES[:windows].last(2).each do |ruby_version|
- win-ruby-<%= ruby_version %>-devkit
% end

resource_types:
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr

resources:
- name: ci
type: git
Expand All @@ -52,14 +14,6 @@ resources:
ignore_paths:
- concourse/**

- name: chromedriver-helper-pr
type: pull-request
source:
repo: flavorjones/chromedriver-helper
access_token: {{github-repo-status-access-token}}
ignore_paths:
- concourse/**

jobs:
% RUBIES[:mri].last(2).each do |ruby_version|
- name: ruby-<%= ruby_version %>
Expand Down Expand Up @@ -122,86 +76,3 @@ jobs:
run:
path: ci/concourse/tasks/rake-test/run.sh
% end

#
# PRs
#
- name: pr-pending
public: true
plan:
- get: ci
- get: chromedriver-helper-pr
trigger: true
version: every
- put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: pending}

% RUBIES[:mri].last(1).each do |ruby_version|
- name: ruby-<%= ruby_version %>-pr
public: true
max_in_flight: 1
plan:
- get: ci
- get: chromedriver-helper-pr
trigger: true
version: every
passed: [pr-pending]
- task: rake-test
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ruby, tag: "<%= ruby_version %>"}
inputs:
- name: ci
- name: chromedriver-helper-pr
path: chromedriver-helper
run:
path: ci/concourse/tasks/rake-test/run.sh
on_failure: *notify_failure_to_pr
% end

% RUBIES[:jruby].last(1).each do |ruby_version|
- name: jruby-<%= ruby_version %>-pr
public: true
max_in_flight: 1
plan:
- get: ci
- get: chromedriver-helper-pr
trigger: true
version: every
passed: [pr-pending]
- task: rake-test
attempts: 3
config:
platform: linux
image_resource:
type: docker-image
source: {repository: jruby, tag: "<%= ruby_version %>-jdk"}
inputs:
- name: ci
- name: chromedriver-helper-pr
path: chromedriver-helper
params:
JAVA_OPTS: "-Dfile.encoding=UTF8" # https://github.com/docker-library/openjdk/issues/32
run:
path: ci/concourse/tasks/rake-test/run.sh
on_failure: *notify_failure_to_pr
% end

- name: pr-success
public: true
disable_manual_trigger: true
plan:
- get: chromedriver-helper-pr
trigger: true
version: every
passed:
% RUBIES[:mri].last(1).each do |ruby_version|
- ruby-<%= ruby_version %>-pr
% end
% RUBIES[:jruby].last(1).each do |ruby_version|
- jruby-<%= ruby_version %>-pr
% end
- put: chromedriver-helper-pr
params: {path: chromedriver-helper-pr, status: success}
Loading

0 comments on commit 8e344af

Please sign in to comment.