Skip to content

Instantly share code, notes, and snippets.

View zeroboo's full-sized avatar
👋
nice day ^_^

Tan Hung Pham zeroboo

👋
nice day ^_^
  • Ho Chi Minh city, Viet Nam
View GitHub Profile
@zeroboo
zeroboo / build-info.sh
Last active November 17, 2022 09:28
Bash script to get build info from environment: git, build machine, build user, build time...
#!/bin/bash
VERSION_FILE=$1
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_COMMIT=$(git rev-parse HEAD)
BUILD_TAG=$(<$VERSION_FILE)
BUILD_TIME=$(TZ="Asia/Ho_Chi_Minh" date '+%Y-%m-%d %H:%M:%S')
BUILD_MACHINE=$(hostname)
BUILD_USER=$USER
echo BUILD_TAG: $BUILD_TAG
@zeroboo
zeroboo / increase-version-file.sh
Last active November 17, 2022 07:37
Increase minor of a semantic version in a text file.
#!/bin/bash
#Increase version in a file
version_file="$1"
major=0
minor=0
build=0
version=$(<$version_file)
# replace \n with space
test-google-pubsub