Skip to content

Commit

Permalink
Replace cryogenics golang dep bumps with golang-package tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
aramprice committed Sep 5, 2024
1 parent 95d4b3c commit 4cb86ba
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 92 deletions.
133 changes: 41 additions & 92 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ groups:
- update-homebrew-formula
- name: bump
jobs:
- bump-golang
- bump-go-module
- bump-deps-bbr-cli
- bump-deps-s3-config-validator

- name: registry-images
jobs:
Expand Down Expand Up @@ -146,6 +146,13 @@ resource_types:
username: *docker_username
password: *docker_password

- name: golang-image
type: registry-image
source:
repository: golang
username: *docker_username
password: *docker_password

- name: google-chat-notify-resource
type: registry-image
source:
Expand Down Expand Up @@ -1066,111 +1073,53 @@ jobs:
action: release
resource: additional-environment

- name: bump-golang
serial: true
- name: bump-deps-bbr-cli
plan:
- in_parallel:
- get: cryogenics-concourse-tasks
resource: cryogenics-ci
- get: golang-release
- get: weekly
trigger: true
- get: bosh-backup-and-restore
resource: main
params:
branch: master
- get: image-cryogenics-essentials
- task: update-gomod-directive-for-bbr-cli
image: image-cryogenics-essentials
file: cryogenics-concourse-tasks/tasks/bosh/update-go-directive/task.yml
params:
PATH_TO_GO_MODULE: .
- get: golang-release
- get: golang-image
- task: bump-deps
file: golang-release/ci/tasks/shared/bump-deps.yml
input_mapping:
bosh-release-repo-with-vendored-golang: golang-release
golang-project-repo: bosh-backup-and-restore
input_repo: bosh-backup-and-restore
output_mapping:
golang-project-repo: bosh-backup-and-restore
- task: update-gomod-directive-for-s3-validator
image: image-cryogenics-essentials
file: cryogenics-concourse-tasks/tasks/bosh/update-go-directive/task.yml
params:
PATH_TO_GO_MODULE: s3-config-validator/src
output_repo: bumped-bosh-backup-and-restore
- task: test-unit
file: bosh-agent/ci/tasks/test-unit/task.yml
input_mapping:
bosh-release-repo-with-vendored-golang: golang-release
golang-project-repo: bosh-backup-and-restore
output_mapping:
golang-project-repo: bosh-backup-and-restore
- load_var: golang-release-version
file: golang-release/.git/describe_ref
- put: bosh-backup-and-restore-write-branch
bosh-backup-and-restore: bumped-bosh-backup-and-restore
- put: bosh-backup-and-restore
params:
repository: bosh-backup-and-restore
branch: &golang-vendor-branch bump-golang-based-on-golang-vendor-((.:golang-release-version))
force: true
- try:
task: create-golang-vendor-pull-request
image: image-cryogenics-essentials
file: cryogenics-concourse-tasks/github-automation/create-pr/task.yml
params:
BASE: master
BRANCH: *golang-vendor-branch
LABELS: dependencies
TITLE: Bump Golang based on golang-vendor-((.:golang-release-version))
MESSAGE: |
This is an automatically generated Pull Request from the Cryogenics CI Bot.
I have detected a new version of [golang-release](https://github.com/bosh-packages/golang-release) and automatically bumped this package to benefit from the latest changes.
If this does not look right, please reach out to the mapbu-cryogenics team.
input_mapping:
source-repo: bosh-backup-and-restore-write-branch
repository: bumped-bosh-backup-and-restore
rebase: true

- name: bump-go-module
serial: true
- name: bump-deps-s3-config-validator
plan:
- in_parallel:
- get: cryogenics-concourse-tasks
resource: cryogenics-ci
- get: every-day
- get: weekly
trigger: true
- get: bosh-backup-and-restore
resource: main
params:
branch: master
- get: image-cryogenics-essentials
- task: bump
image: image-cryogenics-essentials
file: cryogenics-concourse-tasks/deps-automation/bump-go-module/task.yml
- get: golang-release
- get: golang-image
- task: bump-deps
file: golang-release/ci/tasks/shared/bump-deps.yml
input_mapping:
source-repo: bosh-backup-and-restore
input_repo: bosh-backup-and-restore
output_mapping:
output_repo: bumped-bosh-backup-and-restore
params:
GIT_USERNAME: *github_user
GIT_EMAIL: *github_email
- try:
load_var: go-module-update-branch
file: destination-repo/.update-branch-name
on_success:
do:
- put: bosh-backup-and-restore-write-branch
params:
repository: destination-repo
branch: &go-module-branch ((.:go-module-update-branch))
- task: create-go-module-pull-request
image: image-cryogenics-essentials
file: cryogenics-concourse-tasks/github-automation/create-pr/task.yml
params:
BASE: master
BRANCH: *go-module-branch
LABELS: dependencies
TITLE: Bump go module ((.:go-module-update-branch))
MESSAGE: |
This is an automatically generated Pull Request from the Cryogenics CI Bot.
I have detected a new version of a go module and automatically bumped
it to benefit from the latest changes.
If this does not look right, please reach out to the mapbu-cryogenics team.
input_mapping:
source-repo: bosh-backup-and-restore-write-branch
SOURCE_PATH: s3-config-validator
- task: test-unit-s3-config-validator
file: bosh-agent/ci/tasks/test-unit-s3-config-validator/task.yml
input_mapping:
bosh-backup-and-restore: bumped-bosh-backup-and-restore
- put: bosh-backup-and-restore
params:
repository: bumped-bosh-backup-and-restore
rebase: true

- name: govulncheck
plan:
Expand Down
8 changes: 8 additions & 0 deletions ci/tasks/test-unit-s3-config-validator/task.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -euo pipefail
set -x

cd bosh-backup-and-restore/s3-config-validator/

make test-unit
13 changes: 13 additions & 0 deletions ci/tasks/test-unit-s3-config-validator/task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
platform: linux

image_resource:
type: registry-image
source:
repository: golang-image

inputs:
- name: bosh-backup-and-restore

run:
path: bosh-backup-and-restore/ci/tasks/test-unit-s3-config-validator/task.sh
8 changes: 8 additions & 0 deletions ci/tasks/test-unit/task.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -euo pipefail
set -x

cd bosh-backup-and-restore/

make test-unit
13 changes: 13 additions & 0 deletions ci/tasks/test-unit/task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
platform: linux

image_resource:
type: registry-image
source:
repository: golang-image

inputs:
- name: bosh-backup-and-restore

run:
path: bosh-backup-and-restore/ci/tasks/test-unit/task.sh

0 comments on commit 4cb86ba

Please sign in to comment.