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
I would argue the easiest way to retrieve version
from your package.json
is to use node itself.
build:
stage: build
script:
- export VERSION=$(node -p "require('./package.json').version")
- export CONTAINER_RELEASE_IMAGE=$CI_REGISTRY_IMAGE:$VERSION
- cd /opt/core/bundle && docker build -t $CONTAINER_RELEASE_IMAGE .
- docker push $CONTAINER_RELEASE_IMAGE