Skip to content

Commit

Permalink
Merge pull request #44 from cloud-gov/chore-ci-update
Browse files Browse the repository at this point in the history
update pipeline for most recent available templates
  • Loading branch information
drewbo authored Jul 1, 2024
2 parents 15fb48b + a047356 commit 65d3dc5
Showing 1 changed file with 94 additions and 151 deletions.
245 changes: 94 additions & 151 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,159 +1,108 @@
############################
# SHARED

email-cf: &email-cf
CF_API: https://api.fr.cloud.gov
CF_USERNAME: ((email-cf-username))
CF_PASSWORD: ((email-cf-password))
CF_ORG: gsa-18f-federalist
CF_SPACE: email
CF_APP_NAME: pages-mailer
CF_STACK: cflinuxfs4
#! SHARED

test: &test
- task: install-deps
image: node
file: src/ci/partials/install-deps.yml

- in_parallel:
- task: test
- task: install-deps
image: node
file: src/ci/partials/test.yml
file: src/ci/partials/install-deps.yml

- task: lint
image: node
file: src/ci/partials/lint.yml
- in_parallel:
- task: test
image: node
file: src/ci/partials/test.yml

- task: lint
image: node
file: src/ci/partials/lint.yml

############################
# JOBS
#! JOBS

jobs:
- name: test
plan:
- get: src
resource: pr
trigger: true
version: every
- put: #@ pr_hook("pending", "test")

- get: node
- get: general-task

- do: *test

on_failure: #@ pr_hook("failure", "test")
on_success: #@ pr_hook("success", "test")

- name: test
plan:
- get: src
resource: pr
trigger: true
version: every

- put: src
resource: pr
params:
path: src
status: pending
base_context: concourse
context: test

- get: node
- get: general-task

- do: *test

on_failure:
put: src
resource: pr
params:
path: src
status: failure
base_context: concourse
context: test

on_success:
put: src
resource: pr
params:
path: src
status: success
base_context: concourse
context: test

- name: deploy
plan:
- get: src
resource: src
trigger: true
passed: [set-pipeline]
params: {depth: 1}

- get: node
- get: general-task
- get: pipeline-tasks

- do: *test

- task: deploy
image: general-task
file: src/ci/partials/deploy.yml
params:
<<: *email-cf

on_failure:
try:
task: cancel-deployment
- name: deploy
plan:
- get: src
resource: src
trigger: true
passed: [set-pipeline]
params: { depth: 1 }

- get: node
- get: general-task
- get: pipeline-tasks

- do: *test

- task: deploy
image: general-task
file: src/ci/partials/deploy.yml
params:
_: #@ template.replace(data.values.env_cf_email)
CF_APP_NAME: pages-mailer

on_failure:
try:
task: cancel-deployment
image: general-task
file: pipeline-tasks/tasks/cancel-deployment.yml
params:
_: #@ template.replace(data.values.env_cf_email)
CF_APP_NAME: pages-mailer

on_failure: #@ slack_hook("failure", "deploy")
on_success: #@ slack_hook("success", "deploy")

- name: restage
plan:
- get: src
resource: src
passed: [set-pipeline]
params: { depth: 1 }
- get: general-task
- get: pipeline-tasks
- get: nightly
trigger: true

- task: restage
image: general-task
file: pipeline-tasks/tasks/cancel-deployment.yml
file: pipeline-tasks/tasks/restage.yml
params:
<<: *email-cf

on_failure:
put: slack
params:
text: |
:x: FAILED: pages mailer deployment
<$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_success:
put: slack
params:
text: |
:white_check_mark: SUCCESS: Successfully deployed pages mailer
<$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: restage
plan:
- get: src
resource: src
passed: [set-pipeline]
params: {depth: 1}
- get: general-task
- get: pipeline-tasks
- get: nightly
trigger: true

- task: restage
image: general-task
file: pipeline-tasks/tasks/restage.yml
params:
<<: *email-cf

- name: set-pipeline
serial: true
plan:
- get: src
params: {depth: 1}
trigger: true
- get: pipeline-tasks
- get: general-task
- task: init
image: general-task
file: pipeline-tasks/tasks/init.yml
params:
PIPELINE_YML: src/ci/pipeline.yml
- set_pipeline: mailer
file: compiled/set-pipeline.yml

############################
# RESOURCES
_: #@ template.replace(data.values.env_cf_email)
CF_APP_NAME: pages-mailer

- name: set-pipeline
serial: true
plan:
- get: src
params: { depth: 1 }
trigger: true
- get: pipeline-tasks
- get: general-task
- task: init
image: general-task
file: pipeline-tasks/tasks/init.yml
params:
PIPELINE_YML: src/ci/pipeline.yml
- set_pipeline: mailer
file: compiled/set-pipeline.yml

resources:
#! RESOURCES

resources:
- name: pr
type: pull-request
check_every: 1m
Expand All @@ -172,25 +121,19 @@ resources:
branch: main
commit_verification_keys: ((cloud-gov-pages-gpg-keys))

- name: pipeline-tasks
type: git
source:
uri: ((pipeline-tasks-git-url))
branch: main

- name: nightly
type: time
source:
start: 12:00 AM
stop: 1:00 AM
location: America/New_York

- name: pipeline-tasks
- name: slack
- name: node
- name: general-task

############################
# RESOURCE TYPES
#! RESOURCE TYPES

resource_types:
- name: git
Expand Down

0 comments on commit 65d3dc5

Please sign in to comment.