diff --git a/.travis.yml b/.travis.yml index 1353e289..07b192af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ jobs: - stage: deploy python: '3.6' script: ./.travis/deploy.sh - if: type != pull_request AND branch IN (dev, master) + if: type != pull_request AND (branch IN (dev, master) OR tag IS present) addons: apt: sources: diff --git a/.travis/deploy.sh b/.travis/deploy.sh index ff8eb970..7571f507 100755 --- a/.travis/deploy.sh +++ b/.travis/deploy.sh @@ -2,11 +2,19 @@ set -e +if [ "$TRAVIS_PULL_REQUEST" == "true" ]; then + echo "We should not deploy pull requests!" + exit 1 +fi + +if [ -z "$TRAVIS_TAG" ]; then + DOCKER_IMAGE_TAG=$(if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo "$TRAVIS_BRANCH-latest"; fi) +else + DOCKER_IMAGE_TAG="$TRAVIS_TAG" +fi + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) -DOCKER_IMAGE_TAG=$(if [ "$BRANCH" == "master" ]; then echo "latest"; else echo "$BRANCH-latest"; fi) -export BRANCH export DOCKER_IMAGE_TAG export DOCKER_CLI_EXPERIMENTAL=enabled diff --git a/setup.py b/setup.py index 02661ee0..89f4823f 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name="paradox-alarm-interface", - version="0.1", + version="1.0.0", author="João Paulo Barraca", author_email="jpbarraca@gmail.com", description="Interface to Paradox Alarm Panels",