Skip to content

Commit

Permalink
[patch] Run watsonstudio cfg even if cp4d not installed locally for g…
Browse files Browse the repository at this point in the history
…itops (#1467)
  • Loading branch information
whitfiea authored Feb 26, 2025
1 parent 967a049 commit 42d478a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
2 changes: 2 additions & 0 deletions image/cli/mascli/functions/gitops_mas_config
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,13 @@ function gitops_mas_config() {
# Source: gitops_suite_watson_studio_config
# ---------------------------------------------------------------------------
if [ "${MAS_CONFIG_TYPE}" == "watsonstudio" ]; then
sm_login
# Secrets are stored in SM in the cp4d-service function that installs wsl
export WATSON_STUDIO_SECRET=${ACCOUNT_ID}${SECRETS_KEY_SEPERATOR}${CLUSTER_ID}${SECRETS_KEY_SEPERATOR}${MAS_INSTANCE_ID}${SECRETS_KEY_SEPERATOR}wsl-cp4d
export SECRET_KEY_WATSON_STUDIO_USERNAME=${WATSON_STUDIO_SECRET}#username
export SECRET_KEY_WATSON_STUDIO_PASSWORD=${WATSON_STUDIO_SECRET}#password
export SECRET_KEY_WATSON_STUDIO_URL=${WATSON_STUDIO_SECRET}#url
sm_verify_secret_exists $WATSON_STUDIO_SECRET "username,password,url"
fi

echo
Expand Down
46 changes: 41 additions & 5 deletions tekton/src/pipelines/gitops/gitops-mas-apps.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -1265,8 +1265,6 @@ spec:
value: predict
- name: mas_workspace_id
value: $(params.mas_workspace_id)
- name: mas_config_scope
value: wsapp

taskRef:
kind: Task
Expand All @@ -1275,9 +1273,6 @@ spec:
- input: "$(params.mas_app_channel_predict)"
operator: notin
values: [""]
- input: "$(params.cp4d_wsl_action)"
operator: in
values: ["install"]

workspaces:
- name: configs
Expand Down Expand Up @@ -1962,6 +1957,47 @@ spec:
operator: in
values: ["standard", "premium"]

# 7.4 IoT JDBC Config
- name: gitops-delete-jdbc-config-iot
runAfter:
- gitops-deprovision-db2u-database-iot
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/gitops/common/gitops-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/gitops/common/secrets-params.yml.j2') | indent(8) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/gitops/common/git-params.yml.j2') | indent(8) }}

- name: mas_instance_id
value: $(params.mas_instance_id)
- name: mas_app_id
value: iot
- name: mas_config_scope
value: system
- name: mas_workspace_id
value: $(params.mas_workspace_id)
- name: jdbc_type
value: $(params.jdbc_type_iot)
- name: jdbc_instance_name
value: $(params.jdbc_instance_name_iot)
- name: jdbc_connection_url
value: $(params.jdbc_connection_url_iot)
- name: jdbc_certificate_file
value: $(params.jdbc_certificate_file_iot)
- name: jdbc_route
value: $(params.jdbc_route_iot)
workspaces:
- name: configs
workspace: configs
taskRef:
kind: Task
name: gitops-delete-jdbc-config
when:
- input: "$(params.mas_app_channel_iot)"
operator: in
values: [""]
- input: "$(params.mas_edition)"
operator: in
values: ["essentials-maintenance", "standard", "premium"]

# 8. Deprovision Kafka config
# -------------------------------------------------------------------------
- name: gitops-delete-kafka-config
Expand Down

0 comments on commit 42d478a

Please sign in to comment.