Created
April 4, 2022 00:04
-
-
Save damiancipolat/f526cdcb32190eaa576a2dd1080bd430 to your computer and use it in GitHub Desktop.
Docker tagger using package.json version field.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Extract project field name package.json | |
export PACKAGE_NAME="$(cat package.json | grep name | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')" | |
#Extract version field from package.json | |
export PACKAGE_VERSION="$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')" | |
#Set the package tag name | |
export PACKAGE_TAG="$(echo ${PACKAGE_NAME}:${PACKAGE_VERSION} | tr -d ' ')" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment