Skip to content

Commit

Permalink
[minor] Added HMAC to COS role (#1228)
Browse files Browse the repository at this point in the history
Co-authored-by: unnati-solanki-git <[email protected]>
  • Loading branch information
Vishal-patel-7 and unnati-solanki-git authored Sep 10, 2024
1 parent b0035d3 commit 8b6b7c6
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tekton/src/params/install.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@
type: string
description: COS action to be performed (provision or deprovision)
default: ""
- name: use_hmac
type: string
description: Optional boolean variable weather hmac is enabled or not
default: ""

# MAS Integration - Grafana
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -638,7 +642,7 @@
default: ""
- name: mas_arcgis_channel
type: string
description: Default channel for IBM Maximo Location Services for ESRI
description: Default channel for IBM Maximo Location Services for ESRI
default: "" # default is handled by ansible-devops

# MAS Application Configuration - Health Application
Expand Down
3 changes: 3 additions & 0 deletions tekton/src/pipelines/fvt-deprovision-after.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ spec:
- name: cos_action
type: string
default: ""
- name: use_hmac
type: string
default: ""

# IBM Event Streams
- name: eventstreams_resourcegroup
Expand Down
5 changes: 5 additions & 0 deletions tekton/src/pipelines/gitops/deprovision-mas-deps.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ spec:
- name: ibmcloud_apikey
type: string
default: ""
- name: use_hmac
type: string
default: ""

tasks:
{% if wait_for_deprovision == true %}
Expand Down Expand Up @@ -198,6 +201,8 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: ibmcloud_apikey
value: $(params.ibmcloud_apikey)
- name: use_hmac
value: $(params.use_hmac)

workspaces:
- name: configs
Expand Down
6 changes: 6 additions & 0 deletions tekton/src/pipelines/gitops/gitops-mas-deps.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ spec:
type: string
description: COS action to be performed (provision or deprovision)
default: ""
- name: use_hmac
type: string
description: Optional boolean variable weather hmac is enabled or not
default: ""

- name: ibmcloud_apikey
type: string
Expand Down Expand Up @@ -214,6 +218,8 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: ibmcloud_apikey
value: $(params.ibmcloud_apikey)
- name: use_hmac
value: $(params.use_hmac)

workspaces:
- name: configs
Expand Down
2 changes: 2 additions & 0 deletions tekton/src/pipelines/taskdefs/dependencies/cos.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

- name: custom_labels
value: $(params.custom_labels)
- name: use_hmac
value: $(params.use_hmac)
taskRef:
kind: Task
name: mas-devops-cos
Expand Down
6 changes: 6 additions & 0 deletions tekton/src/tasks/dependencies/cos.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ spec:
type: string
description: Name of COS instance in IBM Cloud account
default: ""
- name: use_hmac
type: string
description: Optional boolean variable weather hmac is enabled or not
default: ""


stepTemplate:
Expand Down Expand Up @@ -72,6 +76,8 @@ spec:
value: $(params.cos_resourcegroup)
- name: IBMCLOUD_RESOURCEGROUP
value: $(params.ibmcloud_resourcegroup)
- name: USE_HMAC
value: $(params.use_hmac)
steps:
- name: cos
command:
Expand Down
8 changes: 6 additions & 2 deletions tekton/src/tasks/gitops/gitops-cos.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spec:
type: string
- name: ibmcloud_apikey
type: string
- name: use_hmac
type: string

stepTemplate:
name: gitops-cos
Expand Down Expand Up @@ -62,17 +64,19 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: IBMCLOUD_APIKEY
value: $(params.ibmcloud_apikey)
- name: USE_HMAC
value: $(params.use_hmac)
steps:
- args:
- |-
git config --global user.name "MAS Automation"
git config --global user.email "[email protected]"
git config --global user.password $GITHUB_PAT

export MAS_CONFIG_DIR=/workspace/configs/$MAS_INSTANCE_ID-cos
mkdir -p /workspace/configs/$MAS_INSTANCE_ID-cos
mkdir -p /tmp/init-cos

mas gitops-cos -a $ACCOUNT -c $CLUSTER_NAME \
--dir /tmp/init-cos \
--secrets-path $SECRET_PATH
Expand Down
4 changes: 4 additions & 0 deletions tekton/src/tasks/gitops/gitops-deprovision-cos.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
type: string
- name: ibmcloud_apikey
type: string
- name: use_hmac
type: string

stepTemplate:
name: gitops-deprovision-cos
Expand Down Expand Up @@ -75,6 +77,8 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: IBMCLOUD_APIKEY
value: $(params.ibmcloud_apikey)
- name: USE_HMAC
value: $(params.use_hmac)
steps:
- args:
- |-
Expand Down

0 comments on commit 8b6b7c6

Please sign in to comment.