Skip to content

Commit

Permalink
Added slack notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Meissner authored and Richard Meissner committed Sep 1, 2017
1 parent 24fa9c3 commit 7ac95de
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
37 changes: 21 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,33 @@ android:

- extra-android-m2repository

deploy:
provider: releases
api_key: "${GITHUB_API_KEY}"
file_glob: true
file: app/build/outputs/apk/*/*.apk
skip_cleanup: true
on:
tags: true
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache

before_script:
- chmod +x ./ci/prepare_env.sh
- chmod +x ./ci/build_debug.sh
- chmod +x ./ci/notify_slack.sh

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

script:
- ./ci/prepare_env.sh
- ./ci/build_debug.sh

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
deploy:
provider: releases
api_key: "${GITHUB_API_KEY}"
file_glob: true
file: app/build/outputs/apk/*/*.apk
skip_cleanup: true
on:
tags: true

after_deploy:
- ./ci/notify_slack.sh
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ android {
versionCode getInt("APP_VERSION_CODE", 1)
versionName getKey("APP_VERSION_NAME", "1.0")
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

vectorDrawables.useSupportLibrary = true

project.ext.set("archivesBaseName", String.format("gnosis_authenticator_%s", defaultConfig.versionCode))

javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation":
Expand Down
10 changes: 10 additions & 0 deletions ci/notify_slack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# fail if any commands fails
set -e

repo_url="$(git config --get remote.origin.url)"
release_path="/releases/tag/${TRAVIS_TAG}"
release_url="${repo_url/.git/$release_path}"
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"<${release_url}|Version ${APP_VERSION_NAME}> for ${TRAVIS_REPO_SLUG} is out!\"}" \
https://hooks.slack.com/services/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
4 changes: 2 additions & 2 deletions ci/prepare_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ set -e
# write your script here
export APP_VERSION_CODE=$TRAVIS_BUILD_NUMBER
# strip the first char as that should always be "v" (as tags should be in the format "vX.X.X")
# description="$(git describe --tags)"
export APP_VERSION_NAME=$TRAVIS_BUILD_NUMBER #${description:1}
description="$(git describe --tags)"
export APP_VERSION_NAME=${description:1}
export APP_RELEASE_NOTES=$TRAVIS_COMMIT_MESSAGE

0 comments on commit 7ac95de

Please sign in to comment.