This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
deploy-edgeX-snaps.sh
executable file
·83 lines (62 loc) · 2.93 KB
/
deploy-edgeX-snaps.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# Set any of the following snap environment variables. Note you must also set TEST_ENV=localhost
# (in the env.sh file) as well. Note, EF_SNAP takes precedence over EF_CHANNEL and ASC_SNAP
# takes precedence over ASC_CHANNEL.
# If EF_CHANNEL is not set, it defaults to 'stable'.
#export EF_CHANNEL=
# If ASC_CHANNEL is not set, it defaults to 'stable'.
#export ASC_CHANNEL=
# If EF_SNAP is not set then EF_CHANNEL will be used.
# Accepted value: Expected absolute path of snap
#export EF_SNAP=
# If ASC_SNAP is not set then ASC_CHANNEL will be used.
# Accepted value: Expected absolute path of snap
# export ASC_SNAP=
timestamp() {
local ts=""
ts=$(date +"%Y-%m-%dT%T.%3N") # current time
echo "$ts -"
}
if [ -z "${TEST_ENV}" ]; then
echo "$(timestamp) TEST_ENV not set. Unable to continue"
exit
elif [ "${TEST_ENV}" != localhost ]; then
echo "$(timestamp) TEST_ENV not set to localhost. Unable to continue"
exit
fi
echo "============================================================================================"
echo " Deploying edgex snap test service for Blackbox"
echo "============================================================================================"
echo "$(timestamp) Removing edgexfoundry snap (if already installed)..."
sudo snap remove edgexfoundry --purge
echo "$(timestamp) Removing edgex-app-service-configurable snap (if already installed)..."
sudo snap remove edgex-app-service-configurable
echo "$(timestamp) Installing edgexfoundry snap..."
EF_CHANNEL="${EF_CHANNEL:-stable}"
if [ -n "$EF_SNAP" ]; then
sudo snap install "${EF_SNAP}" --dangerous
else
sudo snap install edgexfoundry --channel="${EF_CHANNEL}"
fi
echo "$(timestamp) Installing application service configurable snap..."
ASC_CHANNEL="${ASC_CHANNEL:-stable}"
if [ -n "$ASC_SNAP" ]; then
sudo snap install "${ASC_SNAP}" --dangerous
else
sudo snap install edgex-app-service-configurable --channel="${ASC_CHANNEL}"
fi
echo "$(timestamp) Turning on sys-mgmt-agent service..."
sudo snap set edgexfoundry sys-mgmt-agent=on
echo "$(timestamp) Turning on support-scheduler service..."
sudo snap set edgexfoundry support-scheduler=on
echo "$(timestamp) Turning on support-notifications service..."
sudo snap set edgexfoundry support-notifications=on
echo "$(timestamp) Turning on device-virtual service..."
sudo snap set edgexfoundry device-virtual=on
echo "$(timestamp) Setting edgex-app-service-configurable profile to blackbox-tests..."
sudo snap set edgex-app-service-configurable profile=blackbox-tests
echo "$(timestamp) Starting edgex-app-service-configurable service..."
sudo snap start edgex-app-service-configurable.app-service-configurable
echo "============================================================================================"
echo " Completed the deployment of edgex snap test service for Blackbox"
echo "============================================================================================"