forked from ibm-cloud-architecture/cp4i-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall-integration-instance-task.yaml
69 lines (68 loc) · 1.94 KB
/
uninstall-integration-instance-task.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: uninstall-integration-instance
spec:
inputs:
resources:
- name: source
type: git
params:
- name: integrationComponent
default: integration/tracing
description: The integration component that needs to be uninstalled.
- name: env
default: "dev"
description: Specfiy the current environment. It is used in computing the Helm release name.
steps:
- name: uninstall-instance
image: docker.io/rsundara/cp4i-setup
workingdir: /workspace/source
env:
- name: INTEGRATION_COMPONENT
value: $(inputs.params.integrationComponent)
- name: IBMCLOUD_PASSWORD
valueFrom:
secretKeyRef:
name: common-settings
key: password
- name: IBMCLOUD_USERNAME
valueFrom:
secretKeyRef:
name: common-settings
key: username
- name: CLUSTER
valueFrom:
secretKeyRef:
name: common-settings
key: url
- name: CLOUD_TYPE
valueFrom:
secretKeyRef:
name: common-settings
key: cloudType
- name: STORAGE_FILE
valueFrom:
secretKeyRef:
name: common-settings
key: fileStorage
- name: STORAGE_BLOCK
valueFrom:
secretKeyRef:
name: common-settings
key: blockStorage
- name: ENV
value: $(inputs.params.env)
command: ["/bin/sh"]
args:
- -c
- |
set -eu;
cloudctl login -a $CLUSTER -n integration -u $IBMCLOUD_USERNAME -p $IBMCLOUD_PASSWORD --skip-ssl-validation
echo Component : $INTEGRATION_COMPONENT;
echo Cloud type : $CLOUD_TYPE;
echo File Storage : $STORAGE_FILE;
echo Block Storage : $STORAGE_BLOCK;
cd $INTEGRATION_COMPONENT;
echo "Running uninstall.sh";
sh uninstall.sh;