Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApodiniDeploy #7

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 74 additions & 2 deletions WebService/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
"version": "0.5.1"
}
},
{
"package": "ApodiniIoTDeploymentProvider",
"repositoryURL": "https://github.com/Lerbert/ApodiniIoTDeploymentProvider",
"state": {
"branch": "docker-compose",
"revision": "f66e756ed6106e91ba2553172874c11ab4e6c383",
"version": null
}
},
{
"package": "ApodiniMigrator",
"repositoryURL": "https://github.com/Apodini/ApodiniMigrator.git",
Expand Down Expand Up @@ -60,8 +69,17 @@
"repositoryURL": "https://github.com/vapor/async-kit.git",
"state": {
"branch": null,
"revision": "8ec02e274b70afe9e6d2f39c49b7491d76cbc128",
"version": "1.8.0"
"revision": "f6f92e6d3704bd72ffb4d00e302c98476fe65854",
"version": "1.9.0"
}
},
{
"package": "buoy-deployment-provider",
"repositoryURL": "https://github.com/fa21-collaborative-drone-interactions/buoy-deployment-provider",
"state": {
"branch": "develop",
"revision": "2d44a4df3b5a3e7e376b5c9f1f841a9cca9593c3",
"version": null
}
},
{
Expand Down Expand Up @@ -145,6 +163,15 @@
"version": "4.4.0"
}
},
{
"package": "NetService",
"repositoryURL": "https://github.com/Bouke/NetService.git",
"state": {
"branch": null,
"revision": "08e1f7663fd4b09b9f4ad165be89704c7cd2e3f8",
"version": "0.8.1"
}
},
{
"package": "OpenAPIKit",
"repositoryURL": "https://github.com/mattpolzin/OpenAPIKit.git",
Expand Down Expand Up @@ -343,6 +370,42 @@
"version": "1.18.1"
}
},
{
"package": "swift-nio-ip",
"repositoryURL": "https://github.com/PSchmiedmayer/Swift-NIO-IP.git",
"state": {
"branch": null,
"revision": "598f56ec73fba0630a1b49c6ff97ac2e2d565a9e",
"version": "0.0.1"
}
},
{
"package": "swift-nio-lifx",
"repositoryURL": "https://github.com/hendesi/Swift-NIO-LIFX.git",
"state": {
"branch": "develop",
"revision": "c84af7276995920c26a06a9cb947d1f25a68ccda",
"version": null
}
},
{
"package": "swift-nio-lifx-impl",
"repositoryURL": "https://github.com/Apodini/Swift-NIO-LIFX-Impl",
"state": {
"branch": "develop",
"revision": "a672a896c0733c8585341e285c1f0aad1c3eaa1a",
"version": null
}
},
{
"package": "swift-nio-ssh",
"repositoryURL": "https://github.com/apple/swift-nio-ssh",
"state": {
"branch": null,
"revision": "bc1a91daf3ae35134fbca5655ed221668d0369d3",
"version": "0.3.0"
}
},
{
"package": "swift-nio-ssl",
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
Expand All @@ -361,6 +424,15 @@
"version": "1.11.0"
}
},
{
"package": "swift-device-discovery",
"repositoryURL": "https://github.com/Apodini/SwiftDeviceDiscovery.git",
"state": {
"branch": "master",
"revision": "c23647eca77d8ce77ec9430bd7de64684ee1bea1",
"version": null
}
},
{
"package": "vapor",
"repositoryURL": "https://github.com/vapor/vapor.git",
Expand Down
9 changes: 7 additions & 2 deletions WebService/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/Apodini/Apodini.git", .upToNextMinor(from: "0.5.0"))
.package(url: "https://github.com/Apodini/Apodini.git", .upToNextMinor(from: "0.5.0")),
.package(name: "buoy-deployment-provider", url: "https://github.com/fa21-collaborative-drone-interactions/buoy-deployment-provider", .branch("develop")),
.package(name: "ApodiniIoTDeploymentProvider", url: "https://github.com/Lerbert/ApodiniIoTDeploymentProvider", .branch("docker-compose"))
],
targets: [
.executableTarget(
name: "Buoy",
dependencies: [
.product(name: "Apodini", package: "Apodini"),
.product(name: "ApodiniHTTP", package: "Apodini")
.product(name: "ApodiniDeploy", package: "Apodini"),
.product(name: "ApodiniHTTP", package: "Apodini"),
.product(name: "BuoyDeploymentOption", package: "buoy-deployment-provider"),
.product(name: "DeploymentTargetIoTRuntime", package: "ApodiniIoTDeploymentProvider")
]
),
.testTarget(
Expand Down
3 changes: 3 additions & 0 deletions WebService/Sources/Buoy/Handlers/Buoy.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Apodini
import ApodiniDeploy
import ApodiniHTTP
import ArgumentParser
import DeploymentTargetIoTRuntime


@main
Expand All @@ -11,6 +13,7 @@ struct BuoyWebService: WebService {
var configuration: Configuration {
HTTPConfiguration(port: port)
HTTP()
ApodiniDeploy(runtimes: [IoTRuntime<Self>.self])
}

var content: some Component {
Expand Down
10 changes: 10 additions & 0 deletions WebService/Sources/Buoy/Handlers/SensorData.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Apodini
import BuoyDeploymentOption
import Foundation


Expand All @@ -25,14 +26,23 @@ struct SensorData: Handler {
var content: some Component {
Group(TemperatureSensor.sensorType.description) {
TemperatureSensor()
.metadata(
DeploymentDevice(.temperature)
)
}

Group(ConductivitySensor.sensorType.description) {
ConductivitySensor()
.metadata(
DeploymentDevice(.conductivity)
)
}

Group(PhSensor.sensorType.description) {
PhSensor()
.metadata(
DeploymentDevice(.ph)
)
}
}
}