-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcicd-last-step
More file actions
executable file
·41 lines (37 loc) · 929 Bytes
/
cicd-last-step
File metadata and controls
executable file
·41 lines (37 loc) · 929 Bytes
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
#!/bin/bash
set -e
app=log_publisher_app
vehicle_id=all
device=hpc2
registry="docker.io/sboettdev"
team=caliperkings
image_name="${team}_${app}"
workload=$(cat <<EOF
{
"name": "$app",
"agent": "$device",
"restart_policy": "never",
"image": "$registry/$image_name:latest",
"options": ["--net=host", "--ipc=host", "-e", "THRESHOLD_VALUE=24", "-e", "VEHICLE_ID=XYZ123", "-e", "REPORT_DASHBOARD_URI=<report_uri_dashboard>"]
}
EOF
)
# deploy
mosquitto_pub -d \
-h 3345d71141b94f0eb2ec8c60a153d4d3.s1.eu.hivemq.cloud \
-u hackathon \
-P CaliperKing7 \
-p 8883 \
-t /vehicle/$vehicle_id/workload/start \
-m "$workload"
# run it for 1 min
echo "running the workload for 1 min..."
sleep 60
# stop
mosquitto_pub -d \
-h 3345d71141b94f0eb2ec8c60a153d4d3.s1.eu.hivemq.cloud \
-u hackathon \
-P CaliperKing7 \
-p 8883 \
-t /vehicle/$vehicle_id/workload/stop \
-m "$app"