-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflow_checkin.sh
executable file
·54 lines (40 loc) · 986 Bytes
/
flow_checkin.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
CURL='/usr/bin/curl'
CREDENTIALS='victor@trifacta.local:victor'
HOST='http://dev_env_server:3005'
#HOST='http://localhost:3005'
time=$(date +"%d-%m-%y %T")
echo
if (( $# < 4 ));
then
echo "Please call '$0 -f <flow_id> -t <tag_version>' to run this command"
echo
exit 1
else
while getopts f:t: option
do
case "${option}"
in
f) flow_id=${OPTARG};;
t) tag_version=${OPTARG};;
esac
done
fi
echo "Flow ID : "$flow_id
echo "Tag : "$tag_version
# ------------- Export a flow (zip package) ---------------
ENDPOINT="/v4/flows/$flow_id/package"
# GET : result is a zip file
echo
echo $CURL --user $CREDENTIALS $HOST$ENDPOINT -o flows/flow_$flow_id.zip
echo
output=$( $CURL --user $CREDENTIALS $HOST$ENDPOINT -o flows/flow_$flow_id.zip)
echo
ls -ls ./flows/flow_$flow_id.zip
# ------------- Commit and Push in Github ---------------
git add flows/flow_$flow_id.zip
echo
git commit -m "$tag_version - $time"
echo
git push
echo