Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Concourse Snippets
github-access-token: "......"
slack-notifications-webhook: http://hooks.slack.com.......
gcr-key: |
{
"type": "service_account",
"project_id": "myproject"
}
git-private-key: |-
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
cluster-url: http://api-server.kubernetes.com
website-cluster-ca: |-
.......
website-kube-token: |-
.......
jobs:
# job for building Docker image from master
- name: master-build
plan:
- get: website-master
trigger: true
- put: website-docker-image
params:
# Path to Docker image
build: website-master/
# This file will be used for the docker tag
tag: website-master/.git/ref
resources:
# Git resource - commits to master trigger new versions
- name: website-master
type: git
source:
uri: git@github.com:USER/REPO.git
branch: master
private_key: ((git-private-key))
# Docker Image
- name: website-docker-image
type: docker-image
source:
repository: eu.gcr.io/privateorg/website
username: _json_key
password: ((gcr-key))
jobs:
- name: website-PR-build
plan:
- get: website-PR
trigger: true
version: every
- put: website-PR-status
resource: website-PR
params:
path: website-PR
status: pending
- put: website-docker-image
params:
build: website-PR
# Tag with the PR ID https://github.com/jtarchie/github-pullrequest-resource#additional-files-populated
tag: website-PR/.git/id
#tag_prefix: 'PR_'
on_success:
put: website-PR-status
resource: website-PR
params:
path: website-PR
status: success
on_failure:
put: website-PR-status
resource: website-PR
params:
path: website-PR
status: failure
resources:
# Git resource - commits to master trigger new versions
- name: website-master
type: git
source:
uri: git@github.com:myorg/website.git
branch: master
private_key: ((git-private-key))
# Docker Image
- name: website-docker-image
type: docker-image
source:
repository: eu.gcr.io/myorg/website
username: _json_key
password: ((gcr-key))
# Pull request resource - New PRs trigger new versions
- name: website-PR
type: pull-request
source:
private_key: ((git-private-key))
access_token: ((github-access-token))
uri: git@github.com:myorg/website.git
repo: myorg/website
base: master
resource_types:
- name: pull-request
type: docker-image
source:
repository: jtarchie/pr
jobs:
- name: job-name
plan:
- put: slack-alert
params:
channel: "#daniels-slack-channel"
text: |
Website was built
Build:
https://concourse.hosted.com/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
resources:
- name: slack-alert
type: slack-notification
source:
url: ((slack-notifications-webhook))
resource_types:
- name: slack-notification
type: docker-image
source:
repository: cfcommunity/slack-notification-resource
tag: latest
jobs:
- task: random-task
config:
inputs:
- name: SOME_RESOURCE
outputs:
- name: lala
platform: linux
image_resource:
type: docker-image
source: { repository: alpine }
run:
path: 'sh'
args:
- -ec
- |
cat SOME_RESOURCE/file.txt > lala/result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.