forked from rjminsha/pipeline_service_docker_deployer_ice
-
Notifications
You must be signed in to change notification settings - Fork 6
/
exampleInventoryScript
93 lines (93 loc) · 4.07 KB
/
exampleInventoryScript
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
if [ "${TEST}" == "inventory" ]; then
IDS_INV_URL="${IDS_URL%/}"
IDS_REQUEST=$TASK_ID
IDS_DEPLOYER=${JOB_NAME##*/}
if [ ! -z "$COPYARTIFACT_BUILD_NUMBER" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$COPYARTIFACT_BUILD_NUMBER
elif [ ! -z "$CS_BUILD_SELECTOR" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$CS_BUILD_SELECTOR
else
IDS_VERSION_TYPE="SCM_REV_ID"
if [ ! -z "$GIT_COMMIT" ] ; then
IDS_VERSION=$GIT_COMMIT
elif [ ! -z "$RTCBuildResultUUID" ] ; then
IDS_VERSION=$RTCBuildResultUUID
fi
fi
IDS_RESOURCE=$CF_SPACE_ID
IDS_STATUS="8ff04768-215e-4ca5-936d-295bf3acf4f8"
echo "bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers -u $IDS_INV_URL -v $IDS_VERSION"
bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers -u $IDS_INV_URL -v $IDS_VERSION
exit 0
elif [[ "${TEST}" == "inventorygroup" ]]; then
IDS_INV_URL="${IDS_URL%/}"
IDS_REQUEST=$TASK_ID
IDS_DEPLOYER=${JOB_NAME##*/}
if [ ! -z "$COPYARTIFACT_BUILD_NUMBER" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$COPYARTIFACT_BUILD_NUMBER
elif [ ! -z "$CS_BUILD_SELECTOR" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$CS_BUILD_SELECTOR
else
IDS_VERSION_TYPE="SCM_REV_ID"
if [ ! -z "$GIT_COMMIT" ] ; then
IDS_VERSION=$GIT_COMMIT
elif [ ! -z "$RTCBuildResultUUID" ] ; then
IDS_VERSION=$RTCBuildResultUUID
fi
fi
IDS_RESOURCE=$CF_SPACE_ID
IDS_STATUS="de2e78c2-b31e-4fb4-9869-925af799bb5c"
echo "bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers_group -u $IDS_INV_URL -v $IDS_VERSION"
bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers_group -u $IDS_INV_URL -v $IDS_VERSION
exit 0
elif [[ "${TEST}" == "inventorystaging" ]]; then
IDS_INV_URL="${IDS_URL%/}"
IDS_REQUEST=$TASK_ID
IDS_DEPLOYER=${JOB_NAME##*/}
if [ ! -z "$COPYARTIFACT_BUILD_NUMBER" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$COPYARTIFACT_BUILD_NUMBER
elif [ ! -z "$CS_BUILD_SELECTOR" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$CS_BUILD_SELECTOR
else
IDS_VERSION_TYPE="SCM_REV_ID"
if [ ! -z "$GIT_COMMIT" ] ; then
IDS_VERSION=$GIT_COMMIT
elif [ ! -z "$RTCBuildResultUUID" ] ; then
IDS_VERSION=$RTCBuildResultUUID
fi
fi
IDS_RESOURCE=$CF_SPACE_ID
IDS_STATUS="ddc7a3ef-c4a2-401a-b6d9-935bef09f316"
echo "bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers -u $IDS_INV_URL -v $IDS_VERSION"
bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers -u $IDS_INV_URL -v $IDS_VERSION
exit 0
elif [[ "${TEST}" == "inventorygroupstaging" ]]; then
IDS_INV_URL="${IDS_URL%/}"
IDS_REQUEST=$TASK_ID
IDS_DEPLOYER=${JOB_NAME##*/}
if [ ! -z "$COPYARTIFACT_BUILD_NUMBER" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$COPYARTIFACT_BUILD_NUMBER
elif [ ! -z "$CS_BUILD_SELECTOR" ] ; then
IDS_VERSION_TYPE="JENKINS_BUILD_ID"
IDS_VERSION=$CS_BUILD_SELECTOR
else
IDS_VERSION_TYPE="SCM_REV_ID"
if [ ! -z "$GIT_COMMIT" ] ; then
IDS_VERSION=$GIT_COMMIT
elif [ ! -z "$RTCBuildResultUUID" ] ; then
IDS_VERSION=$RTCBuildResultUUID
fi
fi
IDS_RESOURCE=$CF_SPACE_ID
IDS_STATUS="c639c12f-0821-419f-bdc7-38ee304313e3"
echo "bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers_group -u $IDS_INV_URL -v $IDS_VERSION"
bash ids-inv -a insert -d $IDS_DEPLOYER -q $IDS_REQUEST -r $IDS_RESOURCE -s $IDS_STATUS -t ibm_containers_group -u $IDS_INV_URL -v $IDS_VERSION
exit 0
fi