Sign inSign up

perteghella/bump

By perteghella

Updated over 3 years ago

linux/arm and linux/amd version of https://github.com/treeder/bump

Image
0

435

perteghella/bump repository overview

This is the multiplatform build (linux/arm and linux/amd) version of https://github.com/treeder/bump

Bump

Bumps version files and other handy version tools.

Usage

docker run --rm -it -v $PWD:/app -w /app perteghella/bump [--filename FILENAME] [--input STRING] [CMD]

You must pass in either --filename or --input.

If using --filename, it will overwrite the file with the new version in place, great for automation.

If using --input, it will write the new version to STDOUT so you can pipe that in or use it in your scripts as a variable.

Use --index flag to specify which found versions it should replace. 0 is first one, 2 is second one, -1 is last one, etc.

CMD is optional and can be one of:

  • patch - default
  • minor
  • major

To pull the command out of your last git commit, you can add [bump major] or [bump minor] to your git commit message, then use:

docker run --rm -it -v $PWD:/app -w /app perteghella/bump --filename $version_file "$(git log -1 --pretty=%B)"

Bump a Git Version

The gitbump.sh script will automatically bump your git tags. It will get the most recent version, bump it, then push the new tag.

NOTE: Ensure at least one version tag exists in the repo, eg: v0.0.0 must already exist.

Or just run this if you don't want to download the script:

wget -O - https://raw.githubusercontent.com/treeder/bump/master/gitbump.sh | bash

GitHub Action to bump version


  
name: Bump version

on:
  push:
    branches: 
    - main
jobs:
  build-and-deploy:    
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Bump version
      run: |
        git config --global user.email "[email protected]"
        git config --global user.name "Actions"
        git fetch --tags
        wget -O - https://raw.githubusercontent.com/treeder/bump/master/gitbump.sh | bash

Extra Features

extract

Extracts version from a string, eg:

version=$(docker run --rm -v "$PWD":/app perteghella/bump  --extract --input "`docker -v`")
replace

Replace a version string with a version you provide.

docker run --rm -v "$PWD":/app treeder/bump  --filename VERSION --replace 1.2.3
format

Formats a version string, eg:

docker run --rm -v "$PWD":/app perteghella/bump  --extract --input "`docker -v`" --format M.m

Run docker run --rm -it -v $PWD:/app -w /app perteghella/bump --help for more help.

Tag summary

Content type

Image

Digest

sha256:5e20c5ab9

Size

6.4 MB

Last updated

over 3 years ago

docker pull perteghella/bump