Simplified Strategy
Documentation: Simplified Strategy for Versioning with Versioning Tools API
Overview
This guide outlines a streamlined approach for managing and automating versioning using the Versioning Tools API. It shows how to retrieve the next version identifier and tag your Git repository based on the API's response. This process ensures consistent and automated version management for your projects.
Prerequisites
Before you start, ensure you have:
API Access: An API key for the Versioning Tools platform.
Git Repository: Your project’s source code managed in a Git repository.
Git Installed: Git must be installed and configured on your local machine or CI/CD environment.
API Endpoints Overview
The Versioning Tools API provides several endpoints to manage semantic versions:
Get Next Version Identifier:
POST
/v1/SemVer/{serviceId}
Description: Retrieves the next semantic version for your service.
Get Current Version:
GET
/v1/SemVer/{serviceId}
Description: Retrieves the current semantic version for the specified service.
Set Specific Version:
POST
/v1/SemVer/{serviceId}/set/{semVer}
Description: Sets a specific version manually.
Simplified Strategy for Version Management
Step 1: Retrieve the Next Version Identifier
To get the next version identifier from the Versioning Tools API:
Call the API: Use the
POST
method on the/v1/SemVer/{serviceId}
endpoint to get the next version identifier.Example using
curl
:Replace
myServiceId
with your service ID andYOUR_API_KEY
with your API key. The response will provide the next semantic version (e.g.,1.2.0
), which you can use to tag your Git repository.Use an Identifier (Optional): If you need to differentiate versions based on a specific context (e.g., branch name), you can include an identifier:
Step 2: Tag the Git Repository with the New Version
After obtaining the next version identifier, you can tag your Git repository:
Tag the Current Commit: Use the
git tag
command to create a tag with the version you received from the API.Replace
v1.2.0
with the version returned by the API.Push the Tag to the Remote Repository: Push the newly created tag to your remote repository:
Step 3: Automate the Process (Optional)
To automate this process, you can include these steps in a CI/CD pipeline script. Here’s an example using a shell script:
Replace myServiceId
and YOUR_API_KEY
with your service ID and API key, respectively.
Last updated