Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »



Make a script at .travis/docker_push:



#!/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



In the travis UI, set the travis environment variables for DOCKER_USERNAME and DOCKER_PASSWORD
You cannot encrypt these and put them in .travis.yml at the time of this writing, the travis 'script' provider fails and writes the encrypted password to the console.


Add the following provider to your .travis.yml

  - 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-providers

  • No labels