Skip to content

Commit

Permalink
Create LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
mure authored Jul 13, 2021
1 parent 345b473 commit 87cd2cc
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 NI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 42 additions & 0 deletions Setup-Grafana.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$FilesRoot = 'C:/Program Files/National Instruments/Shared'
$ConfigRoot = 'C:/ProgramData/National Instruments/Skyline'
$PluginRoot = "$FilesRoot/Web Server/htdocs/plugins"
$GrafanaRoot = 'C:/Program Files/GrafanaLabs/grafana'

If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
Write-Output 'Restarting as an elevated process...'
Start-Sleep 1
Start-Process powershell.exe -Verb RunAs "-Command cd \`"$pwd\`"; & \`"$($MyInvocation.MyCommand.Path)\`""
exit
}

$IsInstalled = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*).displayname -contains "GrafanaOSS"
if (-Not $IsInstalled) {
Write-Output 'Grafana not found - downloading installer'
Start-BitsTransfer -Source 'https://dl.grafana.com/oss/release/grafana-7.5.3.windows-amd64.msi' -Destination 'grafana.msi'
Write-Output "Installing GrafanaOSS..."
Start-Process msiexec.exe -Wait -ArgumentList '/I grafana.msi /qr'
Remove-Item './grafana.msi'
}

Write-Output 'Writing SystemLink configuration'
Copy-Item -Path './config/ni-grafana' -Destination $PluginRoot -Recurse -Force
Copy-Item -Path './config/custom.ini' -Destination "$GrafanaRoot/conf" -Force
Copy-Item -Path './config/75_grafana.conf' -Destination "$FilesRoot/Web Server/conf/conf.d" -Force

Write-Output 'Copying over plugins to Grafana'
New-Item -ItemType 'directory' -Path "$GrafanaRoot/data/plugins" -Force
Copy-Item -Path './plugins/*' -Destination "$GrafanaRoot/data/plugins" -Recurse -Force

Write-Output 'Provisioning datasources'
New-Item -ItemType 'directory' -Path "$ConfigRoot/Grafana/dashboards" -Force
Copy-Item -Path './examples/*.ipynb' -Destination "$ConfigRoot/JupyterHub/notebooks/_shared/reports" -Force
Copy-Item -Path './config/datasources.yml' -Destination "$GrafanaRoot/conf/provisioning/datasources" -Force
Copy-Item -Path './examples/Default Test Module.json' -Destination "$ConfigRoot/Grafana/dashboards" -Force
Copy-Item -Path './config/dashboards.yml' -Destination "$GrafanaRoot/conf/provisioning/dashboards" -Force

Write-Output 'Restarting services...'
Restart-Service 'Grafana'
Restart-Service 'NI Web Server'
Write-Output 'Finished'

0 comments on commit 87cd2cc

Please sign in to comment.