#!/bin/bash# Publishes the latest snapshot to Sonatype. Works only for SNAPSHOT versions.# Based closely on material from# http://benlimmer.com/2014/01/04/automatically-publish-to-sonatype-with-gradle-and-travis-ci.if["$TRAVIS_REPO_SLUG"=="bumptech/glide"]&&["$TRAVIS_PULL_REQUEST"=="false"]&&["$TRAVIS_BRANCH"=="3.0a"];then if[[$(./gradlew -q getVersion)!=*SNAPSHOT*]];thenecho'Travis can only publish snapshots.'return 0fiecho-e"Starting publish to Sonatype...\n" ./gradlew uploadArchives -PnexusUsername="${NEXUS_USERNAME}"-PnexusPassword="${NEXUS_PASSWORD}"RETVAL=$?if[$RETVAL-eq 0 ];thenecho'Completed publish!'elseecho'Publish failed.'return 1fielseecho'Skipping Sonatype push'fi