Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICBM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
detectors
DSSC
ICBM
Commits
b97eabc4
Commit
b97eabc4
authored
1 year ago
by
Cyril Danilevski
Browse files
Options
Downloads
Patches
Plain Diff
Add Git commit sha and time to CI build
parent
bfd3e709
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Initial MPOD feature
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
README.md
+8
-1
8 additions, 1 deletion
README.md
rest.cpp
+13
-1
13 additions, 1 deletion
rest.cpp
with
22 additions
and
3 deletions
.gitlab-ci.yml
+
1
−
1
View file @
b97eabc4
...
@@ -30,7 +30,7 @@ build:
...
@@ -30,7 +30,7 @@ build:
-
arduino-cli lib install --git-url https://github.com/patricklaf/SNMP.git --config-file arduino-cli.yaml
-
arduino-cli lib install --git-url https://github.com/patricklaf/SNMP.git --config-file arduino-cli.yaml
# Compile artifact
# Compile artifact
-
arduino-cli compile --fqbn esp32:esp32:esp32wroverkit icbm.ino --output-dir firmware
-
arduino-cli compile --fqbn esp32:esp32:esp32wroverkit icbm.ino --output-dir firmware
--build-property build.extra_flags="-DICBM_GIT_VERSION=$CI_COMMIT_SHORT_SHA -DICBM_GIT_TIMESTAMP=$CI_COMMIT_TIMESTAMP"
-
zip -r firmware.zip firmware
-
zip -r firmware.zip firmware
artifacts
:
artifacts
:
when
:
always
when
:
always
...
...
This diff is collapsed.
Click to expand it.
README.md
+
8
−
1
View file @
b97eabc4
...
@@ -35,7 +35,7 @@ board_manager:
...
@@ -35,7 +35,7 @@ board_manager:
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
```
```
Update the
a
rduino index with:
Update the
A
rduino index with:
```
bash
```
bash
arduino-cli core update-index
arduino-cli core update-index
...
@@ -55,6 +55,13 @@ And uploaded so:
...
@@ -55,6 +55,13 @@ And uploaded so:
arduino-cli upload -p /dev/ttyUSB1 --fqbn esp32:esp32:esp32wroverkit
arduino-cli upload -p /dev/ttyUSB1 --fqbn esp32:esp32:esp32wroverkit
### Versioning
The firmware version is provided as part of the
`/idn`
route.
This is the git tag or commit, if
`-DICBM_GIT_VERSION`
is set.
The git date can be set via
`-DICBM_GIT_TIMESTAMP`
.
### CI Artefacts
### CI Artefacts
CI artefacts can be uploaded so:
CI artefacts can be uploaded so:
...
...
This diff is collapsed.
Click to expand it.
rest.cpp
+
13
−
1
View file @
b97eabc4
#include
"rest.hpp"
#include
"rest.hpp"
#include
<ETH.h>
#include
<ETH.h>
#ifndef ICBM_GIT_VERSION
#define ICBM_GIT_VERSION "DEVEL" // set via -DICBM_GIT_VERSION
#endif
#ifndef ICBM_GIT_TIMESTAMP
#define ICBM_GIT_TIMESTAMP "UNKNOWN"
#endif
WebServer
restServer
(
80
);
WebServer
restServer
(
80
);
void
initializeRoutes
()
{
void
initializeRoutes
()
{
...
@@ -26,7 +34,11 @@ void identify() {
...
@@ -26,7 +34,11 @@ void identify() {
message
+=
"
\"
,
\n
"
;
message
+=
"
\"
,
\n
"
;
message
+=
"
\"
version
\"
:
\"
"
;
message
+=
"
\"
version
\"
:
\"
"
;
message
+=
"0.1"
;
// TODO: Get from Git
message
+=
ICBM_GIT_VERSION
;
message
+=
"
\"
,
\n
"
;
message
+=
"
\"
build date
\"
:
\"
"
;
message
+=
ICBM_GIT_TIMESTAMP
;
message
+=
"
\"
,
\n
"
;
message
+=
"
\"
,
\n
"
;
message
+=
"
\"
uptime
\"
:
\"
"
;
message
+=
"
\"
uptime
\"
:
\"
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment