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
If you are not against installing additional packages you can use jq
which allows for much more flexibility (available in repository for both Ubuntu and Alpine).
Once you install it (for example apt-get update && apt-get install -yqq jq
on Ubuntu):
- export VERSION=$(cat package.json | jq -r .version)
- cd /opt/core/bundle && docker build -t $CI_REGISTRY_IMAGE:$VERSION .
- docker push $CI_REGISTRY_IMAGE:$VERSION