-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tibber-live.yml
61 lines (53 loc) · 1.71 KB
/
tibber-live.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
trigger: none
schedules:
- cron: "0 */4 * * *"
displayName: At minute 0 past every 4th hour
branches:
include:
- main
always: true
pool:
vmImage: windows-latest
variables:
- group: tibber-pulse
resources:
repositories:
# See https://github.com/stefanes/azure-pipelines
- repository: templates
type: github
endpoint: stefanes
name: stefanes/azure-pipelines
jobs:
- job:
displayName: Tibber live measurements
timeoutInMinutes: 250
steps:
- template: install-modules.yml@templates
parameters:
modules:
- PSTibber
- PSGraphite
allowPrerelease: false
reinstall: true
- pwsh: |
Import-Module -Name .\tibber-pulse.psd1 -Force -PassThru
Write-Host "##[command]Get-ReadUntil"
$until = Get-ReadUntil
Write-Host "##[command][task.setvariable variable=readUntil]$until"
Write-Host "##vso[task.setvariable variable=readUntil]$until"
displayName: Get read deadline
workingDirectory: $(Build.SourcesDirectory)
env:
TIBBER_ACCESS_TOKEN: $(TIBBER_API_KEY)
GRAPHITE_ACCESS_TOKEN: $(GF_API_KEY)
GRAPHITE_METRICS_PREFIX: tibber
- template: invoke-expressionwithretry.yml@templates
parameters:
numberOfRetries: -1
expression: .\tibber-live.ps1 -Until '$(readUntil)' -Publish -TimeZone 'W. Europe Standard Time'
displayName: Get live measurement metrics
env:
TIBBER_ACCESS_TOKEN: $(TIBBER_API_KEY)
TIBBER_USER_AGENT: "stefanes.tibber-pulse/0.1.1"
GRAPHITE_ACCESS_TOKEN: $(GF_API_KEY)
GRAPHITE_METRICS_PREFIX: tibber