Is to possible to clone from tag

david's Avatar

david

29 Dec, 2019 12:12 AM

We have a need to build multiple installers off the same git tag. Is there a way to do it? Currently, we trigger builds via rest api and pass branch and configuration. We have several configurations and need an installer built for each. I tried passing tag name in the branch parameter and got a 404.

  1. Support Staff 1 Posted by Feodor Fitsner on 29 Dec, 2019 08:12 PM

    Feodor Fitsner's Avatar

    Hi David,

    Indeed, using builds API you can start a new build from a branch only. However, while calling API endpoint to start a new branch build you can pass an array of environment variables that will be available on the VM during the build. So, you can pass the name of the tag you want to fetch, for example MY_RELEASE_TAG: "v1.0" and then during the build in install section, after repo is cloned, you can have something like:

    install:
    - git fetch --tags
    - git checkout tags/%MY_RELEASE_TAG%
    

    Thus you'll have a tag checked out in the current directory. Let me know how that worked.

  2. 2 Posted by david on 30 Dec, 2019 07:49 PM

    david's Avatar

    I realized that I really do want to make a release branch in this case.
    Thanks for your help. S Novim Godom!

  3. Support Staff 3 Posted by Feodor Fitsner on 31 Dec, 2019 01:18 AM

    Feodor Fitsner's Avatar

    Thanks for the update and Happy New Year! :)

  4. Feodor Fitsner closed this discussion on 03 Apr, 2020 06:47 PM.

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