-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(updatecli): provide a manifest to track geoip fileshare enddates (
#915) as per jenkins-infra/helpdesk#4486 provide an updatecli manifest to track geoip expiration for the fileshare (add a few corrections in docs and fmt)
- Loading branch information
Showing
3 changed files
with
112 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
updatecli/updatecli.d/fs-sp-writer-end-dates_publick8s.tf.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{{ range $key, $val := .end_dates.publick8s }} | ||
--- | ||
# yamllint disable rule:line-length | ||
name: "Generate new end date for {{ $val.service }} File Share service principal writer on publick8s" | ||
|
||
scms: | ||
default: | ||
kind: github | ||
spec: | ||
user: "{{ $.github.user }}" | ||
email: "{{ $.github.email }}" | ||
owner: "{{ $.github.owner }}" | ||
repository: "{{ $.github.repository }}" | ||
token: "{{ requiredEnv $.github.token }}" | ||
username: "{{ $.github.username }}" | ||
branch: "{{ $.github.branch }}" | ||
|
||
sources: | ||
currentEndDate: | ||
name: Get current `end_date` date | ||
kind: hcl | ||
spec: | ||
file: publick8s.tf | ||
path: module.{{ $key }}.service_principal_end_date | ||
nextEndDate: | ||
name: Prepare next `end_date` date within 3 months | ||
kind: shell | ||
spec: | ||
command: bash ./updatecli/scripts/dateadd.sh | ||
environments: | ||
- name: PATH | ||
|
||
conditions: | ||
checkIfEndDateSoonExpired: | ||
kind: shell | ||
sourceid: currentEndDate | ||
spec: | ||
# Current end_date date value passed as argument | ||
command: bash ./updatecli/scripts/datediff.sh | ||
environments: | ||
- name: PATH | ||
|
||
targets: | ||
updateNextEndDate: | ||
name: 'New end date for `{{ $val.service }}` File Share service principal writer on `publick8s` (current: {{ source "currentEndDate" }})' | ||
kind: hcl | ||
sourceid: nextEndDate | ||
spec: | ||
file: publick8s.tf | ||
path: module.{{ $key }}.service_principal_end_date | ||
scmid: default | ||
|
||
actions: | ||
default: | ||
kind: github/pullrequest | ||
scmid: default | ||
spec: | ||
title: 'Azure File Share Principal `{{ $val.service }}` on `publick8s` expires on `{{ source "currentEndDate" }}`' | ||
description: | | ||
This PR updates the end date of {{ $val.service }} File Share service principal writer used in publick8s for geoip. | ||
|
||
The current end date is set to `{{ source "currentEndDate" }}`. | ||
|
||
{{ $val.doc_how_to_get_credential | indent 8 }} | ||
|
||
labels: | ||
- terraform | ||
- "{{ $val.service }}" | ||
- end-dates | ||
- publick8s | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters