I\'m using gitLab CI for my nodejs application. In my YML file I need to call a script to build a docker image. But instead of using latest
I need to use the curren
variables:
PACKAGE_VERSION: $(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') `
in your job or template
.package-template: &package_template
image: docker-hub.registry.integ.fr.auchan.com/docker:latest
stage: package
tags:
- stocks
script:
- export VERSION= ``eval $PACKAGE_VERSION``
- echo "======> Getting VERSION: $VERSION" `