2020-04-26 02:34:54 +03:00
|
|
|
# Custom pipeline here because unlike the other static sites, we can't run the
|
|
|
|
# build on Windows because we need to use a case-sensitive filesystem. That
|
|
|
|
# means that we can't use the AzureFileCopy command to upload the files to
|
|
|
|
# Azure Storage.
|
2020-04-26 01:54:40 +03:00
|
|
|
|
2020-04-26 02:36:51 +03:00
|
|
|
parameters:
|
|
|
|
- name: 'zolaVersion'
|
2022-01-04 01:08:10 +03:00
|
|
|
default: '0.15.2'
|
2020-04-26 02:36:51 +03:00
|
|
|
type: string
|
|
|
|
|
2020-04-26 01:54:40 +03:00
|
|
|
jobs:
|
2020-04-26 02:34:54 +03:00
|
|
|
- job: BuildAndPublish
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- checkout: self
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
u='https://github.com/getzola/zola/releases/download/v${{ parameters.zolaVersion }}/zola-v${{ parameters.zolaVersion }}-x86_64-unknown-linux-gnu.tar.gz'
|
|
|
|
curl -fsSL "$u" |tar xz
|
|
|
|
displayName: Install Zola
|
|
|
|
|
2020-04-26 02:52:47 +03:00
|
|
|
# The check fails spuriously on Azure Pipelines too often to be useful.
|
|
|
|
# - script: |
|
|
|
|
# ./zola check
|
|
|
|
# displayName: Check site
|
2020-04-26 02:34:54 +03:00
|
|
|
|
2020-04-26 02:47:16 +03:00
|
|
|
- script: |
|
2022-01-04 01:13:41 +03:00
|
|
|
# The "echo" gets past a Zola confirmation to blow away the output directory
|
|
|
|
echo y |./zola build -o $(build.artifactStagingDirectory)
|
2020-04-26 02:34:54 +03:00
|
|
|
displayName: Build site
|
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@0
|
|
|
|
displayName: Publish site as artifact
|
|
|
|
inputs:
|
|
|
|
artifactName: static-site
|
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)
|
|
|
|
|
|
|
|
- task: AzureCLI@2
|
|
|
|
displayName: Upload to Azure Storage
|
|
|
|
inputs:
|
|
|
|
azureSubscription: 'aas@wwtadmindotnetfoundation'
|
|
|
|
scriptType: 'bash'
|
|
|
|
scriptLocation: 'inlineScript'
|
|
|
|
inlineScript: |
|
2022-04-01 04:03:00 +03:00
|
|
|
az storage blob upload-batch --overwrite -s $(build.artifactStagingDirectory) -d '$web'
|
2020-04-26 02:34:54 +03:00
|
|
|
env:
|
|
|
|
AZURE_STORAGE_CONNECTION_STRING: $(AZURE_STORAGE_CONNECTION_STRING)
|