Skip to content

Commit

Permalink
Skynet staging (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
drmathias authored Oct 19, 2020
1 parent 356753f commit 366857b
Showing 1 changed file with 58 additions and 2 deletions.
60 changes: 58 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,40 @@ stages:
targetPath: '$(Build.ArtifactStagingDirectory)/output'
artifact: '$(ARTIFACT_NAME)'
publishLocation: 'pipeline'

- stage: Staging
displayName: Staging
dependsOn: Build
condition: succeeded()

jobs:
- deployment: DeployToSkynet
displayName: Deploy to Sia Skynet
environment: developmomentum-staging

strategy:
runOnce:
deploy:
steps:
- task: Sia-Skynet-Upload@0
displayName: 'Upload to https://skynet.developmomentum.com'
name: website_upload
inputs:
portal: 'https://skynet.developmomentum.com'
path: '$(Pipeline.Workspace)/$(ARTIFACT_NAME)'

- powershell: |
New-Item -Path $(Pipeline.Workspace) -Name variables -ItemType directory
Write-Output $(website_upload.skylink) > $(Pipeline.Workspace)/variables/skylink
displayName: Write to File
- publish: $(Pipeline.Workspace)/variables
artifact: variables
displayName: Share

- stage: Release
displayName: Release
dependsOn: Build
dependsOn: Staging
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))

jobs:
Expand All @@ -73,7 +103,7 @@ stages:

variables:
AZURE_STORAGE_ACCOUNT: developmomentum

strategy:
runOnce:
deploy:
Expand Down Expand Up @@ -117,3 +147,29 @@ stages:
apikey: '$(CLOUDFLARE_API_KEY)'
zonename: developmomentum.com
continueOnError: true

- job: PublishToSkynet
displayName: Publish to Sia Skynet

steps:
- download: current
artifact: variables
displayName: 'Retrieve Variables'

- powershell: |
$skylink = Get-Content $(Pipeline.Workspace)/variables/skylink
Write-Output "##vso[task.setvariable variable=skylink]$skylink"
displayName: 'Populate Variable'
- task: GitHubRelease@1
displayName: 'Tag'
inputs:
gitHubConnection: 'github.com_drmathias'
repositoryName: 'drmathias/developmomentum'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(Build.BuildNumber)'
releaseNotesSource: 'inline'
releaseNotesInline: 'sia://$(skylink)'
addChangeLog: false

0 comments on commit 366857b

Please sign in to comment.