Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (25 sloc) 919 Bytes
language: minimal
sudo: required
services:
- docker
env:
- IMAGE_NAME=instantbox/instantbox
script:
- docker pull "$IMAGE_NAME" || true
- docker build --cache-from "$IMAGE_NAME"
--build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
--build-arg VCS_REF="$TRAVIS_COMMIT"
-t "build/$IMAGE_NAME" -f ./Dockerfile .
- docker run -d -P --name temp "build/$IMAGE_NAME"
- docker rm -f temp || true
after_success:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD_SECURE";
docker tag "build/$IMAGE_NAME" "$IMAGE_NAME";
docker push "$IMAGE_NAME";
fi
- if [[ -n "$TRAVIS_TAG" ]]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD_SECURE";
docker tag "build/$IMAGENAME" "$IMAGENAME:$TRAVIS_TAG";
docker push "$IMAGE_NAME:$TRAVIS_TAG";
fi
You can’t perform that action at this time.