diff --git a/.travis.yml b/.travis.yml index 3a4fe6e..c617b98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,14 @@ node_js: # Build the app and a docker image script: - npm run build -- ./scripts/docker-build.sh +- docker build -t ${TRAVIS_COMMIT} --build-arg KILLRVIDEO_YOUTUBE_API_KEY=$KILLRVIDEO_YOUTUBE_API_KEY . # If successful, see if we need to publish also after_success: -- ./scripts/travis-publish.sh +- test -z $TRAVIS_TAG && travis_terminate 0 +- docker tag ${TRAVIS_COMMIT} killrvideo/killrvideo-generator:${TRAVIS_TAG} +- docker login -u $DOCKER_USER -p $DOCKER_PASS +- docker push killrvideo/killrvideo-generator:${TRAVIS_TAG} # Sudo required for doing docker build sudo: required diff --git a/scripts/travis-publish.sh b/scripts/travis-publish.sh deleted file mode 100755 index f8a5b39..0000000 --- a/scripts/travis-publish.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e # Exit with nonzero exit code if anything fails - -# If a pull request -if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo "Skipping publish for pull request" - exit 0 -fi - -# Invoke the publish script -MY_PATH="`dirname \"$0\"`" -( exec "$MY_PATH/docker-publish.sh" ) \ No newline at end of file