Skip to content

Commit

Permalink
Add automatic deploy hooks to Travis config. (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zinnatullin authored Oct 15, 2017
1 parent 110335b commit a50b2f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ before_install:
- eval $ANDROID_SDK_INSTALL_COMPONENT '"extras;google;m2repository"'

script:
- sh ci.sh
- ./ci.sh

after_success:
- codecov

deploy:
- provider: script
script: ./ci.sh publish=true
skip_cleanup: true
on:
tags: true

notifications:
email:
recipients:
Expand Down
13 changes: 10 additions & 3 deletions ci.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
#!/bin/bash
set -e

# Please run it from root project directory
# You can run it from any directory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIR="$DIR"

pushd "$PROJECT_DIR"

# Pass "publish=true" as first argument to initiate release process.
SHOULD_PUBLISH_RELEASE="$1"

# For some reason test for annotation processor are failing on a regular CI setup.
# So we had to exclude test task for it from the main build process and execute it as a separate command.
./gradlew clean build checkstyle -PdisablePreDex -x :storio-sqlite-annotations-processor-test:test -x :storio-content-resolver-annotations-processor-test:test
./gradlew :storio-sqlite-annotations-processor-test:testDebugUnitTest
./gradlew :storio-content-resolver-annotations-processor-test:testDebugUnitTest

if git describe --exact-match --tags $(git log -n1 --pretty='%h') ; then
echo "Git tag detected, launching release process..."
if [ "$SHOULD_PUBLISH_RELEASE" == "publish=true" ]; then
echo "Launching release publishing process..."

if [ -z "$GPG_SECRET_KEYS" ]; then
echo "Put base64 encoded gpg secret key for signing into GPG_SECRET_KEYS env variable."
Expand Down

0 comments on commit a50b2f3

Please sign in to comment.