Dependency builds and linked versions

BlackGad's Avatar

BlackGad

09 Jul, 2017 05:11 PM

I have 2 separated builds (actually master and ci git branches)

Master branch version format is MAJOR.{appveyor_build1_increment}.0
CI branch version format is MAJOR.{appveyor_build1_increment}.{appveyor_build2_increment > 0}

Every master build CI build must reset it appveyor_build2_increment to 1.

Can i automate version fetch and patch in build2 from build1?

  1. 1 Posted by BlackGad on 09 Jul, 2017 09:15 PM

    BlackGad's Avatar

    Resolved.

    Configurations:
    Build 1:
    Version format MAJOR.{Increment}.
    Option "Pull Requests do not increment build number" enabled

    Build 2:
    Version format {increment}
    Option "Pull Requests do not increment build number" enabled.
    Init script set (Build->Environment->Init)

    $parent_info = Invoke-RestMethod -Uri "https://ci.appveyor.com//api/projects/<account>/<ParentProjectSlug>"
    $match = [regex]::match($parent_info.build.version, "(\d+)\.(\d+)(-.+)?")
    if($match.Success) 
    { 
        $major = $match.Groups[1].Value
        $minor = $match.Groups[2].Value
        $newVersion = $major + "." + $minor + "." + $env:APPVEYOR_BUILD_VERSION
    
        Update-AppveyorBuild -Version $newVersion
    }  
    else 
    { 
        [System.ArgumentException] "Invalid parent build version"
    }
    
  2. Support Staff 2 Posted by Feodor Fitsner on 09 Jul, 2017 10:20 PM

    Feodor Fitsner's Avatar

    Thanks for sharing the solution!

  3. 3 Posted by BlackGad on 10 Jul, 2017 09:23 AM

    BlackGad 's Avatar

    One more question :) Is it possible to reset build increment to specific value via script?

  4. 4 Posted by Ilya Finkelshte... on 10 Jul, 2017 08:45 PM

    Ilya Finkelshteyn's Avatar

    Please look at this sample. It is for little bit different scenario, when build needs to reset nextBuildNumber for itself, when some condition happens. But I believe you can easily adjust it to make master to reset nextBuildNumber for ci build.
    Please let us know if you need any additional help with it.

  5. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:18 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Jun, 2025 08:45 PM
18 Jun, 2025 04:23 PM
13 Jun, 2025 04:36 PM
13 Jun, 2025 04:27 PM
13 Jun, 2025 07:20 AM

 

10 Jun, 2025 01:56 AM
09 Jun, 2025 07:11 PM
04 Jun, 2025 04:08 PM
27 May, 2025 05:48 PM
27 May, 2025 06:37 AM
27 May, 2025 06:31 AM