Last active
January 31, 2018 13:28
-
-
Save 2color/a63810ccb39d389fa0304604b545a614 to your computer and use it in GitHub Desktop.
Concourse Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |- | |
....... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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