Customer-Specific Branches

Use Case: Managing Customer-Specific Branches with Versioning Tools API

Context

When a development team maintains multiple branches for different customers, managing versions effectively becomes crucial. This use case illustrates how to automate versioning for customer-specific branches using the Versioning Tools API. The process involves retrieving the next semantic version, updating version tags in the branches, and coordinating deployments.

Scenario

A team maintains separate branches for each customer, such as customerA, customerB, and customerC. After completing updates for a particular customer, the team needs to:

  1. Retrieve the next semantic version for the customer’s branch from the Versioning Tools API.

  2. Tag the version in the corresponding branch.

  3. Push the version tag to the remote repository.

  4. Prepare the branch for deployment.

Step-by-Step Guide

1. Retrieve the Next Version Identifier

The team needs to obtain the next semantic version for a customer-specific branch using the Versioning Tools API.

Command:

curl -X 'POST' \
  'https://api.versioning.tools/v1/SemVer/customerA?apiKey=YOUR_API_KEY' \
  -H 'accept: */*'

Explanation:

  • customerA: Replace with the service ID for the specific customer’s branch.

  • YOUR_API_KEY: Replace with your API key.

Example Output:

1.3.0

The response will be the next version number in plain text.

2. Update Version Tag in the Customer-Specific Branch

Switch to the customer-specific branch and tag it with the new version.

Command to Checkout Branch:

git checkout customerA

Command to Create Tag:

git tag v1.3.0 -m "Release version 1.3.0 for customerA"

Explanation:

  • v1.3.0: The version number obtained from the API.

  • -m "Release version 1.3.0 for customerA": A message describing the tag.

3. Push the Tag to the Remote Repository

Push the new tag to the remote repository.

Command:

git push origin v1.3.0

Explanation:

  • origin: The name of the remote repository.

  • v1.3.0: The tag being pushed.

4. Prepare the Branch for Deployment

Prepare the customer-specific branch for deployment:

  1. Deploy Updated Branch:

    • Follow your deployment procedures to deploy the updated version of the branch for the specific customer. This may involve using deployment tools or services specific to your environment.

  2. Update Deployment Documentation:

    • Document the new version and any relevant changes in deployment records or release notes for the customer-specific branch.

Example Workflow

Here’s an example workflow for updating the version of a customer-specific branch:

  1. Complete Updates:

    • Finalize development and testing for customerA.

  2. Retrieve the Next Version:

    NEXT_VERSION=$(curl -X 'POST' \
      'https://api.versioning.tools/v1/SemVer/customerA?apiKey=YOUR_API_KEY' \
      -H 'accept: */*')
  3. Checkout Branch and Tag:

    git checkout customerA
    git tag "v$NEXT_VERSION" -m "Release version $NEXT_VERSION for customerA"
  4. Push the Tag:

    git push origin "v$NEXT_VERSION"
  5. Prepare for Deployment:

    • Deploy the updated customerA branch and update deployment documentation.


Last updated