Skip to content

Commit

Permalink
Updated ci pipelines to latest template
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisjbell committed Mar 14, 2018
1 parent b4e86d3 commit f464bda
Show file tree
Hide file tree
Showing 7 changed files with 524 additions and 93 deletions.
218 changes: 185 additions & 33 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,23 @@ meta:
target: (( param "Please identify the name of the target Concourse CI" ))
url: (( param "Please specify the full url of the target Concourse CI" ))
pipeline: (( concat meta.name "-boshrelease" ))
manifest:
path: (( concat "manifests/" meta.name ".yml" ))
vars: "--- {}"
vars-pr: (( grab meta.manifest.vars ))
operator_file_paths: "" # comma separated list relative to repo root

image: starkandwayne/concourse
git:
email: (( param "Please provide the git email for automated commits" ))
name: (( param "Please provide the git name for automated commits" ))

image:
name: starkandwayne/concourse
tag: latest

aws:
bucket: (( concat meta.pipeline "-pipeline" ))
region_name: us-east-1
access_key: (( param "Please set your AWS Access Key ID for your pipeline S3 Bucket" ))
secret_key: (( param "Please set your AWS Secret Key ID for your pipeline S3 Bucket" ))

Expand All @@ -35,9 +47,11 @@ meta:

bosh-lite:
target: (( param "Please specify the BOSH target URI for the bosh-lite to run test deployments against" ))
deployment: (( param "Please specify the name of the local bosh-lite (warden) deployment" ))
cacert: (( param "Please specify the BOSH Director Root CA cert" ))
username: admin
password: admin
password: (( param "Please specify the BOSH Director admin password" ))
deployment: (( concat meta.name "-testflight" ))
deployment-pr: (( concat meta.name "-testflight-pr" ))

slack:
webhook: (( param "Please specify your Slack Incoming Webhook Integration URL" ))
Expand All @@ -46,55 +60,155 @@ meta:
upset_moji: ":sad_panda:"
channel: (( param "Please specify the channel (#name) or user (@user) to send messages to" ))
username: concourse
icon: http://cl.ly/image/3e1h0H3H2s0P/concourse-logo.png
icon: https://cl.ly/2F421Y300u07/concourse-logo-blue-transparent.png
fail_url: '(( concat "<" meta.url "/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME| Concourse Failure! " meta.slack.upset_moji ">" ))'

groups:
- name: (( grab meta.pipeline ))
jobs:
- testflight
- testflight-pr
- rc
- shipit
- name: versioning
jobs:
- major
- minor
- patch

jobs:
- name: testflight
public: true
serial: true
plan:
- do:
- aggregate:
- name: main
do:
- name: get
aggregate:
- { get: git, trigger: true }
- task: testflight
- name: testflights
aggregate:
- name: testflight
task: testflight
config:
platform: linux
image_resource:
type: docker-image
source:
repository: (( grab meta.image.name ))
tag: (( grab meta.image.tag ))
inputs:
- { name: git }
run:
path: ./git/ci/scripts/testflight
args: []
params:
REPO_ROOT: git
BOSH_ENVIRONMENT: (( grab meta.bosh-lite.target ))
BOSH_CA_CERT: (( grab meta.bosh-lite.cacert ))
BOSH_CLIENT: (( grab meta.bosh-lite.username ))
BOSH_CLIENT_SECRET: (( grab meta.bosh-lite.password ))
BOSH_DEPLOYMENT: (( grab meta.bosh-lite.deployment ))
TEST_ERRANDS: (( grab meta.test-errands || meta.test-errand || ~ ))
AWS_ACCESS_KEY: (( grab meta.aws.access_key ))
AWS_SECRET_KEY: (( grab meta.aws.secret_key ))
MANIFEST_PATH: (( grab meta.manifest.path ))
MANIFEST_VARS: (( grab meta.manifest.vars ))
MANIFEST_OP_PATHS: (( grab meta.manifest.operator_file_paths ))
on_failure:
put: notify
params:
channel: (( grab meta.slack.channel ))
username: (( grab meta.slack.username ))
icon_url: (( grab meta.slack.icon ))
text: '(( concat meta.slack.fail_url " " meta.pipeline ": testflight job failed" ))'

