Better deploy script.
This commit is contained in:
parent
bbf77c6b1e
commit
7a20cf4b04
@ -1,9 +1,3 @@
|
|||||||
# Deploying a new version
|
# Deploying a new version
|
||||||
|
|
||||||
* Update the OTA_VERSION in `include/config.h`, `include/config.sample.h`,
|
* Use `deploy.sh`.
|
||||||
`data/_version.txt`, and `update.manifest`.
|
|
||||||
* Commit the changes.
|
|
||||||
* Tag the commit with the new version string.
|
|
||||||
* Push everything.
|
|
||||||
* Create theimages using `pio run` and `pio run -t buildfs`.
|
|
||||||
* Upload `update.manifest`, `firmware.bin` and `spiffs.bin`.
|
|
||||||
|
15
deploy.sh
15
deploy.sh
@ -7,6 +7,15 @@ if ! git diff-index --quiet HEAD ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
branch_name=$(git symbolic-ref -q HEAD)
|
||||||
|
branch_name=${branch_name##refs/heads/}
|
||||||
|
branch_name=${branch_name:-HEAD}
|
||||||
|
|
||||||
|
if [ "$branch_name" != "master" ]; then
|
||||||
|
echo "We are not on master branch. Can't deploy."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
read -p "Version to generate: " VERSION
|
read -p "Version to generate: " VERSION
|
||||||
|
|
||||||
OTA_VERSION=`grep "VERSION=" bin/update.manifest | cut -d"=" -f2`
|
OTA_VERSION=`grep "VERSION=" bin/update.manifest | cut -d"=" -f2`
|
||||||
@ -29,9 +38,13 @@ MD5=`md5sum --binary bin/spiffs.bin | cut -d" " -f1`
|
|||||||
sed -i.bak "s/SPIFFS_MD5=.*/SPIFFS_MD5=$MD5/" bin/update.manifest
|
sed -i.bak "s/SPIFFS_MD5=.*/SPIFFS_MD5=$MD5/" bin/update.manifest
|
||||||
rm bin/update.manifest.bak
|
rm bin/update.manifest.bak
|
||||||
|
|
||||||
|
echo; echo; echo; echo; echo
|
||||||
|
echo "Please check the git diff, if everything looks okay:"
|
||||||
git diff
|
git diff
|
||||||
exit 99
|
|
||||||
|
read -p "Press ENTER to continue, Ctrl-C to abort. " foo
|
||||||
|
|
||||||
git add bin/firmware.bin bin/spiffs.bin bin/update.manifest
|
git add bin/firmware.bin bin/spiffs.bin bin/update.manifest
|
||||||
git commit -m "Deploying version $VERSION."
|
git commit -m "Deploying version $VERSION."
|
||||||
git tag -a -m "Deploying version $VERSION" $VERSION
|
git tag -a -m "Deploying version $VERSION" $VERSION
|
||||||
|
git push --follow-tags
|
||||||
|
Loading…
Reference in New Issue
Block a user