Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit b1f4c42

Browse files
committed
Add version label to docker images
Closes exoframejs/exoframe#274
1 parent 3fabb95 commit b1f4c42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ after_success:
2424
- docker login -u $HUB_USER -p $HUB_PASS
2525
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
2626
- export DEBUG_TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "debug_latest"; else echo "debug_$TRAVIS_BRANCH" ; fi`
27-
- docker build --pull -t exoframe/server:$TAG .
27+
- export VERSION=`node -pe "require('./package.json').version"`
28+
- docker build --pull -t --label "version=$VERSION" exoframe/server:$TAG .
2829
- if [ -z "$TRAVIS_TAG" ]; then echo "No tag, skipping"; else docker tag exoframe/server:$TAG exoframe/server:$TRAVIS_TAG; fi
2930
# build debug docker image
30-
- docker build --pull -f Dockerfile-debug -t exoframe/server:$DEBUG_TAG .
31+
- docker build --pull -f Dockerfile-debug --label "version=$VERSION" -t exoframe/server:$DEBUG_TAG .
3132
# push all images to registry
3233
- docker push exoframe/server
3334

0 commit comments

Comments
 (0)