-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkiln_helpers.sh
37 lines (30 loc) · 1.02 KB
/
kiln_helpers.sh
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
#!/bin/bash
import_application() {
header_file=$(mktemp /tmp/shipyard-test.XXXXXX)
# Import Application
curl --fail "${DEFAULT_CURL_ARGS[@]}" \
-D $header_file \
-o /dev/null \
-F file=@$2 \
-F name=$1 \
-F envVar="SOME_VAR=abc1234" \
-F envVar="OTHER_VAR=other" \
${API_BASE_PATH}organizations/$APIGEE_ORG/apps
check_success_return $? "create application"
# return rev number
location=$(cat $header_file | grep Location | cut -d " " -f 2 | sed $'s/\r//')
rev_num="$(basename $location)"
rm -f $header_file
echo $rev_num
}
verify_application_exists() {
curl --fail "${DEFAULT_CURL_ARGS[@]}" \
${API_BASE_PATH}organizations/$APIGEE_ORG/apps/$1/version/$2 > /dev/null
check_success_return $? "lookup application"
}
remove_application() {
curl --fail "${DEFAULT_CURL_ARGS[@]}" \
-X DELETE \
${API_BASE_PATH}organizations/$APIGEE_ORG/apps/$1 > /dev/null
check_success_return $? "remove application"
}