-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·38 lines (27 loc) · 961 Bytes
/
deploy.sh
File metadata and controls
executable file
·38 lines (27 loc) · 961 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
#!/usr/bin/env bash
# Import environment variables from .env
export $(egrep -v '^#' .env | xargs)
echo "Generating config file"
python create_config.py || { echo "Failed generating configuration" ; exit 1; }
# Declare the list of files
declare -a files=(
"config.json"
"boot.py"
"main.py"
"config.py"
)
echo "Deploying to ${WEBREPL_HOST}"
# Copy all files
for i in "${files[@]}"
do
source_path="src/${i}"
target_path="/${i}"
echo "Copying $source_path"
webreplcmd put $source_path $target_path || { echo "Failed copying $source_path" ; exit 1 ; }
#ampy put $source_path $target_path || { echo "Failed copying $source_path" ; exit 1 ; }
done
echo "All files copied"
echo "Restarting..."
# Using iwebrepl, because it actually terminates when the connection gets reset
iwebrepl --host $WEBREPL_HOST --password $WEBREPL_PASSWORD --port $WEBREPL_PORT --cmd 'import machine; machine.reset()' > /dev/null
echo "Done"