Comments (2)
@tdashworth been working on versioning for my own use/implementation of this and have a suggestion on a improvement for solution change detection (in GIT).
What do you think about the solution approach?
cc @ewingjm
from powerapps-project-template.
managed to get a solution working, some further tweaks to make (naming & simplicity):
Azure DevOps Config:
Pull request build policy on the default branch
- run's anytime the source branch is updated
- expires if the default branch is updated before complete (merged in) say the version number is incremented outside of the PR request on the default branch
(the PowerShell step/ for updating version number will be need removing from the Post PR build for further deployment if used)
Yaml update(add of env:systemtoken for Pushing) :
steps:
- task: PowerShell@2
displayName: 'Add build tag for each updated solution'
inputs:
targetType: 'filePath'
errorActionPreference: 'stop'
filePath: 'pipelines/scripts/Add-BuildTagForEachUpdatedSolution.ps1'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
Script:
$targetbranch = $env:SYSTEM_PULLREQUEST_TARGETBRANCH.replace('refs/heads/', '')
$resultArray = git diff --name-only origin/$targetbranch
[System.Collections.ArrayList]$changedSolutions = @()
$commit = 0
foreach ($_ in $resultArray) {
if ($_.StartsWith("src/solutions")) {
$solutionName = $_.Split("/")[2]
if (!$changedSolutions.Contains($solutionName)) {
$changedSolutions.Add($solutionName)
Write-Host "##vso[build.addbuildtag]$solutionName"
$solutionxmlPath = 'src/solutions/' + $solutionName + '/Extract/Other/Solution.xml'
$s = 'origin/' + $targetbranch + ':' + $solutionxmlPath
[xml]$solutionxmltarget = git show $s
[xml]$solutionxmlsource = Get-Content -Path $solutionxmlPath
$sourceVersion = [version]$solutionxmlsource.ImportExportXml.SolutionManifest.Version
$tagetVersion = [version]$solutionxmltarget.ImportExportXml.SolutionManifest.Version
if ($sourceVersion -le $tagetVersion)
{
$newVersion = [version]::New($tagetVersion.Major,$tagetVersion.Minor,$tagetVersion.Build,$tagetVersion.Revision+1)
$solutionxmlsource.ImportExportXml.SolutionManifest.Version = [string]$newVersion
$solutionxmlsource.Save($solutionxmlPath)
$commit = 1
}
}
}
}
$output = $changedSolutions -Join ','
Write-Host "##vso[task.setvariable variable=solutionList]$output"
if ( $commit -eq 1 )
{
$un = git show -s --format="<%aN>"
$ue = git show -s --format="<%aE>"
git config --global user.email $ue
git config --global user.name $un
git checkout $env:SYSTEM_PULLREQUEST_SOURCEBRANCH.replace('refs/heads/', '')
git add .
git commit --message "auto-version"
git config --global http.extraheader "AUTHORIZATION: bearer $env:SYSTEM_ACCESSTOKEN"
git push
}
from powerapps-project-template.
Related Issues (20)
- Build project is failing to build due to targeting netcoreapp3.1 which is no longer supported by windows-latest image
- Extend Extract Solution build task to use Power Platform CLI command HOT 3
- Rollback of repo fails when repo was never initialised HOT 1
- Error during rollback hides the actual error that caused the rollback
- Option to provide full solution name, rather than templating one HOT 2
- `
` artefact when modifying `ImportConfig.xml` HOT 1
- [WIP] Verify multiple solution generation does not cause any adverse effects
- Install failure for scripts HOT 3
- Recursive builds before solution has been generated [WIP] HOT 1
- 'Sarif Viewer Build Tab' is deprecated HOT 1
- List Pre-Requisites
- Early warning if ADO extensions aren't installed HOT 1
- Optional ADO extensions
- Vulnerability: handlebars-4.7.6.js
- Vulnerability: underscore-1.8.3.js
- Pushing initialized repo fails HOT 3
- use/reference of Azure DevOps Power Platform build tools version 0 which is no longer available/working prevents scaffolling new ADO projects
- Vs code task "packsolution" errors on argument: allow delete when the arg is yes
- issue when trying to scaffold Azure DevOps relating to project url
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerapps-project-template.