chore(build): docker build uses the current git directory as the npm package

This means we can build and test local changes, not just the latest published version.

Fixes #114 and merges #118.
pull/121/head
Oliver Dain 6 years ago committed by Romain
parent 37ea6c6ba3
commit 3ec009e6c8

@ -33,7 +33,7 @@ jobs:
script:
- DOCKER_IMAGE="thumbsupgallery/thumbsup"
- docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
- docker build -f Dockerfile.release -t "${DOCKER_IMAGE}:${TRAVIS_TAG}" --build-arg "PACKAGE_VERSION=${TRAVIS_TAG}" .
- docker build -f Dockerfile.release -t "${DOCKER_IMAGE}:${TRAVIS_TAG}" .
- docker tag "${DOCKER_IMAGE}:${TRAVIS_TAG}" "${DOCKER_IMAGE}:latest"
- docker push "${DOCKER_IMAGE}:${TRAVIS_TAG}"
- docker push "${DOCKER_IMAGE}:latest"

@ -6,13 +6,8 @@ FROM thumbsupgallery/build:alpine as build
# Install thumbsup locally
WORKDIR /thumbsup
ARG PACKAGE_VERSION
RUN if [ -z "${PACKAGE_VERSION}" ]; then \
echo "Please specify --build-arg PACKAGE_VERSION=<2.4.1>"; \
exit 1; \
fi;
RUN echo "Installing thumbsup@${PACKAGE_VERSION}"
RUN npm install thumbsup@${PACKAGE_VERSION}
COPY . /thumbsup_repo
RUN npm install --production "git+file:///thumbsup_repo" && rm -rf /thumbsup_repo
# ------------------------------------------------
# Runtime image

Loading…
Cancel
Save