mirror of
https://github.com/thumbsup/thumbsup
synced 2024-11-15 18:12:46 +00:00
4c64251bf5
Travis deploy steps have to be a script file (not a list of steps).
Revert 3ec009e6
because “npm install git+file” actually reads from the local master branch, which
- doesn’t work on Travis since Travis checks out a detached head
- doesn’t work as expected locally, since you might have local changes or might be working from a different branch
For the time being it’s easier to simplify the Docker script and release a known published version.
21 lines
705 B
Bash
Executable File
21 lines
705 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
if [ -z "${TRAVIS_TAG}" ]; then
|
|
echo "This script releases a Docker image corresponding to the npm package version"
|
|
echo "It should only be run on Travis CI for tagged commits"
|
|
exit 1
|
|
fi
|
|
|
|
# Build the image
|
|
|
|
DOCKER_IMAGE="thumbsupgallery/thumbsup"
|
|
PACKAGE_VERSION="${TRAVIS_TAG//v}"
|
|
docker build -f Dockerfile.release -t "${DOCKER_IMAGE}:${PACKAGE_VERSION}" --build-arg "PACKAGE_VERSION=${PACKAGE_VERSION}" .
|
|
|
|
# Pushes both <thumbsup:x.y.z> and <thumbsup:latest>
|
|
|
|
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
|
|
docker tag "${DOCKER_IMAGE}:${PACKAGE_VERSION}" "${DOCKER_IMAGE}:latest"
|
|
docker push "${DOCKER_IMAGE}:${PACKAGE_VERSION}"
|
|
docker push "${DOCKER_IMAGE}:latest"
|