diff --git a/pipelines/git-triggered.yml b/pipelines/git-triggered.yml new file mode 100644 index 0000000..3d0d8a7 --- /dev/null +++ b/pipelines/git-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"] diff --git a/pipelines/golang-lib.yml b/pipelines/golang-lib.yml new file mode 100644 index 0000000..bec3707 --- /dev/null +++ b/pipelines/golang-lib.yml @@ -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 diff --git a/pipelines/hello-world.yml b/pipelines/hello-world.yml new file mode 100644 index 0000000..ea0116a --- /dev/null +++ b/pipelines/hello-world.yml @@ -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!"] diff --git a/pipelines/job-and-task-hooks.yml b/pipelines/job-and-task-hooks.yml new file mode 100644 index 0000000..db19494 --- /dev/null +++ b/pipelines/job-and-task-hooks.yml @@ -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!"] diff --git a/pipelines/manually-triggered.yml b/pipelines/manually-triggered.yml new file mode 100644 index 0000000..d0d2f0b --- /dev/null +++ b/pipelines/manually-triggered.yml @@ -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!"] diff --git a/pipelines/nodejs-app-testing.yml b/pipelines/nodejs-app-testing.yml new file mode 100644 index 0000000..ff267ee --- /dev/null +++ b/pipelines/nodejs-app-testing.yml @@ -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 diff --git a/pipelines/php-larvel-app-testing.yml b/pipelines/php-larvel-app-testing.yml new file mode 100644 index 0000000..867a0e5 --- /dev/null +++ b/pipelines/php-larvel-app-testing.yml @@ -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 diff --git a/pipelines/pipeline-vars.yml b/pipelines/pipeline-vars.yml new file mode 100644 index 0000000..fc5b619 --- /dev/null +++ b/pipelines/pipeline-vars.yml @@ -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))!"] diff --git a/pipelines/rails-app-testing.yml b/pipelines/rails-app-testing.yml new file mode 100644 index 0000000..0b9fe76 --- /dev/null +++ b/pipelines/rails-app-testing.yml @@ -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 diff --git a/pipelines/serial-job.yml b/pipelines/serial-job.yml new file mode 100644 index 0000000..f6d5ebf --- /dev/null +++ b/pipelines/serial-job.yml @@ -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!"] diff --git a/pipelines/set-pipelines.yml b/pipelines/set-pipelines.yml new file mode 100644 index 0000000..2a209dc --- /dev/null +++ b/pipelines/set-pipelines.yml @@ -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 diff --git a/pipelines/task-passing-artifact.yml b/pipelines/task-passing-artifact.yml new file mode 100644 index 0000000..dc65fe4 --- /dev/null +++ b/pipelines/task-passing-artifact.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 diff --git a/pipelines/time-triggered.yml b/pipelines/time-triggered.yml new file mode 100644 index 0000000..a526821 --- /dev/null +++ b/pipelines/time-triggered.yml @@ -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!"]