Created
January 19, 2020 21:55
-
-
Save markchristopherng/374d0342bd0941808056c68c5e64a55b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
echo "----- Build and Publish Snapshot -----" | |
chmod u+x gradlew | |
time1=$(date '+%s') | |
./gradlew --no-daemon --parallel \ | |
lintDebug lintKotlin detekt \ | |
-PrunScript=${bamboo_run_script} \ | |
-PreleaseKeystorePath=${bamboo_releaseKeystorePath} \ | |
-PreleaseKeystorePassword=${bamboo_releaseKeystorePassword} \ | |
-PreleaseKeyAlias=${bamboo_releaseKeyAlias} \ | |
-PreleaseKeyPassword=${bamboo_releaseKeyPassword} \ | |
-PbuildId=${bamboo_buildNumber} \ | |
-PbranchName=${bamboo_repository_branch_dname} \ | |
-Psnapshot=true \ | |
--stacktrace | |
time2=$(date '+%s') | |
./gradlew --no-daemon --parallel \ | |
assembleDebug \ | |
-PrunScript=${bamboo_run_script} \ | |
-PreleaseKeystorePath=${bamboo_releaseKeystorePath} \ | |
-PreleaseKeystorePassword=${bamboo_releaseKeystorePassword} \ | |
-PreleaseKeyAlias=${bamboo_releaseKeyAlias} \ | |
-PreleaseKeyPassword=${bamboo_releaseKeyPassword} \ | |
-PbuildId=${bamboo_buildNumber} \ | |
-PbranchName=${bamboo_repository_branch_name} \ | |
-Psnapshot=true \ | |
--stacktrace | |
time3=$(date '+%s') | |
./gradlew --no-daemon --parallel \ | |
--project-cache-dir /home/bamboo/.gradle/caches/default --build-cache \ | |
testDebugUnitTest \ | |
-PrunScript=${bamboo_run_script} \ | |
-PreleaseKeystorePath=${bamboo_releaseKeystorePath} \ | |
-PreleaseKeystorePassword=${bamboo_releaseKeystorePassword} \ | |
-PreleaseKeyAlias=${bamboo_releaseKeyAlias} \ | |
-PreleaseKeyPassword=${bamboo_releaseKeyPassword} \ | |
-PbuildId=${bamboo_buildNumber} \ | |
-PbranchName=${bamboo_repository_branch_name} \ | |
-Psnapshot=true \ | |
--stacktrace | |
time4=$(date '+%s') | |
echo "Finish All Test" | |
echo "=====================================" | |
echo " Prepare: $(( time2 - time1 )) seconds" | |
echo " assembleDebug: $(( time3 - time2 )) seconds" | |
echo " testDebugUnitTest: $(( time4 - time3 )) seconds" | |
echo "=====================================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment