Skip to content

Commit

Permalink
AC-616: Encrypt play store files earlier, disable publishing on debug…
Browse files Browse the repository at this point in the history
… builds (#602)
  • Loading branch information
f4ww4z committed Jun 4, 2019
1 parent 82c22ef commit dd72f26
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ jdk: oraclejdk8
dist: trusty

before_install:
- yes | sdkmanager "platform-tools" "tools" "platforms;android-27" "extras;android;m2repository"
- yes | sdkmanager "platform-tools" "tools" "platforms;android-27"
"extras;android;m2repository"
- chmod +x load_files.sh
- chmod +x build.sh
- ./load_files.sh

script:
- ./build.sh
- ./gradlew jacocoTestReport
- ./build.sh
- ./gradlew jacocoTestReport

after_success:
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -s https://codecov.io/bash)

deploy:
provider: releases
Expand Down
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ set -e

chmod +x gradlew

echo "Running tests..."
./gradlew test

if [ -n "$TRAVIS_TAG" ]; then

echo "Building relase apk for Github and Play Store..."
echo $KEYSTORE_GPG_PASSPHRASE | gpg --passphrase-fd 0 release.keystore.gpg
echo $KEYSTORE_GPG_PASSPHRASE | gpg --passphrase-fd 0 google_play.json.gpg
if [[ -n "$TRAVIS_TAG" ]]; then

echo "Tagged build: building release..."
./gradlew build assembleRelease
echo "Publishing release to the Play store..."
./gradlew publishRelease

else

echo "Debug build: building..."
./gradlew assembleDebug lint

fi
fi
14 changes: 14 additions & 0 deletions load_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# Decrypt GitHub release and Play Store files on a new release

set -e

if [[ -n "$TRAVIS_TAG" ]]; then

echo "Decrypting keystore..."
echo $KEYSTORE_GPG_PASSPHRASE | gpg --passphrase-fd 0 release.keystore.gpg
echo "Decrypting service account credentials..."
echo $KEYSTORE_GPG_PASSPHRASE | gpg --passphrase-fd 0 google_play.json.gpg

fi
2 changes: 2 additions & 0 deletions openmrs-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ dependencies {
}

play {
enabled = rootProject.file('google_play.json').exists()

if (version.contains("alpha")) {
track = 'alpha'
} else if (version.contains("beta")) {
Expand Down

0 comments on commit dd72f26

Please sign in to comment.