- name: testflight-pr
public: true
serial: true
plan:
- name: main
do:
- name: get
aggregate:
- { get: git-pull-requests, trigger: true, version: every }
- name: pending-status
put: git-pull-requests
params:
path: git-pull-requests
status: pending
- name: testflights
aggregate:
- name: testflight
task: testflight
config:
platform: linux
image_resource:
type: docker-image
source:
repository: (( grab meta.image.name ))
tag: (( grab meta.image.tag ))
inputs:
- { name: git-pull-requests }
run:
path: ./git-pull-requests/ci/scripts/testflight
args: []
params:
REPO_ROOT: git-pull-requests
BOSH_ENVIRONMENT: (( grab meta.bosh-lite.target ))
BOSH_CA_CERT: (( grab meta.bosh-lite.cacert ))
BOSH_CLIENT: (( grab meta.bosh-lite.username ))
BOSH_CLIENT_SECRET: (( grab meta.bosh-lite.password ))
BOSH_DEPLOYMENT: (( grab meta.bosh-lite.deployment-pr ))
TEST_ERRANDS: (( grab meta.test-errands || meta.test-errand || ~ ))
AWS_ACCESS_KEY: (( grab meta.aws.access_key ))
AWS_SECRET_KEY: (( grab meta.aws.secret_key ))
MANIFEST_PATH: (( grab meta.manifest.path ))
MANIFEST_VARS: (( grab meta.manifest.vars-pr ))
MANIFEST_OP_PATHS: (( grab meta.manifest.operator_file_paths ))
on_success:
put: git-pull-requests
params:
path: git-pull-requests
status: success
on_failure:
put: git-pull-requests
params:
path: git-pull-requests
status: failure
- name: pr-success-message
task: pr-success-message
config:
platform: linux
image_resource:
type: docker-image
source:
repository: (( grab meta.image ))
repository: (( grab meta.image.name ))
tag: (( grab meta.image.tag ))
inputs:
- { name: git }
- { name: git-pull-requests }
outputs:
- { name: message }
run:
path: ./git/ci/scripts/testflight
args: []
params:
REPO_ROOT: git
BOSH_LITE_TARGET: (( grab meta.bosh-lite.target ))
BOSH_LITE_USERNAME: (( grab meta.bosh-lite.username ))
BOSH_LITE_PASSWORD: (( grab meta.bosh-lite.password ))
BOSH_LITE_DEPLOYMENT: (( grab meta.bosh-lite.deployment ))
TEST_ERRAND: (( grab meta.test-errand || ~ ))
on_failure:
path: sh
args:
- -ce
- |
cd git-pull-requests
pr_url=$(git config --get pullrequest.url)
cd -
echo "<${pr_url}|Pull request passed testflight> Merge when ready: ${pr_url}" > message/body
on_success:
put: notify
params:
channel: (( grab meta.slack.channel ))
username: (( grab meta.slack.username ))
icon_url: (( grab meta.slack.icon ))
text: '(( concat meta.slack.fail_url " " meta.pipeline ": test job failed" ))'
text_file: message/body

- name: rc
public: true
serial: true
plan:
- do:
- aggregate:
Expand All @@ -106,9 +220,10 @@ jobs:
image_resource:
type: docker-image
source:
repository: (( grab meta.image ))
repository: (( grab meta.image.name ))
tag: (( grab meta.image.tag ))
inputs:
- { name: git }
- { name: git }
run:
path: sh
args:
Expand Down Expand Up @@ -152,6 +267,20 @@ jobs:
icon_url: (( grab meta.slack.icon ))
text: '(( concat meta.slack.fail_url " " meta.pipeline ": minor job failed" ))'

