116 lines
3.6 KiB
YAML
Executable File
116 lines
3.6 KiB
YAML
Executable File
# 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
|
|
base:
|
|
image: devfra.azurecr.io/de.fraport.build/npm
|
|
tag: node-20
|
|
# extraBuildOptions: |
|
|
# --build-arg NPM_CUSTOM_REGISTRY=https://pkgs.dev.azure.com/fraport/_packaging/packages/npm/registry/
|
|
pool: 'Prod Private Agent Pool'
|
|
timeout: 60
|
|
dependsOn: []
|
|
requiredArtifacts: []
|
|
artifacts: |
|
|
assets/icons/fradrive/*.svg
|
|
assets/favicons/*.png
|
|
assets/favicons/include.html
|
|
static/**/*
|
|
well-known/**/*
|
|
frontend/src/env.sass
|
|
config/manifest.json
|
|
- name: backend
|
|
base:
|
|
image: devfra.azurecr.io/de.fraport.build/haskell
|
|
tag: 8.10.4
|
|
pool: 'Prod Private Agent Pool DS3'
|
|
timeout: 1440
|
|
dependsOn:
|
|
- frontend
|
|
requiredArtifacts:
|
|
- name: frontend
|
|
source: current
|
|
version: 'latest'
|
|
artifact: frontend
|
|
patterns: '**/*'
|
|
- name: backend-dependencies
|
|
source: specific
|
|
version: 'latestFromBranch'
|
|
artifact: backend
|
|
patterns: '.stack/**/*'
|
|
artifacts: |
|
|
bin/uniworx
|
|
bin/uniworxdb
|
|
.stack/**/*
|
|
|
|
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'
|
|
|
|
stages:
|
|
|
|
- ${{ each service in parameters.services }}:
|
|
- template: .azure-pipelines/templates/service.yaml
|
|
parameters:
|
|
serviceName: ${{ service.name }}
|
|
serviceBase: ${{ service.base }}
|
|
servicePool: ${{ service.pool }}
|
|
serviceTimeout: ${{ service.timeout }}
|
|
serviceDependsOn: ${{ service.dependsOn }}
|
|
serviceRequiredArtifacts: ${{ service.requiredArtifacts }}
|
|
serviceArtifacts: ${{ service.artifacts }}
|
|
|
|
- stage: release
|
|
dependsOn:
|
|
- backend
|
|
jobs:
|
|
- job: test
|
|
displayName: Release fradrive-test
|
|
condition: eq(variables.releaseTest, true)
|
|
container:
|
|
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
|
|
endpoint: devfra
|
|
steps:
|
|
- checkout: self
|
|
- task: DownloadPipelineArtifact@2
|
|
displayName: Download binaries
|
|
inputs:
|
|
artifactName: backend
|
|
patterns: 'uniworx,uniworxdb'
|
|
targetPath: '$(Build.Repository.LocalPath)'
|
|
- script: |
|
|
ls -a .
|
|
pwd
|
|
find .
|
|
- task: Docker@2
|
|
displayName: Login to container registry
|
|
inputs:
|
|
command: login
|
|
containerRegistry: devFra
|
|
- task: Bash@3
|
|
displayName: Build container
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
cp docker/fradrive/Dockerfile .
|
|
docker build \
|
|
--tag $(imageUpstream)/fradrive:$(Build.BuildNumber) \
|
|
--build-arg FROM_IMG=devfra.azurecr.io/de.fraport.trusted/ubuntu \
|
|
--build-arg FROM_TAG=20.04 \
|
|
--build-arg PROJECT_DIR=$(Build.Repository.LocalPath) \
|
|
--build-arg IN_CI=true \
|
|
--build-arg IN_CONTAINER=true \
|
|
.
|
|
- task: Docker@2
|
|
displayName: Logout from container registry
|
|
inputs:
|
|
command: logout
|
|
containerRegistry: devFra |