Skip to content

Commit

Permalink
update to latest concourse-gem
Browse files Browse the repository at this point in the history
- split up PR and master pipelines
- extract some common pipeline pieces
  • Loading branch information
flavorjones committed Apr 23, 2019
1 parent 32fcb6f commit 49f1789
Show file tree
Hide file tree
Showing 8 changed files with 408 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pkg
tmp
Gemfile.lock
.bundle
concourse/*.yml
concourse/private.yml
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ task :generate_whitelists do
load "tasks/generate-whitelists"
end

Concourse.new("loofah").create_tasks!
Concourse.new("loofah", fly_target: "ci") do |c|
c.add_pipeline "loofah", "loofah.yml"
c.add_pipeline "loofah-pr", "loofah-pr.yml"
end
7 changes: 7 additions & 0 deletions concourse/common_prelude.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "json"

$common_ignore_paths = [
"CHANGELOG.md",
"README.md",
"concourse/**",
].to_json
7 changes: 7 additions & 0 deletions concourse/common_resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: ci
type: git
icon: "settings"
source:
uri: https://github.com/flavorjones/loofah/
branch: master
disable_ci_skip: true # always get the latest pipeline configuration
76 changes: 76 additions & 0 deletions concourse/loofah-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
% require "common_prelude.rb"

resources:
<%= erbify_file "common_resources.yml" -%>
- name: loofah-pr
type: pull-request
icon: "github-circle"
source:
repo: flavorjones/loofah
access_token: ((github-repo-status-access-token))
ignore_paths: <%= $common_ignore_paths %>

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

jobs:
- name: pr-pending
public: true
plan:
- get: loofah-pr
trigger: true
version: every
- put: loofah-pr
params:
path: loofah-pr
status: pending

- name: pr-success
public: true
disable_manual_trigger: true
plan:
- get: loofah-pr
trigger: true
version: every
passed:
% RUBIES[:mri].each do |ruby_version|
- ruby-<%= ruby_version %>-pr
% end
- put: loofah-pr
params:
path: loofah-pr
status: success

% RUBIES[:mri].each do |ruby_version|
- name: ruby-<%= ruby_version %>-pr
public: true
serial_groups: ["ruby-pr"]
plan:
- get: ci
- get: loofah-pr
trigger: true
version: every
passed: [pr-pending]
- task: rake-test
config:
image_resource:
type: docker-image
source: {repository: ruby, tag: "<%= ruby_version %>"}
platform: linux
inputs:
- name: ci
- name: loofah-pr
path: loofah
params:
NOKOGIRI_USE_SYSTEM_LIBRARIES: t
run:
path: ci/concourse/tasks/rake-test/run.sh
on_failure:
put: loofah-pr
params:
path: loofah-pr
status: failure
% end
164 changes: 164 additions & 0 deletions concourse/loofah-pr.yml.generated
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@

resources:
- name: ci
type: git
icon: "settings"
source:
uri: https://github.com/flavorjones/loofah/
branch: master
disable_ci_skip: true # always get the latest pipeline configuration
- name: loofah-pr
type: pull-request
icon: "github-circle"
source:
repo: flavorjones/loofah
access_token: ((github-repo-status-access-token))
ignore_paths: ["CHANGELOG.md","README.md","concourse/**"]

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

jobs:
- name: pr-pending
public: true
plan:
- get: loofah-pr
trigger: true
version: every
- put: loofah-pr
params:
path: loofah-pr
status: pending

- name: pr-success
public: true
disable_manual_trigger: true
plan:
- get: loofah-pr
trigger: true
version: every
passed:
- ruby-2.3-pr
- ruby-2.4-pr
- ruby-2.5-pr
- ruby-2.6-pr
- put: loofah-pr
params:
path: loofah-pr
status: success

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

0 comments on commit 49f1789

Please sign in to comment.