File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include "../include/config.h"
2
+ #include "stdio.h"
3
+
4
+ // Why grep the version from the config.h when we can
5
+ // just as easily have a tiny program doing it The Right Way(tm).
6
+
7
+ int main () {
8
+ printf ("%s\n" , FROY_VERSION );
9
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ cd $( dirname $0 ) /..
6
+
7
+ environment=" esp_wroom_02"
8
+
9
+ # determine version
10
+ gcc -o ver hack/printversion.c
11
+ version=" $( ./ver) "
12
+ rm ver
13
+
14
+ # setup
15
+ remoteDirectory=" infrastructure/data/monitor/ota-1/froy"
16
+ remoteFilename=" $remoteDirectory /froy-$version .bin"
17
+ remoteHost=" xrstf.de"
18
+
19
+ # create directory
20
+ ssh " $remoteHost " " mkdir -p $remoteDirectory "
21
+
22
+ # check if this version already exists
23
+ if ssh " $remoteHost " " test -e $remoteFilename " ; then
24
+ echo " A release with this version ($version ) already exists, refusing to overwrite."
25
+ exit 1
26
+ fi
27
+
28
+ # build project
29
+ echo " Compiling..."
30
+ pio run --silent --environment " $environment " --target clean
31
+ pio run --silent --environment " $environment "
32
+
33
+ echo " Uploading version $version ..."
34
+ scp " .pio/build/$environment /firmware.bin" " $remoteHost :$remoteFilename "
You can’t perform that action at this time.
0 commit comments