{"id":17355129,"url":"https://github.com/zephinzer/version-tagging-scripts","last_synced_at":"2026-03-01T14:34:00.868Z","repository":{"id":57114013,"uuid":"100365864","full_name":"zephinzer/version-tagging-scripts","owner":"zephinzer","description":"Experiment repository for using git tagging with versions","archived":false,"fork":false,"pushed_at":"2018-09-13T07:36:29.000Z","size":38,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-01T15:26:17.555Z","etag":null,"topics":["devops","joeir"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zephinzer.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-15T10:17:16.000Z","updated_at":"2024-03-09T01:54:43.000Z","dependencies_parsed_at":"2022-08-22T09:01:14.963Z","dependency_job_id":null,"html_url":"https://github.com/zephinzer/version-tagging-scripts","commit_stats":null,"previous_names":[],"tags_count":765,"template":false,"template_full_name":null,"purl":"pkg:github/zephinzer/version-tagging-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fversion-tagging-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fversion-tagging-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fversion-tagging-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fversion-tagging-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephinzer","download_url":"https://codeload.github.com/zephinzer/version-tagging-scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fversion-tagging-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29970993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T14:11:48.712Z","status":"ssl_error","status_checked_at":"2026-03-01T14:11:48.352Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","joeir"],"created_at":"2024-10-15T17:42:24.526Z","updated_at":"2026-03-01T14:34:00.849Z","avatar_url":"https://github.com/zephinzer.png","language":"Shell","readme":"# Version Tagging Scripts\n\n[![Build Status](https://travis-ci.org/zephinzer/version-tagging-scripts.svg?branch=master)](https://travis-ci.org/zephinzer/version-tagging-scripts)\n\nThis package provides scripts that helps with managing semver versioning systems using\ngit tagging.\n\nSemver versioning is:\n```\n X . Y . Z\n |   |   |-\u003e patch version (bug fixes)\n |   |-\u003e minor version (backward-compatible changes/additions)\n |-\u003e major version (backward-compatibility breaking changes)\n```\n\nRead more on semver at: [http://semver.org/](http://semver.org/)\n\n\n\n# Installation\n\n\n\n## NPM \n\n\nInstall this locally using:\n\n```bash\nnpm i vtscripts --save-dev\n```\n\nOr globally:\n\n```bash\nnpm i -g vtscripts\n```\n\n\n## Git Submodule\n\n\nUse this as a `git` submodule. Install it by running the following in the root of your\nproject:\n\n```\ngit submodule add https://github.com/zephinzer/version-tagging-scripts \u003c./path/to/put/it/in\u003e\n```\n\n\n\n# Usage\n\n\n\nBy default, all scripts will print the debug output. They also come with a `-q` or\n`--quiet` flag that can silence the debug output which you should use once you've tested\nthem out.\n\nDetails of all scripts can also be found via the `-h` or `--help` script.\n\n\u003e **IMPORTANT** Call the scripts using `./script` instead of `bash ./script`, this allows\nthe script to find itself relative to where you're calling it from and things will **fail**\nshould you not do so. The necessary hashbangs have been added and they are labelled with\n`#!/bin/sh`. \n\n\n\n## Call from Docker Container\n\n\n\nIt is possible to use the published Docker container to iterate a version. To do this, pull the image first:\n\n```bash\ndocker pull zephinzer/vtscripts:latest\n```\n\nVerify the iamge has been pulled from Docker Hub:\n\n```bash\ndocker images | grep vtscripts\n```\n\nA single line of output should appear:\n\n```\nzephinzer/vtscripts                    latest                                         xxxxxxxxxxxx        2 weeks ago         48.2MB\n```\n\nRun the container, binding your current directory into the container, and append the required command behind a `docker run`:\n\n```bash\ndocker run -v \"$(pwd):/app\" zephinzer/vtscripts:latest \u003cCOMMAND\u003e [options]\n```\n\nWhen calling from a container, remove the `./` prefix from the command list.\n\n\n## Calling from Host\n\n\n\nTo call from host, add this repository as a Git submodule and call the scripts as follows.\n\n\n\n## Commands\n\n\n\n### `./iterate`\nThe `./iterate` script should be enough for most continuous integration pipelines.\n\nRun it anywhere in your pipeline that you need to up the version number.\n\nTo up the `patch` version, use:\n\n```bash\n./path/you/put/it/iterate -q -i\n```\n\nTo up the `minor` version, use:\n\n```bash\n./path/you/put/it/iterate minor -q -i\n```\n\nTo up the `major` version, use:\n\n```bash\n./path/you/put/it/iterate major -q -i\n```\n\n### `./get-branch`\n\n\nThis script outputs the current branch you are on.\n\n\n### `./get-latest`\nThis script outputs the latest version you are on.\n\n\n### `./get-next`\nThis script outputs the next version you should be migrating to.\n\n\n### `./init`\nThis script checks for the presence of a `git` tag that resembles `x.y.z` where\n`x` is the major version, `y` is the minor version, and `z` is the patch version.\nShould it fail to find such a git tag, it will initialize by adding a global\n`0.0.0` tag to your repository.\n\n\n\n# CI Software Integration Help\n\n\n\n## GitLab\n\n\nInstall it in your dev machine with:\n\n```bash\ngit submodule add https://github.com/zephinzer/version-tagging-scripts \u003c./path/you/wanna/add/submodule/to\u003e\n```\n\nA new file `.gitmodules` should appear. Verify that it looks like\n\n```\n[submodule './path/you/added/submodule/to']\n  path = ./path/you/added/submodule/to\n  url = https://github.com/zephinzer/version-tagging-scripts\n```\n\nWe use this script with GitLab by installing this repository as a `git` submodule.\nIn a `build` phase in your `scripts` property, add the following:\n\n```yaml\n...\n  stage: build\n...\n  artifacts:\n    path:\n      - ./path/you/added/submodule/to\n...\n  scripts:\n    - git submodule deinit -f .\n    - git submodule init\n    - git submodule update --init\n    - git submodule sync\n    - ...\n...\n```\n\nNote that using the `ssh://` version for this repo when adding the submodule **WILL NOT WORK**\nand will corrupt whichever runner it runs on.\n\nIncase you corrupt a runner, you'll need to access the directory containing your \nproject builds and manually run `deinit` and change the `.gitmodules` file to direct it\nto the HTTPS version of this repository. Main symptom of a corrupt runner will be during\nthe fetch/clone phase of a job, you'll see some lines that look like:\n\n```\nFetching changes...\nfatal: [../]+.git/modules/[./path/you/added/submodule/to] is not a git repository\n```\n\nOr something to that effect. No tests have been run, `before_script` has not run either.\n\n\n\n# Play With It\n\n\n\nThe `./utils` directory contains some tools to get you started on how this works.\n\n\n## Setup Branches\n\n\nRun the following to set up a traditional CI pipeline consisting of\n`dev`, `ci`, `qa`, `uat`, `staging` and `production` branches/environments:\n\n```bash\n#\u003e ./utils/branch_setup\n```\n\nYou should find yourself on the `_dev` branch. They will be prefixed with an underscore\nincase you forget that they are just test example environments.\n\n\n## Setup Pipeline\n\n\nRun the following to add commits to the relevant branches:\n\n```bash\n#\u003e ./utils/pipeline_setup\n```\n\nThis will add commits to the environments that simulate an actual pipeline with\n`_production` having only 1 commit and `_dev` having all 6 commits (1 for each\nenvironment/branch).\n\n\n## Play With It\n\n\nRun `./iterate -q -i` on the `_dev` branch (which you should be on). This will initialize\nthe versioning in _dev. Check out the versions available with:\n\n```bash\n#\u003e git tag -l --merged\n```\n\nThere should be `0.0.0` and `0.0.1`. Great.\n\nNow checkout the `_ci` branch and check the branch for tags with:\n\n```bash\n#\u003e git tag -l --merged\n```\n\nThere should be no tags. Now do a rebase from the `_dev` branch into your `_ci` branch:\n\n```bash\n#\u003e git rebase _dev\n```\n\nRun the tag checking command again:\n\n```bash\n#\u003e git tag -l --merged\n```\n\nYou should now see `0.0.0` and `0.0.1` because the tags associated with the `HEAD`\ncommit in the `_dev` branch should have been played to `_ci` and `_ci` now has the\ncommits from `_dev`. Verify this yourself with `git log -n 1`. Both should match.\n\n\n## Enough Games\n\n\nRun the following to revert all test/example branches:\n\n```bash\n#\u003e ./utils/branch_teardown\n```\n\n\n\n# Inspiration\n\n\n\nWe needed a standardised way to add versioning to our packages. The primary way we use it internally is in a GitLab environment.\n\n\n\n# Testing\n\n\n\nWe use Docker to test the code so that we can check if certain expected features are available.\n\nRun the tests using:\n\n```\n#\u003e ./test\n```\n\n\n\n# Supported Versions\n\n\n\n## Git\n\n- Git 1.8.5\n\n\n# Contributing\n\n\n\nFeel it's lacking something? Feel free to submit a Pull Request. Got it to work with\nanother CI software? Feel free to add to this readme's CI Software Integration Help\nsection.\n\nCheers!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fversion-tagging-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephinzer%2Fversion-tagging-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fversion-tagging-scripts/lists"}