Skip to content

Commit

Permalink
Bumping version to 0.0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Oct 5, 2018
1 parent 92195d0 commit 217be63
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Release Notes

## 0.0.26 - 2018-10-05
## 0.0.27 - 2018-10-05

* Initial release
4 changes: 2 additions & 2 deletions src/Client/ReleaseNotes.fs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module internal ReleaseNotes

let Version = "0.0.26"
let Version = "0.0.27"

let IsPrerelease = false

let Notes = """
# Release Notes
## 0.0.26 - 2018-10-05
## 0.0.27 - 2018-10-05
* Initial release
"""
36 changes: 33 additions & 3 deletions src/PiServer/PiServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ let play (nodeServices : INodeServices) (uri:string) = task {
let stop (nodeServices : INodeServices) = task {
if isWindows then
let! r = nodeServices.InvokeExportAsync<string>("./play-audio", "stop")
printfn "Stopped"
return r
else
let! r = nodeServices.InvokeExportAsync<string>("./play-audiostream", "stop")
printfn "Stopped"
return r
}

Expand Down Expand Up @@ -77,6 +75,34 @@ let executeTag (nodeServices : INodeServices) (tag:string) = task {
| Ok tag -> return! executeAction nodeServices tag.Action
}

let checkFirmware () = task {
use webClient = new System.Net.WebClient()
System.Net.ServicePointManager.SecurityProtocol <-
System.Net.ServicePointManager.SecurityProtocol |||
System.Net.SecurityProtocolType.Tls11 |||
System.Net.SecurityProtocolType.Tls12

let url = sprintf @"%s/api/firmware" tagServer
let! result = webClient.DownloadStringTaskAsync(System.Uri url)

match Decode.fromString Firmware.Decoder result with
| Error msg -> return failwith msg
| Ok firmware ->
try
if firmware.Version <> ReleaseNotes.Version then
let localFileName = System.IO.Path.GetTempFileName().Replace(".tmp", ".zip")
printfn "Starting download of %s" firmware.Url
do! webClient.DownloadFileTaskAsync(firmware.Url,localFileName)
printfn "Download done."
System.IO.Compression.ZipFile.ExtractToDirectory(localFileName, System.IO.Path.GetFullPath "./install")
System.IO.File.Delete localFileName
return Some firmware.Version
else
return None
with
| _ -> return None
}

let executeStartupActions (nodeServices : INodeServices) = task {
use webClient = new System.Net.WebClient()
let url = sprintf @"%s/api/startup" tagServer
Expand Down Expand Up @@ -114,7 +140,11 @@ let app = application {
let x = app.Build()
x.Start()

printfn "Started"
printfn "Server started"

let firmwareCheck = checkFirmware()
firmwareCheck.Wait()
let r = firmwareCheck.Result

let service = x.Services.GetService(typeof<INodeServices>) :?> INodeServices

Expand Down
1 change: 1 addition & 0 deletions src/PiServer/PiServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Client\ReleaseNotes.fs" />
<Compile Include="..\Shared\Shared.fs" />
<Compile Include="PiServer.fs" />
</ItemGroup>
Expand Down

0 comments on commit 217be63

Please sign in to comment.