Skip to content

Commit

Permalink
Improve build pipeline and documentation text
Browse files Browse the repository at this point in the history
- Use super-linter environment file to have better consistency between
  GitHub CI pipeline and the instructions in LINT.md
- Use correct wording for ACAP applications
- Add comments to linter configuration files

Change-Id: I5d410348ecb9171597f0716a99201fc1d9d71b2c
Signed-off-by: Joakim Roubert <[email protected]>
  • Loading branch information
joakimr-axis committed Dec 1, 2023
1 parent bb15850 commit 8458018
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 48 deletions.
8 changes: 8 additions & 0 deletions .github/super-linter.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LINTER_RULES_PATH=/
VALIDATE_ALL_CODEBASE=true
IGNORE_GITIGNORED_FILES=true
VALIDATE_CLANG_FORMAT=true
VALIDATE_DOCKERFILE_HADOLINT=true
VALIDATE_JSON=true
VALIDATE_MARKDOWN=true
VALIDATE_YAML=true
14 changes: 4 additions & 10 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,11 @@ jobs:
with:
fetch-depth: 0

- name: Setup Environment
run: cat .github/super-linter.env >> "$GITHUB_ENV"

- name: Lint Code Base
uses: github/super-linter/slim@v5
uses: super-linter/super-linter/slim@v5
env:
LINTER_RULES_PATH: /
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
IGNORE_GITIGNORED_FILES: true
VALIDATE_CLANG_FORMAT: true
VALIDATE_DOCKERFILE_HADOLINT: true
VALIDATE_JSON: true
VALIDATE_MARKDOWN: true
VALIDATE_YAML: true
4 changes: 4 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
ignored:
# Pin versions in 'apt-get install'.
- DL3008
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# Line length
MD013:
line_length: 100
# First line in a file should be a top-level heading
MD041: false
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ARG BUILD_DIR=/usr/local/src/server-acap

FROM $SDK_IMAGE:$ACAP_SDK_VERSION-$ARCH AS builder
ARG BUILD_DIR
# hadolint ignore=DL3008
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down
14 changes: 5 additions & 9 deletions LINT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Lint of code base

This repo uses the
[super-linter](https://github.com/github/super-linter)
[super-linter](https://github.com/super-linter/super-linter)
to check the code base syntax and format on different file types.

## Linters in GitHub Action
Expand All @@ -21,13 +21,8 @@ which is possible since it is available as a container. Using
docker run --rm \
-v "$PWD":/tmp/lint \
-e RUN_LOCAL=true \
-e LINTER_RULES_PATH=/ \
-e VALIDATE_CLANG_FORMAT=true \
-e VALIDATE_DOCKERFILE_HADOLINT=true \
-e VALIDATE_JSON=true \
-e VALIDATE_MARKDOWN=true \
-e VALIDATE_YAML=true \
github/super-linter:slim-v4
--env-file .github/super-linter.env \
ghcr.io/super-linter/super-linter:slim-v5
```

## Run super-linter interactively
Expand All @@ -39,8 +34,9 @@ with Docker:
docker run -it --rm \
-v "$PWD":/tmp/lint \
-w /tmp/lint \
--env-file .github/super-linter.env \
--entrypoint /bin/bash \
github/super-linter:slim-v4
ghcr.io/super-linter/super-linter:slim-v5
```

Then from the container terminal, the following commands can lint the the code
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ it actually is to integrate any Axis device in an OPC UA system.

![Architectural overview](images/acap_architecture.svg)

*Please note that even if this ACAP would fit right into your usecase, its
purpose is above all to serve as an example and boilerplate rather than being
ready for production.*
> [!NOTE]
> Even if this application would fit right into your usecase, its purpose is
> above all to serve as an example and boilerplate rather than being ready for
> production.
## Build

Expand Down Expand Up @@ -59,10 +60,10 @@ DOCKER_BUILDKIT=1 docker build --build-arg ARCH=aarch64 -o type=local,dest=. .

### Manual installation and configuration

Upload the ACAP file (the file with the `.eap` extension for the camera's
architecture) through the camera's web UI: *Apps->Add app*
Upload the ACAP application file (the file with the `.eap` extension for the
camera's architecture) through the camera's web UI: *Apps->Add app*

The OPC UA Server port (default is 4840) can be set through the ACAP's
The OPC UA Server port (default is 4840) can be set through the application's
parameter settings, found in the three vertical dots menu:

![Web UI Screenshot](images/web_ui_open_param_settings.png)
Expand All @@ -73,8 +74,8 @@ parameter settings, found in the three vertical dots menu:

Use the camera's
[applications/upload.cgi](https://www.axis.com/vapix-library/subjects/t10102231/section/t10036126/display?section=t10036126-t10010609)
to upload the ACAP file (the file with the `.eap` extension for the camera's
architecture):
to upload the ACAP application file (the file with the `.eap` extension for the
camera's architecture):

```sh
curl -k --anyauth -u root:<password> \
Expand All @@ -84,7 +85,7 @@ curl -k --anyauth -u root:<password> \

To
[start (or stop/restart/remove)](https://www.axis.com/vapix-library/subjects/t10102231/section/t10036126/display?section=t10036126-t10010606)
the ACAP, you can make a call like this:
the application, you can make a call like this:

```sh
curl -k --anyauth -u root:<password> \
Expand Down Expand Up @@ -120,7 +121,8 @@ curl -k --anyauth -u root:<password> \
Attach an OPC UA client to the port set in the ACAP. The client will then be
able to read the values (and their timestamps) from the ACAP's OPC UA server.

The ACAP will also log the values in the camera's syslog.
> [!NOTE]
> The application will also log the values in the camera's syslog.
## License

Expand Down
22 changes: 4 additions & 18 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"labels": ["dependencies"],
"packageRules": [
{
"updateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
}
],
"rebaseWhen": "behind-base-branch",
"vulnerabilityAlerts": {
"labels": ["security"]
},
"stabilityDays": 3,
"prCreation": "not-pending",
"dependencyDashboard": false
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}

0 comments on commit 8458018

Please sign in to comment.