115 lines
3.6 KiB
YAML
115 lines
3.6 KiB
YAML
# SPDX-FileCopyrightText: 2024-2025 Sarah Vaupel <sarah.vaupel@uniworx.de>
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
pool: 'Prod Private Agent Pool'
|
|
|
|
jobs:
|
|
- job: FrontendImage
|
|
container:
|
|
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
|
|
endpoint: devfra
|
|
steps:
|
|
- checkout: self
|
|
- task: Docker@2
|
|
name: dockerLoginDevFra
|
|
displayName: Docker Login to devfra
|
|
inputs:
|
|
command: login
|
|
containerRegistry: devFra
|
|
- task: Bash@3
|
|
displayName: Build frontend image
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
cp docker/frontend/Dockerfile .
|
|
docker build \
|
|
--build-arg FROM_IMG=devfra.azurecr.io/de.fraport.build/npm \
|
|
--build-arg FROM_TAG=node-20 \
|
|
--build-arg HTTPS_PROXY=http://proxy.frankfurt-airport.de:8080 \
|
|
--build-arg HTTP_PROXY=http://proxy.frankfurt-airport.de:8080 \
|
|
--build-arg NO_PROXY='localhost,127.0.0.1,*.docker.internal,*.azmk8s.io,devfra.azurecr.io,devfra.westeurope.data.azurecr.io' \
|
|
--build-arg FRAPORT_NOPROXY=dev.azure.com,*.dev.azure.com,*.fraport.de,*.frankfurt-airport.de \
|
|
--build-arg MOUNT_DIR=$(Build.Repository.LocalPath) \
|
|
--build-arg PROJECT_DIR=/fradrive \
|
|
--tag devfra.azurecr.io/de.fraport.fradrive.build/frontend:$(Build.BuildNumber) \
|
|
.
|
|
- task: Bash@3
|
|
displayName: Push frontend image
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
docker push devfra.azurecr.io/de.fraport.fradrive.build/frontend:$(Build.BuildNumber)
|
|
- task: Docker@2
|
|
name: dockerLogoutDevFra
|
|
displayName: Docker Logout from devfra
|
|
inputs:
|
|
command: logout
|
|
containerRegistry: devFra
|
|
|
|
- job: BackendImage
|
|
pool: 'Prod Private Agent Pool'
|
|
container:
|
|
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
|
|
endpoint: devfra
|
|
steps:
|
|
- checkout: self
|
|
- task: Docker@2
|
|
name: dockerLoginDevFra
|
|
displayName: Docker Login to devfra
|
|
inputs:
|
|
command: login
|
|
containerRegistry: devFra
|
|
- task: Bash@3
|
|
displayName: Build backend image
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
echo "DUMMY BACKEND BUILD"
|
|
- task: Docker@2
|
|
name: dockerLogoutDevFra
|
|
displayName: Docker Logout from devfra
|
|
inputs:
|
|
command: logout
|
|
containerRegistry: devFra
|
|
|
|
- job: FrontendBuild
|
|
dependsOn: FrontendImage
|
|
condition: succeeded()
|
|
container:
|
|
image: devfra.azurecr.io/de.fraport.fradrive.build/frontend:$(Build.BuildNumber)
|
|
endpoint: devfra
|
|
steps:
|
|
- checkout: self
|
|
- task: Bash@3
|
|
name: frontendCompile
|
|
displayName: Compile frontend
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
make -- --compile-frontend IN_CONTAINER=true
|
|
- task: Bash@3
|
|
name: frontendTest
|
|
displayName: Test frontend
|
|
inputs:
|
|
targetType: inline
|
|
script: |
|
|
make -- --lint-frontend IN_CONTAINER=true
|
|
make -- --test-frontend IN_CONTAINER=true
|
|
- task: CopyFiles@2
|
|
name: frontendCopyArtifacts
|
|
displayName: Prepare frontend artifacts
|
|
inputs:
|
|
Contents: |
|
|
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' |