Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions devops-pipelines/backend/backend-pr-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@ variables:
value: '10.0.*'
- name: testResultsDirectory
value: "$(Agent.TempDirectory)/TestResults"
- name: prSourceBranch
value: $[variables['System.PullRequest.SourceBranch']]
- name: prTargetBranch
value: $[variables['System.PullRequest.TargetBranch']]

pool: "LACC PreProd Pool"

stages:
- stage: Build_And_Test_Backend
condition: not(and(
eq(variables.prSourceBranch, 'development' ),
eq(variables.prTargetBranch, 'main')
))
displayName: "Build, Test & Package"
jobs:
- job: Package_NuGet
Expand Down
81 changes: 81 additions & 0 deletions devops-pipelines/tag-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
trigger:
branches:
include:
- main
paths:
include:
- backend
- ui-spa

pr:
branches:
include:
- main
paths:
include:
- backend
- ui-spa

variables:
- group: lacc-deployment-global
- name: buildReason
value: $[variables['Build.Reason']]

pool: "LaCC PreProd Pool"

steps:
- checkout: self
persistCredentials: true

- script: |
set -euo pipefail

if [[ ! "$(releaseVersion)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "##vso[task.logissue type=error]The value of variable releaseVersion: $(releaseVersion) is not a valid semantic version. Expected format: MAJOR.MINOR.PATCH."
exit 1
fi

newTag="v$(releaseVersion)"

# get the highest release tag from origin
# ignore peeled references produced for annotated tags
latestTag=$(git ls-remote --tags origin 'refs/tags/v*' |
awk '$2 !~ /\^\{\}$/ {sub("refs/tags/", "", $2); print $2}' |
sort -V |
tail -n 1)

if [[ -z "$latestTag" ]]; then
echo "##vso[task.logissue type=warning]No release tags found in the remote repository."
else
echo "Latest remote tag: $latestTag"
echo "New release tag: $newTag"

# validate the latest remote tag format
if [[ ! "$latestTag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "##vso[task.logissue type=error]The latest tag found in the remote repository has an unexpected format: $latestTag. Expected format: vMAJOR.MINOR.PATCH."
exit 1
fi

# fail if newTag is less than or equal to latestTag.
highestVersion=$(printf '%s\n%s\n' "$latestTag" "$newTag" | sort -V | tail -n 1)

if [[ "$highestVersion" == "$latestTag" ]]; then
echo "##vso[task.logissue type=error]The semver value of variable releaseVersion: $(releaseVersion) must be greater than ${latestTag#v}."
exit 1
fi
fi

echo "The respository will be tagged with the new release version $newTag"
echo "##vso[task.setvariable variable=newTag;]$newTag"
displayName: "Validate releaseVersion Tag"

- script: |
set -euo pipefail

# overwrite any local tags. We are only interested in the remote:
git tag -f $(newTag)

git push origin refs/tags/$(newTag)
# only tag repo on merge to main
condition: and(succeeded(), eq(variables.buildReason, 'IndividualCI'))
displayName: "Tag Repository"
21 changes: 21 additions & 0 deletions devops-pipelines/ui/ui-pr-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ variables:
value: ui-spa
- name: covDir
value: "coverage"
- name: prSourceBranch
value: $[variables['System.PullRequest.SourceBranch']]
- name: prTargetBranch
value: $[variables['System.PullRequest.TargetBranch']]

stages:
- stage: Build_and_Test_UI
condition: not(and(
eq(variables.prSourceBranch, 'development' ),
eq(variables.prTargetBranch, 'main')
))
displayName: "Build & Test UI SPA"
jobs:
- job: Build_and_Test
Expand Down Expand Up @@ -143,3 +151,16 @@ stages:
inputs:
summaryFileLocation: "$(workingDir)/$(covDir)/merged/Cobertura.xml"
failIfCoverageEmpty: true

# On PR development -> main, run the E2E tests in dev
- stage: Run_E2E_tests
condition: and(
eq(variables.prSourceBranch, 'development' ),
eq(variables.prTargetBranch, 'main' )
)
dependsOn: []
displayName: "Run E2E Test on Dev"
jobs:
- template: ../templates/e2e-playwright-test-job.yml
parameters:
environment: "dev"
Loading