Skip to content

Commit

Permalink
Merge pull request #454 from cloud-gov/chore-simplify-ci-notifications
Browse files Browse the repository at this point in the history
chore: Simplify CI notifications from task hooks
  • Loading branch information
apburnes authored Feb 16, 2024
2 parents 8ed1ff1 + fe78d8c commit 74aa849
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 89 deletions.
34 changes: 8 additions & 26 deletions ci/pipeline-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,14 @@ jobs:
CF_DOCKER_PASSWORD: ((ecr-aws-secret))

on_failure:
in_parallel:
- put: slack
params:
text: |
:x: FAILED: pages build container deployment on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
put: slack
params:
text: |
:x: FAILED: pages build container deployment on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))

- name: nightly-((deploy-env))
plan:
Expand Down Expand Up @@ -193,23 +192,6 @@ jobs:
username: ((slack-username))
icon_url: ((slack-icon-url))

- name: report-success-((deploy-env))
plan:
- get: src
resource: pr-((git-branch))
trigger: true
passed: [deploy-((deploy-env))]
on_success:
in_parallel:
- put: slack
params:
text: |
:white_check_mark: SUCCESS: Successfully deployed pages build containers on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))

############################
# RESOURCES

Expand Down
98 changes: 35 additions & 63 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,35 +100,17 @@ jobs:
resource: src-((deploy-env))
trigger: true
params: {depth: 1}
- put: pr-((git-branch))
params:
path: pull-request
status: pending
context: concourse
- do: *test

on_success:
put: pr-((git-branch))
params:
path: pull-request
status: success
context: concourse

on_failure:
in_parallel:
- put: pr-((git-branch))
params:
path: pull-request
status: failure
context: concourse
- put: slack
params:
text: |
:x: FAILED: pages build container tests on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
put: slack
params:
text: |
:x: FAILED: pages build container tests on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))

- name: deploy-((deploy-env))
plan:
Expand Down Expand Up @@ -176,21 +158,25 @@ jobs:
CF_DOCKER_USERNAME: ((ecr-aws-key))
CF_DOCKER_PASSWORD: ((ecr-aws-secret))

on_success:
put: slack
params:
text: |
:white_check_mark: SUCCESS: Successfully deployed pages build containers on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))

on_failure:
in_parallel:
- put: pr-((git-branch))
params:
path: pull-request
status: failure
context: concourse
- put: slack
params:
text: |
:x: FAILED: pages build container deployment on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
put: slack
params:
text: |
:x: FAILED: pages build container deployment on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))

- name: nightly-((deploy-env))
plan:
Expand Down Expand Up @@ -229,29 +215,6 @@ jobs:
username: ((slack-username))
icon_url: ((slack-icon-url))

- name: report-success-((deploy-env))
plan:
- get: src
resource: src-((deploy-env))
trigger: true
params: {depth: 1}
passed: [deploy-((deploy-env))]
on_success:
in_parallel:
- put: pr-((git-branch))
params:
path: pull-request
status: success
context: concourse
- put: slack
params:
text: |
:white_check_mark: SUCCESS: Successfully deployed pages build containers on ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))

############################
# RESOURCES

Expand Down Expand Up @@ -301,6 +264,15 @@ resources:

resource_types:

- name: git
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: git-resource
aws_region: us-gov-west-1
tag: latest

- name: slack-notification
type: registry-image
source:
Expand Down

0 comments on commit 74aa849

Please sign in to comment.