mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-17 15:24:32 +01:00
build: create release and debug modes for deployment scripts
This commit is contained in:
14
deploy.sh
14
deploy.sh
@@ -1,3 +1,4 @@
|
|||||||
|
MODE=debug
|
||||||
check_exists() {
|
check_exists() {
|
||||||
command -v "$1" > /dev/null
|
command -v "$1" > /dev/null
|
||||||
}
|
}
|
||||||
@@ -65,7 +66,14 @@ git pull &&
|
|||||||
cd factory &&
|
cd factory &&
|
||||||
cargo espflash --release $PORT &&
|
cargo espflash --release $PORT &&
|
||||||
cd ../sphinx-key &&
|
cd ../sphinx-key &&
|
||||||
cargo build --release &&
|
|
||||||
esptool.py --chip esp32-c3 elf2image target/riscv32imc-esp-espidf/release/sphinx-key &&
|
if [ $MODE = "release" ]
|
||||||
esptool.py --chip esp32c3 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x80000 target/riscv32imc-esp-espidf/release/sphinx-key.bin &&
|
then
|
||||||
|
cargo build --release
|
||||||
|
else
|
||||||
|
cargo build
|
||||||
|
fi &&
|
||||||
|
|
||||||
|
esptool.py --chip esp32-c3 elf2image target/riscv32imc-esp-espidf/$MODE/sphinx-key &&
|
||||||
|
esptool.py --chip esp32c3 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x80000 target/riscv32imc-esp-espidf/$MODE/sphinx-key.bin &&
|
||||||
cargo espflash serial-monitor $PORT
|
cargo espflash serial-monitor $PORT
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
MODE=debug
|
||||||
|
# MODE=release
|
||||||
|
SSID=sphinx
|
||||||
|
PASS=sphinxkey
|
||||||
check_exists() {
|
check_exists() {
|
||||||
command -v "$1" > /dev/null
|
command -v "$1" > /dev/null
|
||||||
}
|
}
|
||||||
@@ -60,7 +64,12 @@ then
|
|||||||
echo "Make sure the ESP is connected with a data USB cable, and try again."
|
echo "Make sure the ESP is connected with a data USB cable, and try again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
cargo build --release &&
|
if [ $MODE = "release" ]
|
||||||
esptool.py --chip esp32c3 elf2image target/riscv32imc-esp-espidf/release/sphinx-key &&
|
then
|
||||||
esptool.py --chip esp32c3 -p $PORT -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x10000 target/riscv32imc-esp-espidf/release/sphinx-key.bin &&
|
cargo build --release
|
||||||
espmonitor $PORT
|
else
|
||||||
|
cargo build
|
||||||
|
fi &&
|
||||||
|
esptool.py --chip esp32-c3 elf2image target/riscv32imc-esp-espidf/$MODE/sphinx-key &&
|
||||||
|
esptool.py --chip esp32c3 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x80000 target/riscv32imc-esp-espidf/$MODE/sphinx-key.bin &&
|
||||||
|
cargo espflash serial-monitor $PORT
|
||||||
|
|||||||
Reference in New Issue
Block a user