Browse Source
Add example pipelines
Add example pipelines
Copied all the example pipelines from concourse-ci.org into this repo and added a new example pipeline to show how the `set_pipeline` step works Signed-off-by: Taylor Silva <tsilva@pivotal.io>pull/3/head
13 changed files with 503 additions and 0 deletions
-
25pipelines/git-triggered.yml
-
89pipelines/golang-lib.yml
-
14pipelines/hello-world.yml
-
65pipelines/job-and-task-hooks.yml
-
52pipelines/manually-triggered.yml
-
32pipelines/nodejs-app-testing.yml
-
39pipelines/php-larvel-app-testing.yml
-
26pipelines/pipeline-vars.yml
-
49pipelines/rails-app-testing.yml
-
15pipelines/serial-job.yml
-
44pipelines/set-pipelines.yml
-
30pipelines/task-passing-artifact.yml
-
23pipelines/time-triggered.yml
@ -0,0 +1,25 @@ |
|||
--- |
|||
resources: |
|||
- name: concourse-docs-git |
|||
type: git |
|||
icon: github-circle |
|||
source: |
|||
uri: https://github.com/concourse/docs |
|||
|
|||
jobs: |
|||
- name: job |
|||
public: true |
|||
plan: |
|||
- get: concourse-docs-git |
|||
trigger: true |
|||
- task: list-files |
|||
config: |
|||
inputs: |
|||
- name: concourse-docs-git |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: ls |
|||
args: ["-la", "./concourse-docs-git"] |
|||
@ -0,0 +1,89 @@ |
|||
--- |
|||
resources: |
|||
- name: golang-mock-git |
|||
type: git |
|||
icon: github-circle |
|||
source: |
|||
uri: https://github.com/golang/mock.git |
|||
|
|||
- name: golang-1.11.x-image |
|||
type: registry-image |
|||
icon: docker |
|||
source: |
|||
repository: golang |
|||
tag: 1.11-stretch |
|||
|
|||
- name: golang-1.12.x-image |
|||
type: registry-image |
|||
icon: docker |
|||
source: |
|||
repository: golang |
|||
tag: 1.12-stretch |
|||
|
|||
- name: golang-1.13.x-image |
|||
type: registry-image |
|||
icon: docker |
|||
source: |
|||
repository: golang |
|||
tag: 1.13-stretch |
|||
|
|||
task-config: &task-config |
|||
platform: linux |
|||
inputs: |
|||
- name: golang-mock-git |
|||
path: go/src/github.com/golang/mock |
|||
params: |
|||
GO111MODULE: "on" |
|||
run: |
|||
path: /bin/sh |
|||
args: |
|||
- -c |
|||
- | |
|||
GOPATH=$PWD/go |
|||
|
|||
cd go/src/github.com/golang/mock |
|||
|
|||
go vet ./... |
|||
go build ./... |
|||
go install github.com/golang/mock/mockgen |
|||
GO111MODULE=off go get -u golang.org/x/lint/golint |
|||
./ci/check_go_fmt.sh |
|||
./ci/check_go_lint.sh |
|||
./ci/check_go_generate.sh |
|||
./ci/check_go_mod.sh |
|||
go test -v ./... |
|||
|
|||
jobs: |
|||
- name: golang-1.11 |
|||
public: true |
|||
plan: |
|||
- get: golang-mock-git |
|||
trigger: true |
|||
- get: golang-1.11.x-image |
|||
trigger: true |
|||
- task: run-tests |
|||
image: golang-1.11.x-image |
|||
config: |
|||
<< : *task-config |
|||
- name: golang-1.12 |
|||
public: true |
|||
plan: |
|||
- get: golang-mock-git |
|||
trigger: true |
|||
- get: golang-1.12.x-image |
|||
trigger: true |
|||
- task: run-tests |
|||
image: golang-1.12.x-image |
|||
config: |
|||
<< : *task-config |
|||
- name: golang-1.13 |
|||
public: true |
|||
plan: |
|||
- get: golang-mock-git |
|||
trigger: true |
|||
- get: golang-1.13.x-image |
|||
trigger: true |
|||
- task: run-tests |
|||
image: golang-1.13.x-image |
|||
config: |
|||
<< : *task-config |
|||
@ -0,0 +1,14 @@ |
|||
--- |
|||
jobs: |
|||
- name: job |
|||
public: true |
|||
plan: |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, world!"] |
|||
@ -0,0 +1,65 @@ |
|||
--- |
|||
task-config: &task-config |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
|
|||
jobs: |
|||
- name: job |
|||
public: true |
|||
plan: |
|||
- task: successful-task |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: sh |
|||
args: ["-lc", "exit 0"] |
|||
on_success: |
|||
task: task-success |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: echo |
|||
args: ["This task succeeded!"] |
|||
on_abort: |
|||
task: task-aborted |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: echo |
|||
args: ["This task was aborted!"] |
|||
- task: failing-task |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: sh |
|||
args: ["-lc", "exit 1"] |
|||
on_failure: |
|||
task: task-failure |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: echo |
|||
args: ["This task failed!"] |
|||
on_success: |
|||
task: job-success |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: echo |
|||
args: ["This job succeeded!"] |
|||
on_failure: |
|||
task: job-failure |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: echo |
|||
args: ["This job failed!"] |
|||
on_abort: |
|||
task: job-aborted |
|||
config: |
|||
<< : *task-config |
|||
run: |
|||
path: echo |
|||
args: ["This job was aborted!"] |
|||
@ -0,0 +1,52 @@ |
|||
--- |
|||
resources: |
|||
- name: every-30s |
|||
type: time |
|||
icon: clock-outline |
|||
source: |
|||
interval: 30s |
|||
|
|||
jobs: |
|||
- name: triggered-first |
|||
public: true |
|||
plan: |
|||
- get: every-30s |
|||
trigger: true |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, world!"] |
|||
- name: not-triggered |
|||
public: true |
|||
plan: |
|||
- get: every-30s |
|||
passed: [triggered-first] |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, world!"] |
|||
- name: triggered-second |
|||
public: true |
|||
plan: |
|||
- get: every-30s |
|||
passed: [triggered-first] |
|||
trigger: true |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, world!"] |
|||
@ -0,0 +1,32 @@ |
|||
--- |
|||
resources: |
|||
- name: nodejs.org-git |
|||
type: git |
|||
icon: github-circle |
|||
source: |
|||
uri: https://github.com/nodejs/nodejs.org.git |
|||
|
|||
jobs: |
|||
- name: test |
|||
public: true |
|||
plan: |
|||
- get: nodejs.org-git |
|||
trigger: true |
|||
- task: run-tests |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: node, tag: "8" } |
|||
inputs: |
|||
- name: nodejs.org-git |
|||
run: |
|||
path: /bin/sh |
|||
args: |
|||
- -c |
|||
- | |
|||
echo "Node Version: $(node --version)" |
|||
echo "NPM Version: $(npm --version)" |
|||
cd nodejs.org-git |
|||
npm install |
|||
npm test |
|||
@ -0,0 +1,39 @@ |
|||
--- |
|||
resources: |
|||
- name: larvel-websockets-git |
|||
type: git |
|||
icon: github-circle |
|||
source: |
|||
uri: https://github.com/beyondcode/laravel-websockets.git |
|||
|
|||
jobs: |
|||
- name: test |
|||
public: true |
|||
plan: |
|||
- get: larvel-websockets-git |
|||
trigger: true |
|||
- task: run-tests |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: php, tag: 7.2-cli } |
|||
inputs: |
|||
- name: larvel-websockets-git |
|||
run: |
|||
path: /bin/sh |
|||
args: |
|||
- -c |
|||
- | |
|||
apt-get update |
|||
apt-get install -y git unzip |
|||
|
|||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" |
|||
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" |
|||
php composer-setup.php --filename=composer --install-dir=/usr/bin |
|||
php -r "unlink('composer-setup.php');" |
|||
|
|||
cd larvel-websockets-git |
|||
|
|||
composer install |
|||
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover |
|||
@ -0,0 +1,26 @@ |
|||
--- |
|||
jobs: |
|||
- name: ((first))-job |
|||
public: true |
|||
plan: |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, ((hello))!"] |
|||
- name: level-((number))-job |
|||
public: true |
|||
plan: |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, ((hello))!"] |
|||
@ -0,0 +1,49 @@ |
|||
--- |
|||
resources: |
|||
- name: rails-contributors-git |
|||
type: git |
|||
icon: github-circle |
|||
source: |
|||
uri: https://github.com/rails/rails-contributors.git |
|||
|
|||
task-config: &task-config |
|||
platform: linux |
|||
inputs: |
|||
- name: rails-contributors-git |
|||
params: |
|||
RAILS_ENV: test |
|||
DATABASE_URL: postgresql://postgres@localhost |
|||
run: |
|||
path: /bin/bash |
|||
args: |
|||
- -c |
|||
- | |
|||
echo "=== Setting up Postgres..." |
|||
apt-get update |
|||
apt-get install -y postgresql libpq-dev cmake nodejs |
|||
cat > /etc/postgresql/*/main/pg_hba.conf <<-EOF |
|||
host all postgres localhost trust |
|||
EOF |
|||
service postgresql restart |
|||
echo "=== Project requires that we clone rails... " |
|||
cd rails-contributors-git |
|||
git clone --mirror https://github.com/rails/rails |
|||
echo "=== Installing Gems..." |
|||
gem install -N bundler |
|||
bundle install |
|||
echo "=== Running Tests..." |
|||
bundle exec rails db:setup |
|||
bundle exec rails test |
|||
|
|||
jobs: |
|||
- name: test |
|||
public: true |
|||
plan: |
|||
- get: rails-contributors-git |
|||
trigger: true |
|||
- task: run-tests |
|||
config: |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: ruby, tag: 2.6 } |
|||
<< : *task-config |
|||
@ -0,0 +1,15 @@ |
|||
--- |
|||
jobs: |
|||
- name: serial-job |
|||
public: true |
|||
serial: true |
|||
plan: |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, world!"] |
|||
@ -0,0 +1,44 @@ |
|||
--- |
|||
resources: |
|||
- name: concourse-examples |
|||
type: git |
|||
icon: github-circle |
|||
source: |
|||
uri: https://github.com/concourse/examples |
|||
|
|||
jobs: |
|||
- name: set-example-pipelines |
|||
public: true |
|||
plan: |
|||
- get: concourse-examples |
|||
trigger: true |
|||
- set_pipeline: set-pipelines |
|||
file: concourse-examples/pipelines/set-pipelines.yml |
|||
- set_pipeline: job |
|||
file: concourse-examples/pipelines/hello-world.yml |
|||
- set_pipeline: serial-job |
|||
file: concourse-examples/pipelines/serial-job.yml |
|||
- set_pipeline: pipeline-vars |
|||
file: concourse-examples/pipelines/pipeline-vars.yml |
|||
vars: |
|||
first: initial |
|||
number: "9000" |
|||
hello: HAL |
|||
- set_pipeline: task-passing-artifact |
|||
file: concourse-examples/pipelines/task-passing-artifact.yml |
|||
- set_pipeline: time-triggered |
|||
file: concourse-examples/pipelines/time-triggered.yml |
|||
- set_pipeline: git-triggered |
|||
file: concourse-examples/pipelines/git-triggered.yml |
|||
- set_pipeline: manually-triggered |
|||
file: concourse-examples/pipelines/manually-triggered.yml |
|||
- set_pipeline: hooks |
|||
file: concourse-examples/pipelines/job-and-task-hooks.yml |
|||
- set_pipeline: golang-lib |
|||
file: concourse-examples/pipelines/golang-lib.yml |
|||
- set_pipeline: rails |
|||
file: concourse-examples/pipelines/rails-app-testing.yml |
|||
- set_pipeline: nodejs |
|||
file: concourse-examples/pipelines/nodejs-app-testing.yml |
|||
- set_pipeline: php |
|||
file: concourse-examples/pipelines/php-larvel-app-testing.yml |
|||
@ -0,0 +1,30 @@ |
|||
--- |
|||
jobs: |
|||
- name: create-and-consume |
|||
public: true |
|||
plan: |
|||
- task: make-a-file |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: sh |
|||
args: |
|||
- -exc |
|||
- ls -la; echo "Created a file on $(date)" > ./files/created_file |
|||
outputs: |
|||
- name: files |
|||
- task: consume-the-file |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
inputs: |
|||
- name: files |
|||
run: |
|||
path: cat |
|||
args: |
|||
- ./files/created_file |
|||
@ -0,0 +1,23 @@ |
|||
--- |
|||
resources: |
|||
- name: every-30s |
|||
type: time |
|||
icon: clock-outline |
|||
source: |
|||
interval: 30s |
|||
|
|||
jobs: |
|||
- name: job |
|||
public: true |
|||
plan: |
|||
- get: every-30s |
|||
trigger: true |
|||
- task: simple-task |
|||
config: |
|||
platform: linux |
|||
image_resource: |
|||
type: registry-image |
|||
source: { repository: busybox } |
|||
run: |
|||
path: echo |
|||
args: ["Hello, world!"] |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue