Skip to content

Commit

Permalink
Unify the MQTT examples
Browse files Browse the repository at this point in the history
Unify the MQTT examples into a single configurable example.

Signed-off-by: Simone Orru <[email protected]>
  • Loading branch information
sorru94 committed Nov 5, 2024
1 parent 38e2e74 commit ef4ec51
Show file tree
Hide file tree
Showing 22 changed files with 797 additions and 790 deletions.
44 changes: 6 additions & 38 deletions .github/workflows/check-examples-mqtt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,9 @@ jobs:
working-directory: ./.github/workflows
timeout-minutes: 3
run: |
./install_interfaces.sh $GITHUB_WORKSPACE/examples/example_device/interfaces
./install_interfaces.sh $GITHUB_WORKSPACE/examples/datastreams/interfaces
./install_interfaces.sh $GITHUB_WORKSPACE/examples/event_listener/interfaces
- name: Setup the configuration file for the datastream example
working-directory: ./examples/datastreams
run: |
echo "REALM = \"test\"" > config.toml
echo "PAIRING_URL = \"https://api.autotest.astarte-platform.org/pairing\"" >> config.toml
DEVICE_ID=$(astartectl utils device-id generate-random)
echo "DEVICE_ID = \"$DEVICE_ID\"" >> config.toml
CREDENTIALS_SECRET=$(astartectl pairing agent register --compact-output -- "$DEVICE_ID")
echo "CREDENTIALS_SECRET = \"$CREDENTIALS_SECRET\"" >> config.toml
cat config.toml
- name: Setup the configuration file for the event_listener example
working-directory: ./examples/event_listener
run: |
echo "REALM = \"test\"" > config.toml
echo "PAIRING_URL = \"https://api.autotest.astarte-platform.org/pairing\"" >> config.toml
DEVICE_ID=$(astartectl utils device-id generate-random)
echo "DEVICE_ID = \"$DEVICE_ID\"" >> config.toml
CREDENTIALS_SECRET=$(astartectl pairing agent register --compact-output -- "$DEVICE_ID")
echo "CREDENTIALS_SECRET = \"$CREDENTIALS_SECRET\"" >> config.toml
cat config.toml
- name: Setup the configuration file for the example device example
working-directory: ./examples/example_device
./install_interfaces.sh $GITHUB_WORKSPACE/examples/mqtt/interfaces
- name: Setup the configuration file for the example
working-directory: ./examples/mqtt
run: |
echo "REALM = \"test\"" > config.toml
echo "PAIRING_URL = \"https://api.autotest.astarte-platform.org/pairing\"" >> config.toml
Expand All @@ -82,18 +60,8 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -e .
- name: Execute the datastream example
working-directory: ./examples/datastreams
run: |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
python3 ./main.py -d 10
- name: Execute the event_listener example
working-directory: ./examples/event_listener
run: |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
python3 ./event_listener.py -d 10
- name: Execute the example_device example
working-directory: ./examples/example_device
- name: Execute the example
working-directory: ./examples/mqtt
run: |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
python3 ./example_device.py -d 10
python3 ./main.py
217 changes: 0 additions & 217 deletions examples/datastreams/main.py

This file was deleted.

42 changes: 0 additions & 42 deletions examples/event_listener/README.md

This file was deleted.

22 changes: 0 additions & 22 deletions examples/event_listener/config.toml

This file was deleted.

Loading

0 comments on commit ef4ec51

Please sign in to comment.