-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·47 lines (42 loc) · 1.82 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
EXPECTED_TRAVIS_REPO_SLUG="code-schreiber/QuickCode"
EXPECTED_TRAVIS_BRANCH="master"
# Script should bail on first error
set -e
echo "Running deploy.sh"
echo "deploy.sh: TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "deploy.sh: TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG"
echo "deploy.sh: TRAVIS_TAG: $TRAVIS_TAG"
echo "deploy.sh: TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
cd QuickCode
echo "deploy.sh: Running gradle build"
./gradlew build
#echo "deploy.sh: Running gradle sonarqube"
#./gradlew sonarqube
echo "deploy.sh: mobile/build/outputs/apk/release now contains:"
ls -l mobile/build/outputs/apk/release
echo "deploy.sh: Running gradle printStatsFromThisVersion"
./gradlew printStatsFromThisVersion
echo "deploy.sh: Running gradle printVersion"
./gradlew printVersion
if [ "$TRAVIS_REPO_SLUG" != "$EXPECTED_TRAVIS_REPO_SLUG" ]; then
echo "deploy.sh: Skipping deployment: wrong repository. Expected '$EXPECTED_TRAVIS_REPO_SLUG' but was '$TRAVIS_REPO_SLUG'."
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "deploy.sh: Skipping deployment: was pull request."
elif [ "$TRAVIS_BRANCH" != "$EXPECTED_TRAVIS_BRANCH" ]; then
echo "deploy.sh: Skipping deployment: wrong branch. Expected '$EXPECTED_TRAVIS_BRANCH' but was '$TRAVIS_BRANCH'."
else
echo "deploy.sh: Deploying to Google Play"
echo "deploy.sh: Running gradle firebaseUploadReleaseProguardMapping"
./gradlew firebaseUploadReleaseProguardMapping
cd ..
echo "deploy.sh: Running fastlane supply"
fastlane supply --version
fastlane supply run --json_key dev-console-api-private-key.json --package_name com.toolslab.quickcode --apk QuickCode/mobile/build/outputs/apk/release/mobile-release.apk --track alpha
echo "deploy.sh: Deployed to Google Play"
cd QuickCode
./gradlew printVersion
echo "Thank you, come again."
exit $?
fi
echo "Exiting deploy.sh, skipping deployment"