- name: patch
public: true
plan:
- do:
- { get: version, trigger: false, params: {bump: patch} }
- { put: version, params: {file: version/number} }
on_failure:
put: notify
params:
channel: (( grab meta.slack.channel ))
username: (( grab meta.slack.username ))
icon_url: (( grab meta.slack.icon ))
text: '(( concat meta.slack.fail_url " " meta.pipeline ": patch job failed" ))'

- name: major
public: true
plan:
Expand Down Expand Up @@ -182,29 +311,28 @@ jobs:
image_resource:
type: docker-image
source:
repository: (( grab meta.image ))
repository: (( grab meta.image.name ))
tag: (( grab meta.image.tag ))
inputs:
- name: version
- name: git
outputs:
- name: gh
- name: pushme
- name: notifications
run:
path: ./git/ci/scripts/shipit
args: []
params:
REPO_ROOT: git
VERSION_FROM: version/number
RELEASE_NAME: (( concat meta.release " BOSH Release" ))
RELEASE_ROOT: gh
REPO_OUT: pushme
BRANCH: (( grab meta.github.branch ))

BOSH_LITE_TARGET: (( grab meta.bosh-lite.target ))
BOSH_LITE_USERNAME: (( grab meta.bosh-lite.username ))
BOSH_LITE_PASSWORD: (( grab meta.bosh-lite.password ))
BOSH_LITE_DEPLOYMENT: (( grab meta.bosh-lite.deployment ))

NOTIFICATION_OUT: notifications
BRANCH: (( grab meta.github.branch ))
GITHUB_OWNER: (( grab meta.github.owner ))
GIT_EMAIL: (( grab meta.git.email ))
GIT_NAME: (( grab meta.git.name ))
AWS_ACCESS_KEY: (( grab meta.aws.access_key ))
AWS_SECRET_KEY: (( grab meta.aws.secret_key ))

Expand All @@ -214,7 +342,7 @@ jobs:
rebase: true
repository: pushme/git
- name: tarball
put: s3
put: s3-tarball
params:
file: (( concat "gh/artifacts/" meta.name "-*.tgz" ))
- name: github-release
Expand All @@ -228,6 +356,14 @@ jobs:
put: version
params:
bump: patch
- name: notify
aggregate:
- put: notify
params:
channel: (( grab meta.slack.channel ))
username: (( grab meta.slack.username ))
icon_url: (( grab meta.slack.icon ))
text_file: notifications/message
on_failure:
put: notify
params:
Expand All @@ -242,6 +378,11 @@ resource_types:
source:
repository: cfcommunity/slack-notification-resource

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

resources:
- name: git
type: git
Expand All @@ -250,11 +391,21 @@ resources:
branch: (( grab meta.github.branch ))
private_key: (( grab meta.github.private_key ))

- name: git-pull-requests
type: pull-request
check_every: 15m # Required due to API throttling.
source:
access_token: (( grab meta.github.access_token ))
private_key: (( grab meta.github.private_key ))
repo: (( concat meta.github.owner "/" meta.github.repo ))
base: (( grab meta.github.branch ))

- name: version
type: semver
source :
driver: s3
bucket: (( grab meta.aws.bucket ))
region_name: (( grab meta.aws.region_name ))
key: version
access_key_id: (( grab meta.aws.access_key ))
secret_access_key: (( grab meta.aws.secret_key ))
Expand All @@ -272,10 +423,11 @@ resources:
repository: (( grab meta.github.repo ))
access_token: (( grab meta.github.access_token ))

- name: s3
- name: s3-tarball
type: s3
source:
bucket: (( grab meta.aws.bucket ))
region_name: (( grab meta.aws.region_name ))
regexp: (( concat meta.name "-(.*).tgz" ))
access_key_id: (( grab meta.aws.access_key ))
secret_access_key: (( grab meta.aws.secret_key ))
Loading

0 comments on commit f464bda

Please sign in to comment.