fradrive/azure-pipelines.yaml

73 lines
2.5 KiB
YAML

# SPDX-FileCopyrightText: 2024-2025 Sarah Vaupel <sarah.vaupel@uniworx.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
parameters:
- name: services
type: object
default:
- name: frontend
baseImage: devfra.azurecr.io/de.fraport.build/npm
baseImageTag: node-20
extraBuildOptions: |
--build-arg NPM_CUSTOM_REGISTRY=https://pkgs.dev.azure.com/fraport/_packaging/packages/npm/registry/ \
variables:
imageUpstream: devfra.azurecr.io/de.fraport.fradrive.build
onMasterBranch: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
onUpdateBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/update')]
pool: 'Prod Private Agent Pool'
jobs:
- ${{ each service in parameters.services }}:
- template: .azure-pipelines/templates/build-image.yaml
parameters:
service: ${{ service }}
- job: FrontendBuild
# TODO: wait for FrontendImage iff the job was executed
# dependsOn: FrontendImage
# condition: succeeded()
container:
# image: devfra.azurecr.io/de.fraport.fradrive.build/frontend:$(Build.BuildNumber)
image: devfra.azurecr.io/de.fraport.fradrive.build/frontend:latest
endpoint: devfra
env:
PROJECT_DIR: $(Build.Repository.LocalPath)
IN_CONTAINER: true
IN_CI: true
steps:
- checkout: self
- task: Bash@3
name: frontendDependencies
displayName: Install frontend dependencies
env:
HTTPS_PROXY: http://proxy.frankfurt-airport.de:8080
HTTP_PROXY: http://proxy.frankfurt-airport.de:8080
NO_PROXY: 'localhost,127.0.0.1,*.docker.internal,*.azmk8s.io,devfra.azurecr.io,devfra.westeurope.data.azurecr.io'
FRAPORT_NOPROXY: 'dev.azure.com,*.dev.azure.com,*.fraport.de,*.frankfurt-airport.de'
PROJECT_DIR: $(Build.Repository.LocalPath)
inputs:
targetType: inline
script: |
make -- --dependencies-frontend IN_CONTAINER=true IN_CI=true PROJECT_DIR=${PROJECT_DIR}
- task: CopyFiles@2
name: frontendCopyArtifacts
displayName: Prepare frontend artifacts
inputs:
Contents: |
assets/icons
assets/favicons
static/
well-known/
frontend/src/env.sass
config/manifest.json
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
name: frontendPublishArtifacts
displayName: Publish frontend artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'frontend'
publishLocation: 'Container'