trigger:
- master
- next
- version-*
variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], '/', '-') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }}
stages:
- stage: generate
jobs:
- job: swagger_generate
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'
- task: CmdLine@2
script: |
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/swagger.yaml -g typescript-fetch -o /local/web/api --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=authentik-api,npmVersion=1.0.0
- task: PublishPipelineArtifact@1
targetPath: 'web/api/'
artifact: 'ts_swagger_client'
publishLocation: 'pipeline'
- stage: lint
- job: eslint
- task: DownloadPipelineArtifact@2
buildType: 'current'
artifactName: 'ts_swagger_client'
path: "web/api/"
- task: Npm@1
command: 'install'
workingDir: 'web/'
command: 'custom'
customCommand: 'run lint'
- job: lit_analyse
customCommand: 'run lit-analyse'
- stage: build_local
- job: build
customCommand: 'run build'
- stage: build_docker
- job: build_static
- task: Bash@3
targetType: 'inline'
python ./scripts/az_do_set_branch.py
- task: Docker@2
containerRegistry: 'beryjuorg-harbor'
repository: 'authentik/static'
command: 'buildAndPush'
Dockerfile: 'web/Dockerfile'
tags: "gh-$(branchName)"
buildContext: 'web/'