-
Notifications
You must be signed in to change notification settings - Fork 3
/
task.sh
executable file
·68 lines (58 loc) · 1.4 KB
/
task.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -o errexit
set -o nounset
set -o xtrace
host="${HOST:-localhost:8080/hub}"
# Port Forwarding
kubectl port-forward service/tackle-ui 8080:8080 -n konveyor-tackle > /dev/null 2>&1 &
pid=$!
# kill the port-forward regardless of how this script exits
trap '{
kill $pid
}' EXIT
# wait for port to become available
while ! nc -vz localhost 8080 > /dev/null 2>&1 ; do
sleep 0.1
done
# Create a Stake Holder Group
curl -X POST ${host}/stakeholdergroups -d \
'{
"name": "Big Dogs",
"description": "Group of big dogs."
}' | jq -M .
# Create a Stake Holder
curl -X POST ${host}/stakeholders -d \
'{
"name": "tackle",
"displayName":"Elmer",
"email": "tackle@konveyor.org",
"role": "Administrator",
"stakeholderGroups": [{"id": 1}],
"jobFunction" : {"id": 1}
}' | jq -M .
# Create a Business Service
curl -X POST ${host}/businessservices -d \
'{
"createUser": "tackle",
"name": "Marketing",
"Description": "Marketing Dept.",
"owner": {
"id": 1
}
}' | jq -M .
# Create an Application
curl -X POST ${host}/applications -d \
'{
"createUser": "tackle",
"name":"JkubeDemo",
"description": "Spring Boot demo application.",
"repository": {
"name": "jkube_demo",
"url": "https://github.com/mundra-ankur/jkube_demo.git",
"branch": "main"
},
"facts": {
"analysed": true
},
"businessService": {"id":1}
}' | jq -M .