-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 2.1.1 See merge request bone/bemos-modbus!3
- Loading branch information
Showing
25 changed files
with
1,315 additions
and
1,138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
BasedOnStyle: Google | ||
ColumnLimit: 120 | ||
IndentWidth: 4 | ||
TabWidth: 4 | ||
UseTab: Always | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AllowShortBlocksOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: Never | ||
NamespaceIndentation: All | ||
AccessModifierOffset: -4 | ||
IndentCaseLabels: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
Checks: >- | ||
-*, | ||
bugprone-*, | ||
-bugprone-easily-swappable-parameters, | ||
cert-*, | ||
-cert-dcl16-c, | ||
clang-analyzer-*, | ||
concurrency-*, | ||
cppcoreguidelines-*, | ||
-cppcoreguidelines-pro-bounds-pointer-arithmetic, | ||
-cppcoreguidelines-avoid-magic-numbers, | ||
-cppcoreguidelines-pro-type-vararg, | ||
misc-*, | ||
-misc-no-recursion, | ||
modernize-*, | ||
performance-*, | ||
portability-*, | ||
readability-*, | ||
-readability-magic-numbers, | ||
-readability-else-after-return, | ||
-readability-braces-around-statements, | ||
-readability-uppercase-literal-suffix, | ||
-readability-identifier-length | ||
HeaderFilterRegex: '' | ||
FormatStyle: none | ||
CheckOptions: | ||
- { key: readability-identifier-naming.ClassCase, value: CamelCase } | ||
- { key: readability-identifier-naming.StructCase, value: lower_case } | ||
- { key: readability-identifier-naming.VariableCase, value: lower_case } | ||
- { key: readability-identifier-naming.FunctionCase, value: camelBack } | ||
- { key: readability-identifier-naming.ParameterCase, value: lower_case } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
*.o | ||
*.d | ||
bemos_modbus | ||
gitrev.hpp | ||
gitrev.hpp.md5 | ||
compiler_flags | ||
*.sublime-workspace | ||
/bemos_modbus | ||
*.sublime-workspace | ||
build*/ | ||
compile_commands.json | ||
.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,125 +1,133 @@ | ||
image: docker.bestsens.de/bone/docker-build-image:2.0.3 | ||
|
||
variables: | ||
GIT_SUBMODULE_STRATEGY: recursive | ||
|
||
stages: | ||
- build | ||
- build-image | ||
- deploy | ||
- release | ||
|
||
.artifacts: &artifacts | ||
expire_in: 4 weeks | ||
paths: | ||
- build/bemos_modbus | ||
- build/bemos_modbus.dbg | ||
|
||
## Build ############################################################################################################## | ||
build:arm: | ||
before_script: | ||
- git submodule sync --recursive | ||
- git submodule update --init --recursive | ||
image: docker.bestsens.de/bone/musl-build-image | ||
stage: build | ||
artifacts: | ||
expire_in: 4 weeks | ||
<<: *artifacts | ||
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}_arm" | ||
paths: | ||
- bemos_modbus | ||
cache: | ||
- key: "global_cache" | ||
paths: | ||
- .cache/ | ||
- key: "${CI_COMMIT_REF_SLUG}_arm" | ||
paths: | ||
- build/ | ||
script: | ||
- source /opt/boneos/2.0.3/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi | ||
- export CCACHE_DIR=${PWD}/.cache/ccache | ||
- mkdir -p build | ||
- cd build | ||
- if [ "${CI_COMMIT_TAG}" == "" ]; then | ||
make systemd STRIP=true APP_VERSION_BRANCH=${CI_COMMIT_REF_SLUG} APP_VERSION_GITREV=${CI_COMMIT_SHORT_SHA}; | ||
cmake .. -GNinja | ||
-DGIT_BRANCH=${CI_COMMIT_REF_SLUG} | ||
-DGIT_COMMIT_HASH=${CI_COMMIT_SHORT_SHA} | ||
-DCPM_SOURCE_CACHE=../.cache/CPM | ||
-DBUILD_TESTS=OFF | ||
-DCMAKE_TOOLCHAIN_FILE=../libs/bone_helper/cmake/arm-bemos-linux-musleabihf.cmake; | ||
else | ||
make systemd STRIP=true APP_VERSION_BRANCH=master APP_VERSION_GITREV=${CI_COMMIT_SHORT_SHA}; | ||
cmake .. -GNinja | ||
-DGIT_BRANCH=master | ||
-DGIT_COMMIT_HASH=${CI_COMMIT_SHORT_SHA} | ||
-DCPM_SOURCE_CACHE=../.cache/CPM | ||
-DBUILD_TESTS=OFF | ||
-DCMAKE_TOOLCHAIN_FILE=../libs/bone_helper/cmake/arm-bemos-linux-musleabihf.cmake; | ||
fi | ||
- ninja | ||
|
||
build:i686: | ||
before_script: | ||
- git submodule sync --recursive | ||
- git submodule update --init --recursive | ||
stage: build | ||
artifacts: | ||
expire_in: 4 weeks | ||
<<: *artifacts | ||
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}_i686" | ||
paths: | ||
- bemos_modbus | ||
- Dockerfile | ||
cache: | ||
- key: "global_cache" | ||
paths: | ||
- .cache/ | ||
- key: "${CI_COMMIT_REF_SLUG}_i686" | ||
paths: | ||
- build/ | ||
script: | ||
- export CCACHE_DIR=${PWD}/.cache/ccache | ||
- mkdir -p build | ||
- cd build | ||
- if [ "${CI_COMMIT_TAG}" == "" ]; then | ||
make STRIP=true APP_VERSION_BRANCH=${CI_COMMIT_REF_SLUG} APP_VERSION_GITREV=${CI_COMMIT_SHORT_SHA}; | ||
cmake .. -GNinja | ||
-DGIT_BRANCH=${CI_COMMIT_REF_SLUG} | ||
-DGIT_COMMIT_HASH=${CI_COMMIT_SHORT_SHA} | ||
-DCPM_SOURCE_CACHE=../.cache/CPM; | ||
else | ||
make STRIP=true APP_VERSION_BRANCH=master APP_VERSION_GITREV=${CI_COMMIT_SHORT_SHA}; | ||
cmake .. -GNinja | ||
-DGIT_BRANCH=master | ||
-DGIT_COMMIT_HASH=${CI_COMMIT_SHORT_SHA} | ||
-DCPM_SOURCE_CACHE=../.cache/CPM; | ||
fi | ||
- ninja | ||
|
||
deploy:arm: | ||
## Create persistent archives ######################################################################################### | ||
.deploy: &deploy | ||
stage: deploy | ||
when: on_success | ||
variables: | ||
GIT_STRATEGY: none | ||
only: | ||
- tags | ||
artifacts: | ||
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}_arm" | ||
paths: | ||
- bemos_modbus | ||
variables: | ||
GIT_STRATEGY: none | ||
script: | ||
- echo '1' | ||
|
||
deploy:arm: | ||
<<: *deploy | ||
artifacts: | ||
<<: *artifacts | ||
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_arm" | ||
expire_in: | ||
reports: | ||
dotenv: generate_executables.env | ||
dependencies: | ||
- build:arm | ||
script: | ||
- echo GE_JOB_ID=$CI_JOB_ID >> generate_executables.env | ||
|
||
deploy:i686: | ||
stage: deploy | ||
when: on_success | ||
variables: | ||
GIT_STRATEGY: none | ||
only: | ||
- tags | ||
<<: *deploy | ||
artifacts: | ||
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}_i686" | ||
paths: | ||
- bemos_modbus | ||
script: | ||
- echo '1' | ||
dependencies: | ||
- build:i686 | ||
|
||
build-image: | ||
image: docker:latest | ||
stage: build-image | ||
variables: | ||
GIT_STRATEGY: none | ||
script: | ||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY | ||
- docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME . | ||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME | ||
<<: *artifacts | ||
name: "${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_i686" | ||
expire_in: | ||
dependencies: | ||
- build:i686 | ||
|
||
release-image: | ||
image: docker:latest | ||
stage: deploy | ||
variables: | ||
GIT_STRATEGY: none | ||
script: | ||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY | ||
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME | ||
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $CI_REGISTRY_IMAGE:latest | ||
- docker push $CI_REGISTRY_IMAGE:latest | ||
## Release ############################################################################################################ | ||
release_job: | ||
stage: release | ||
image: registry.gitlab.com/gitlab-org/release-cli:latest | ||
needs: | ||
- job: deploy:arm | ||
artifacts: true | ||
only: | ||
- tags | ||
dependencies: | ||
- build-image | ||
|
||
staging: | ||
stage: deploy | ||
when: manual | ||
environment: staging | ||
variables: | ||
GIT_STRATEGY: none | ||
script: | ||
- fab staging deploy_to_bone:bemos_modbus -f /root/fabfile.py | ||
- fab staging restart_service:bemos-modbus -f /root/fabfile.py | ||
dependencies: | ||
- build:arm | ||
|
||
production: | ||
stage: deploy | ||
when: manual | ||
environment: production | ||
variables: | ||
GIT_STRATEGY: none | ||
script: | ||
- fab production deploy_to_bone:bemos_modbus -f /root/fabfile.py | ||
- fab production restart_service:bemos-modbus -f /root/fabfile.py | ||
dependencies: | ||
- build:arm | ||
- echo 'releasing $_CI_COMMIT_TAG' | ||
release: | ||
name: '$CI_COMMIT_TAG' | ||
description: 'Automatically created' | ||
tag_name: '$CI_COMMIT_TAG' | ||
ref: '$CI_COMMIT_TAG' | ||
assets: | ||
links: | ||
- name: "Linux ARM" | ||
url: "https://gitlab.bestsens.de/bone/bemos-modbus/-/jobs/${GE_JOB_ID}/artifacts/download" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
[submodule "libs/bone_helper"] | ||
path = libs/bone_helper | ||
url = ../bone_helper.git | ||
[submodule "libs/json"] | ||
path = libs/json | ||
url = https://github.com/nlohmann/json.git | ||
[submodule "libs/cxxopts"] | ||
path = libs/cxxopts | ||
url = https://github.com/jarro2783/cxxopts.git | ||
[submodule "libs/spdlog"] | ||
path = libs/spdlog | ||
url = https://github.com/gabime/spdlog.git | ||
[submodule "libs/fmt"] | ||
path = libs/fmt | ||
url = https://github.com/fmtlib/fmt.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"files.associations": { | ||
"any": "cpp", | ||
"array": "cpp", | ||
"atomic": "cpp", | ||
"bit": "cpp", | ||
"*.tcc": "cpp", | ||
"bitset": "cpp", | ||
"cctype": "cpp", | ||
"charconv": "cpp", | ||
"chrono": "cpp", | ||
"clocale": "cpp", | ||
"cmath": "cpp", | ||
"codecvt": "cpp", | ||
"compare": "cpp", | ||
"complex": "cpp", | ||
"concepts": "cpp", | ||
"condition_variable": "cpp", | ||
"csignal": "cpp", | ||
"cstdarg": "cpp", | ||
"cstddef": "cpp", | ||
"cstdint": "cpp", | ||
"cstdio": "cpp", | ||
"cstdlib": "cpp", | ||
"cstring": "cpp", | ||
"ctime": "cpp", | ||
"cwchar": "cpp", | ||
"cwctype": "cpp", | ||
"deque": "cpp", | ||
"forward_list": "cpp", | ||
"list": "cpp", | ||
"map": "cpp", | ||
"set": "cpp", | ||
"unordered_map": "cpp", | ||
"unordered_set": "cpp", | ||
"vector": "cpp", | ||
"exception": "cpp", | ||
"algorithm": "cpp", | ||
"functional": "cpp", | ||
"iterator": "cpp", | ||
"memory": "cpp", | ||
"memory_resource": "cpp", | ||
"numeric": "cpp", | ||
"optional": "cpp", | ||
"random": "cpp", | ||
"ratio": "cpp", | ||
"regex": "cpp", | ||
"string": "cpp", | ||
"string_view": "cpp", | ||
"system_error": "cpp", | ||
"tuple": "cpp", | ||
"type_traits": "cpp", | ||
"utility": "cpp", | ||
"fstream": "cpp", | ||
"future": "cpp", | ||
"initializer_list": "cpp", | ||
"iomanip": "cpp", | ||
"iosfwd": "cpp", | ||
"iostream": "cpp", | ||
"istream": "cpp", | ||
"limits": "cpp", | ||
"mutex": "cpp", | ||
"new": "cpp", | ||
"ostream": "cpp", | ||
"ranges": "cpp", | ||
"span": "cpp", | ||
"sstream": "cpp", | ||
"stdexcept": "cpp", | ||
"stop_token": "cpp", | ||
"streambuf": "cpp", | ||
"thread": "cpp", | ||
"cinttypes": "cpp", | ||
"typeindex": "cpp", | ||
"typeinfo": "cpp", | ||
"valarray": "cpp", | ||
"variant": "cpp" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.