Skip to content

Commit

Permalink
chore(ci): pipeline needs imports
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed Jul 2, 2024
1 parent 65d3dc5 commit 065f89d
Showing 1 changed file with 54 additions and 35 deletions.
89 changes: 54 additions & 35 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,57 @@
#! SHARED
---
#@ load("funcs.lib.yml", "slack_hook", "pr_hook")
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")

test: &test
- task: install-deps
image: node
file: src/ci/partials/install-deps.yml
#@ env = data.values.env

- in_parallel:
- task: test
image: node
file: src/ci/partials/test.yml
#! SHARED

- task: lint
image: node
file: src/ci/partials/lint.yml
test: &test #! JOBS

#! JOBS

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

params:
#@ if/end env != 'test':
depth: 1
#@ if/end env == 'test':
integration_tool: checkout
- #@ pr_hook("pending", "test")
- get: node
- get: general-task
- task: install-deps
image: node
file: src/ci/partials/install-deps.yml

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

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

#@ if env == 'test':
on_failure: #@ pr_hook("failure", "test")
on_success: #@ pr_hook("success", "test")
#@ end

#@ if env == 'deploy':
- name: deploy
plan:
- get: src
resource: src
trigger: true
passed: [set-pipeline]
passed: [set-pipeline, test]
params: { depth: 1 }

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

- do: *test

- task: deploy
image: general-task
file: src/ci/partials/deploy.yml
Expand All @@ -69,7 +74,6 @@ jobs:
- name: restage
plan:
- get: src
resource: src
passed: [set-pipeline]
params: { depth: 1 }
- get: general-task
Expand All @@ -83,27 +87,35 @@ jobs:
params:
_: #@ template.replace(data.values.env_cf_email)
CF_APP_NAME: pages-mailer
#@ end

- name: set-pipeline
serial: true
plan:
- get: src
params: { depth: 1 }
params:
#@ if/end env != 'test':
depth: 1
#@ if/end env == 'test':
integration_tool: checkout
trigger: true
- get: pipeline-tasks
- get: general-task
- task: init
- task: boot
image: general-task
file: pipeline-tasks/tasks/init.yml
file: pipeline-tasks/tasks/boot.yml
params:
PIPELINE_YML: src/ci/pipeline.yml
- set_pipeline: mailer
ENV_OVERRIDE: src/ci/pipeline.yml
- set_pipeline: self
file: compiled/set-pipeline.yml
instance_vars:
deploy-env: ((deploy-env))

#! RESOURCES

resources:
- name: pr
#@ if/end env == 'test':
- name: src
type: pull-request
check_every: 1m
source:
Expand All @@ -113,12 +125,13 @@ resources:
disable_forks: true
ignore_drafts: false

#@ if env == 'deploy':
- name: src
type: git
icon: github
source:
uri: https://github.com/cloud-gov/pages-mailer
branch: main
branch: chore-ci-update
commit_verification_keys: ((cloud-gov-pages-gpg-keys))

- name: nightly
Expand All @@ -128,16 +141,22 @@ resources:
stop: 1:00 AM
location: America/New_York

- name: pipeline-tasks
- name: slack
#@ end

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

#! RESOURCE TYPES

resource_types:
- name: git
- name: pull-request
- name: slack-notification
- name: time

- name: registry-image
#@ if env == 'deploy':
- name: time
- name: slack-notification
#@ end
#@ if/end env == 'test':
- name: pull-request

0 comments on commit 065f89d

Please sign in to comment.