Created
February 9, 2019 22:29
-
-
Save davidemoro/39e09baba101657dcf0a90578c68e0f9 to your computer and use it in GitHub Desktop.
docker push travis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo: required | |
services: | |
- docker | |
- ... | |
env: | |
global: | |
- IMAGE_NAME=davidemoro/pytest-play | |
- secure: ... | |
before_script: | |
- ... | |
script: | |
- travis_wait docker pull python:3.7 | |
- travis_wait docker pull "$IMAGE_NAME:latest" | |
- travis_wait 25 docker build --cache-from "$IMAGE_NAME:latest" -t "$IMAGE_NAME" . | |
- docker run -i --rm -v $(pwd)/tests:/src --network host -v /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock $IMAGE_NAME --splinter-webdriver=remote | |
--splinter-remote-url=$REMOTE_URL | |
deploy: | |
provider: script | |
script: bash docker_push | |
on: | |
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | |
docker tag "$IMAGE_NAME" "$IMAGE_NAME:$TRAVIS_COMMIT" | |
docker tag "$IMAGE_NAME" "$IMAGE_NAME:latest" | |
docker push "$IMAGE_NAME":"$TRAVIS_COMMIT" | |
docker push "$IMAGE_NAME":latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment