Skip to content

Commit

Permalink
Merge pull request #24 from fledge-iot/2.2.0RC
Browse files Browse the repository at this point in the history
2.2.0RC
  • Loading branch information
dianomicbot authored Oct 20, 2023
2 parents 1edd274 + af58191 commit 5211455
Show file tree
Hide file tree
Showing 16 changed files with 354 additions and 180 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# vi
*.swp

# MacOS Finder
.DS_Store
._*

# IDE
*.idea

# Compiled Object files
*.pyc

# Test
.pytest_cache
test_result.xml
2 changes: 1 addition & 1 deletion Description
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A Python plugin for Fledge that sends data north to the Azure IoT Hub
A Python based Azure IoT Hub device client plugin for Fledge that sends data north to the Azure IoT Hub.
62 changes: 62 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
timestamps {
node("ubuntu18-agent") {
catchError {
checkout scm
dir_exists = sh (
script: "test -d 'tests' && echo 'Y' || echo 'N' ",
returnStdout: true
).trim()

if (dir_exists == 'N'){
currentBuild.result= 'FAILURE'
echo "No tests directory found! Exiting."
return
}

try {
stage("Prerequisites"){
// Change to corresponding CORE_BRANCH as required
// e.g. FOGL-xxxx, main etc.
sh '''
CORE_BRANCH='2.2.0RC'
${HOME}/buildFledge ${CORE_BRANCH} ${WORKSPACE}
'''
}
} catch (e) {
currentBuild.result = 'FAILURE'
echo "Failed to build Fledge; required to run the tests!"
return
}

try {
stage("Run Tests"){
echo "Executing tests..."
sh '''
. ${WORKSPACE}/PLUGIN_PR_ENV/bin/activate
export FLEDGE_ROOT=$HOME/fledge && export PYTHONPATH=$HOME/fledge/python
cd tests && python3 -m pytest -vv --ignore=system --ignore=api --junit-xml=test_result.xml
'''
echo "Done."
}
} catch (e) {
result = "TESTS FAILED"
currentBuild.result = 'FAILURE'
echo "Tests failed!"
}

try {
stage("Publish Test Report"){
junit "tests/test_result.xml"
}
} catch (e) {
result = "TEST REPORT GENERATION FAILED"
currentBuild.result = 'FAILURE'
echo "Failed to generate test reports!"
}
}
stage ("Cleanup"){
// Add here if any cleanup is required
echo "Done."
}
}
}
7 changes: 5 additions & 2 deletions Package
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# A set of variables that define how we package this repository
#
plugin_name=azure
plugin_name=azure_iot
plugin_type=north
plugin_install_dirname=${plugin_name}
plugin_package_name=fledge-${plugin_type}-azure
plugin_package_name=fledge-${plugin_type}-azure-iot

# Now build up the runtime requirements list. This has 3 components
# 1. Generic packages we depend on in all architectures and package managers
# 2. Architecture specific packages we depend on
# 3. Package manager specific packages we depend on
requirements="fledge"

pygte36=$(python3 -c 'import sys; print("Y") if sys.version_info.major >= 3 and sys.version_info.minor >= 6 else print("N")')
if [ ${pygte36} == "N" ]; then echo "Requires platform with Python >= 3.6"; exit 1; fi

case "$arch" in
x86_64)
;;
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

## Installation

1) Copy the python/fledge/plugins/north/azure directory to /usr/local/fledge/python/fledge/python/plugins/north/
1) Copy the python/fledge/plugins/north/azure_iot directory to /usr/local/fledge/python/fledge/python/plugins/north/

2) pip3 install -Ir python/requirements-azure.txt
2) pip3 install -Ir python/requirements-azure_iot.txt
2 changes: 0 additions & 2 deletions VERSION.north.azure

This file was deleted.

2 changes: 2 additions & 0 deletions VERSION.north.azure_iot
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fledge_north_azure_iot_version=2.2.0
fledge_version>=2.2
File renamed without changes
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. Images
.. |azure| image:: images/azure.jpg
.. |azure| image:: images/azure_iot.jpg

Azure IoT Hub
=============

The *fledge-north-azure* plugin sends data from Fledge to the Microsoft Azure IoT Core service.
The *fledge-north-azure-iot* plugin sends data from Fledge to the Microsoft Azure IoT Core service.

The configuration of the *Azure* plugin requires a few simple configuration parameters to be set.

Expand Down
170 changes: 0 additions & 170 deletions python/fledge/plugins/north/azure/azure.py

This file was deleted.

Loading

0 comments on commit 5211455

Please sign in to comment.