Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#!/bin/bash

echo "$DOCKER_PASSWORD" | docker login -u $DOCKER_USERNAME --password-stdin

if [ ! -z "${TRAVIS_TAG}" ]; then
    docker tag edxops/MY_REPO:latest edxops/MY_REPO:${TRAVIS_TAG}
	docker push edxops/MY_REPO:${TRAVIS_TAG}
fi

docker push edxops/MY_REPO:latest

...

Code Block
  - provider: script
    on:
      branch: master
      tags: true
    script: DOCKER_USERNAME=$DOCKER_USERNAME DOCKER_PASSWORD=$DOCKER_PASSWORD TRAVIS_TAG=$TRAVIS_TAG bash .travis/docker_push

If you need help configuring it for multiple providers look at the syntax here:
https://docs.travis-ci.com/user/deployment#deploying-to-multiple-providersSee:  How to automate Docker Hub publishing