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! :)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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