Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-13618

Ability to checkout and create tags in a Git repository

    XMLWordPrintable

Details

    • 29
    • 31
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Definition

      When creating release and deployment builds it commonly desired to tag the commit that was built. For example, the Maven release plugin does this automatically. For projects that don't use Maven we need a way to tag the release code to avoid manual steps.

      It is also useful to build from a Git tag. For example, when you need to redeploy a release artifact from the past that is not present in Bamboo.

      Suggested Solution

      • Add a build step that will tag the currently checked out commit.
      • Add the ability to select Git tags for build steps.
      • Make this work in Git repositories hosted in Stash and BitBucket as well.

      Workaround

      1. Configure Source Code Checkout task in the Build Plan to checkout source.git into a directory for building the code
      2. Add another Source Code Checkout task in the Build Plan at the bottom of the task to checkout deploy.git into another directory
      3. With this deploy.git, check what is the latest changeset/revision (probably “git log -1”) with a Script task to save the changeset/revision into a file
      4. Create an Artifact for this file in step 3
      5. In the environment task, use Script task to read this file in step 3 and perform Git checkout with it in the same Script task

      With this workaround, the deployment in other environment or rollback will be able to perform Git checkout on the same changeset/revision depending on the Artifact.

      NOTE: For this approach you will need to setup a private key on remote agent(s) so the agent will have permission to access the repository directly. This is because the credentials stored in the Bamboo server aren't available to the script task as it is executed by the 'bamboouser' on the remote agent.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rjmasikome RianA
              Votes:
              160 Vote for this issue
              Watchers:
              109 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: