Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Develop

Closes #169, #149, #151, #147, #127, #112, #117, #120, #118, and #115

See merge request pantau-group/Client/pantau-bersama-android!62
  • Loading branch information
edityomurti committed Jan 24, 2019
2 parents c7807ca + e4eea9c commit 87c2599
Show file tree
Hide file tree
Showing 984 changed files with 33,054 additions and 250 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/build
/captures
.externalNativeBuild
gradle.properties
*google-services.json

# Android Studio captures folder
captures/
Expand Down Expand Up @@ -33,6 +35,7 @@ captures/
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
.idea/codeStyles/codeStyleConfig.xml
*.iml

# OS-specific files
Expand All @@ -42,4 +45,7 @@ captures/
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
Thumbs.db
pantau_bersama.keystore
app/production/
app/release/
183 changes: 168 additions & 15 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,199 @@ image: azabost/android-sdk-28:latest

stages:
- build
- quality
- package

before_script:
- export ANDROID_HOME="/home/gitlab-runner/android-sdk"
- export GRADLE_USER_HOME=$(pwd)/.gradle
- export ANDROID_APK_PATH=$PWD/app/build/outputs/apk

#### BUILD ####

.build_template: &build_template_def
stage: build
artifacts:
expire_in: 2 weeks
paths:
- app/build/outputs/
- .android/
- app/build/outputs/
- .android/

build_debug:
build_onprogress:
<<: *build_template_def
stage: build
only:
# - develop
- schedules
- web
except:
- develop
- master
script:
- ./gradlew assembleDebug
- echo "org.gradle.jvmargs=-Xmx1536m" >> gradle.properties
- echo "SYMBOLIC_REDIRECT_URI=$SYMBOLIC_REDIRECT_URI_STAG" >> gradle.properties
- echo "PANTAU_BASE_URL=$PANTAU_BASE_URL_STAG" >> gradle.properties
- echo "PANTAU_BASE_URL_NO_SCHEME=$PANTAU_BASE_URL_NO_SCHEME_STAG" >> gradle.properties
- echo "PANTAU_OAUTH_URL=$PANTAU_OAUTH_URL_STAG" >> gradle.properties
- echo "WORD_STADIUM_BASE_URL=$WORD_STADIUM_BASE_URL_STAG" >> gradle.properties
- echo "SYMBOLIC_URL=$SYMBOLIC_URL_STAG" >> gradle.properties
- echo "SYMBOLIC_URL_NO_SCHEME=$SYMBOLIC_URL_NO_SCHEME_STAG" >> gradle.properties
- echo "SYMBOLIC_CLIENT_ID=$SYMBOLIC_CLIENT_ID_STAG" >> gradle.properties
- echo "SYMBOLIC_CLIENT_SECRET=$SYMBOLIC_CLIENT_SECRET_STAG" >> gradle.properties
- echo "FACEBOOK_APP_ID=$FACEBOOK_APP_ID_STAG" >> gradle.properties
- echo "FACEBOOK_LOGIN_PROTOCOL_SCHEME=$FACEBOOK_LOGIN_PROTOCOL_SCHEME_STAG" >> gradle.properties
- echo "TWITTER_API_KEY=$TWITTER_API_KEY_STAG" >> gradle.properties
- echo "TWITTER_SECRET=$TWITTER_SECRET_STAG" >> gradle.properties
- echo "PANTAU_CLIENT_ID=$PANTAU_CLIENT_ID_STAG" >> gradle.properties
- echo "PANTAU_CLIENT_SECRET=$PANTAU_CLIENT_SECRET_STAG" >> gradle.properties
- echo "android.useAndroidX=true" >> gradle.properties
- echo "android.enableJetifier=true" >> gradle.properties
- ./gradlew assembleStagingDebug

build_staging:
<<: *build_template_def
stage: build
only:
# - develop
- schedules
- develop
# - schedules
- web
except:
- onprogress
- master
script:
- ./gradlew assembleStaging
- "curl --request POST --header \"Content-Type: multipart/form-data;\" --form \"token=$SLACK_TOKEN\" --form \"channels=$SLACK_CHANNELS\" --form \"content=$SLACK_CONTENT\" --form \"file=@$CI_PROJECT_DIR/$APK_PATH\" --form \"title=$SLACK_TITLE : $CI_COMMIT_REF_SLUG || $CI_COMMIT_SHA\" https://slack.com/api/files.upload"
- echo "org.gradle.jvmargs=-Xmx1536m" >> gradle.properties
- echo "SYMBOLIC_REDIRECT_URI=$SYMBOLIC_REDIRECT_URI_STAG" >> gradle.properties
- echo "PANTAU_BASE_URL=$PANTAU_BASE_URL_STAG" >> gradle.properties
- echo "PANTAU_BASE_URL_NO_SCHEME=$PANTAU_BASE_URL_NO_SCHEME_STAG" >> gradle.properties
- echo "PANTAU_OAUTH_URL=$PANTAU_OAUTH_URL_STAG" >> gradle.properties
- echo "WORD_STADIUM_BASE_URL=$WORD_STADIUM_BASE_URL_STAG" >> gradle.properties
- echo "SYMBOLIC_URL=$SYMBOLIC_URL_STAG" >> gradle.properties
- echo "SYMBOLIC_URL_NO_SCHEME=$SYMBOLIC_URL_NO_SCHEME_STAG" >> gradle.properties
- echo "SYMBOLIC_CLIENT_ID=$SYMBOLIC_CLIENT_ID_STAG" >> gradle.properties
- echo "SYMBOLIC_CLIENT_SECRET=$SYMBOLIC_CLIENT_SECRET_STAG" >> gradle.properties
- echo "FACEBOOK_APP_ID=$FACEBOOK_APP_ID_STAG" >> gradle.properties
- echo "FACEBOOK_LOGIN_PROTOCOL_SCHEME=$FACEBOOK_LOGIN_PROTOCOL_SCHEME_STAG" >> gradle.properties
- echo "TWITTER_API_KEY=$TWITTER_API_KEY_STAG" >> gradle.properties
- echo "TWITTER_SECRET=$TWITTER_SECRET_STAG" >> gradle.properties
- echo "PANTAU_CLIENT_ID=$PANTAU_CLIENT_ID_STAG" >> gradle.properties
- echo "PANTAU_CLIENT_SECRET=$PANTAU_CLIENT_SECRET_STAG" >> gradle.properties
- echo "android.useAndroidX=true" >> gradle.properties
- echo "android.enableJetifier=true" >> gradle.properties
- ./gradlew assembleStagingDebug

build_production:

build_release:
<<: *build_template_def
stage: build
only:
- master
# - schedules
- web
except:
- onprogress
- develop
script:
- echo "org.gradle.jvmargs=-Xmx1536m" >> gradle.properties
- echo "SYMBOLIC_REDIRECT_URI=$SYMBOLIC_REDIRECT_URI_PROD" >> gradle.properties
- echo "PANTAU_BASE_URL=$PANTAU_BASE_URL_PROD" >> gradle.properties
- echo "PANTAU_BASE_URL_NO_SCHEME=$PANTAU_BASE_URL_NO_SCHEME_PROD" >> gradle.properties
- echo "PANTAU_OAUTH_URL=$PANTAU_OAUTH_URL_PROD" >> gradle.properties
- echo "WORD_STADIUM_BASE_URL=$WORD_STADIUM_BASE_URL_PROD" >> gradle.properties
- echo "SYMBOLIC_URL=$SYMBOLIC_URL_PROD" >> gradle.properties
- echo "SYMBOLIC_URL_NO_SCHEME=$SYMBOLIC_URL_NO_SCHEME_PROD" >> gradle.properties
- echo "SYMBOLIC_CLIENT_ID=$SYMBOLIC_CLIENT_ID_PROD" >> gradle.properties
- echo "SYMBOLIC_CLIENT_SECRET=$SYMBOLIC_CLIENT_SECRET_PROD" >> gradle.properties
- echo "FACEBOOK_APP_ID=$FACEBOOK_APP_ID_PROD" >> gradle.properties
- echo "FACEBOOK_LOGIN_PROTOCOL_SCHEME=$FACEBOOK_LOGIN_PROTOCOL_SCHEME_PROD" >> gradle.properties
- echo "TWITTER_API_KEY=$TWITTER_API_KEY_PROD" >> gradle.properties
- echo "TWITTER_SECRET=$TWITTER_SECRET_PROD" >> gradle.properties
- echo "PANTAU_CLIENT_ID=$PANTAU_CLIENT_ID_PROD" >> gradle.properties
- echo "PANTAU_CLIENT_SECRET=$PANTAU_CLIENT_SECRET_PROD" >> gradle.properties
- echo "android.useAndroidX=true" >> gradle.properties
- echo "android.enableJetifier=true" >> gradle.properties
- ./gradlew assembleProductionRelease




#### QUALITY ####

quality_check:
stage: quality
only:
- master
- develop

script:
- echo "org.gradle.jvmargs=-Xmx1536m" >> gradle.properties
- echo "SYMBOLIC_REDIRECT_URI=$SYMBOLIC_REDIRECT_URI_PROD" >> gradle.properties
- echo "PANTAU_BASE_URL=$PANTAU_BASE_URL_PROD" >> gradle.properties
- echo "PANTAU_BASE_URL_NO_SCHEME=$PANTAU_BASE_URL_NO_SCHEME_PROD" >> gradle.properties
- echo "PANTAU_OAUTH_URL=$PANTAU_OAUTH_URL_PROD" >> gradle.properties
- echo "WORD_STADIUM_BASE_URL=$WORD_STADIUM_BASE_URL_PROD" >> gradle.properties
- echo "SYMBOLIC_URL=$SYMBOLIC_URL_PROD" >> gradle.properties
- echo "SYMBOLIC_URL_NO_SCHEME=$SYMBOLIC_URL_NO_SCHEME_PROD" >> gradle.properties
- echo "SYMBOLIC_CLIENT_ID=$SYMBOLIC_CLIENT_ID_PROD" >> gradle.properties
- echo "SYMBOLIC_CLIENT_SECRET=$SYMBOLIC_CLIENT_SECRET_PROD" >> gradle.properties
- echo "FACEBOOK_APP_ID=$FACEBOOK_APP_ID_PROD" >> gradle.properties
- echo "FACEBOOK_LOGIN_PROTOCOL_SCHEME=$FACEBOOK_LOGIN_PROTOCOL_SCHEME_PROD" >> gradle.properties
- echo "TWITTER_API_KEY=$TWITTER_API_KEY_PROD" >> gradle.properties
- echo "TWITTER_SECRET=$TWITTER_SECRET_PROD" >> gradle.properties
- echo "PANTAU_CLIENT_ID=$PANTAU_CLIENT_ID_PROD" >> gradle.properties
- echo "PANTAU_CLIENT_SECRET=$PANTAU_CLIENT_SECRET_PROD" >> gradle.properties
- echo "android.useAndroidX=true" >> gradle.properties
- echo "android.enableJetifier=true" >> gradle.properties
- ./gradlew ktlint

artifacts:
paths:
- app/build/outputs/
- .android/
name: "reports_${CI_PROJECT_NAME}_${CI_BUILD_REF_NAME}"
when: on_failure
expire_in: 4 days
paths:
- app/build/reports/

#### PACKAGE ####

.package_template: &package_template_def
before_script:
- mkdir -p deliverables
- touch ./deliverables/info.txt
- echo "Build date $(date)" >> ./deliverables/info.txt
- echo "Git branch ${CI_COMMIT_REF_NAME}" >> ./deliverables/info.txt
- echo "Git commit ${CI_COMMIT_SHA}" >> ./deliverables/info.txt
- echo "Gitlab pipeline ${CI_PIPELINE_ID}" >> ./deliverables/info.txt
- export ANDROID_APK_PATH=$PWD/app/build/outputs/apk

package_onprogress:
<<: *package_template_def
stage: package
environment: Development
only:
- schedules
- web
script:
- mv $ANDROID_APK_PATH/staging/debug/app-staging-debug*.apk $ANDROID_APK_PATH/staging/debug/app-onprogress-${CI_COMMIT_SHA}.apk
- curl -F file=@$ANDROID_APK_PATH/staging/debug/app-onprogress-${CI_COMMIT_SHA}.apk -F channels=$SLACK_CHANNEL_ANDROID -F token=$SLACK_TOKEN https://slack.com/api/files.upload
- curl -F file=@$ANDROID_APK_PATH/staging/debug/app-onprogress-${CI_COMMIT_SHA}.apk -F channels=$SLACK_CHANNEL_LAPORAN_BUG -F token=$SLACK_TOKEN https://slack.com/api/files.upload

package_staging:
<<: *package_template_def
stage: package
environment: Development
only:
- develop
script:
- mv $ANDROID_APK_PATH/staging/debug/app-staging-debug*.apk $ANDROID_APK_PATH/staging/debug/app-staging-${CI_COMMIT_SHA}.apk
- curl -F file=@$ANDROID_APK_PATH/staging/debug/app-staging-${CI_COMMIT_SHA}.apk -F channels=$SLACK_CHANNEL_ANDROID -F token=$SLACK_TOKEN https://slack.com/api/files.upload
- curl -F file=@$ANDROID_APK_PATH/staging/debug/app-staging-${CI_COMMIT_SHA}.apk -F channels=$SLACK_CHANNEL_LAPORAN_BUG -F token=$SLACK_TOKEN https://slack.com/api/files.upload


package_release:
<<: *package_template_def
stage: package
environment: Release
only:
- master
script:
- ./gradlew assembleProduction
- "curl --request POST --header \"Content-Type: multipart/form-data;\" --form \"token=$SLACK_TOKEN\" --form \"channels=$SLACK_CHANNELS\" --form \"content=$SLACK_CONTENT_PRODUCTION\" --form \"file=@$CI_PROJECT_DIR/$APK_PATH_PRODUCTION\" --form \"title=$SLACK_TITLE_PRODUCTION : $CI_COMMIT_REF_SLUG || $CI_COMMIT_SHA\" https://slack.com/api/files.upload"
- mv $ANDROID_APK_PATH/production/release/app-production-release*.apk $ANDROID_APK_PATH/production/release/app-production-${CI_COMMIT_SHA}.apk
- curl -F file=@$ANDROID_APK_PATH/production/release/app-production-${CI_COMMIT_SHA}.apk -F channels=$SLACK_CHANNEL_ANDROID -F token=$SLACK_TOKEN https://slack.com/api/files.upload
- curl -F file=@$ANDROID_APK_PATH/production/release/app-production-${CI_COMMIT_SHA}.apk -F channels=$SLACK_CHANNEL_LAPORAN_BUG -F token=$SLACK_TOKEN https://slack.com/api/files.upload
7 changes: 0 additions & 7 deletions .idea/fileTemplates/Gradle Kotlin DSL Build Script.gradle

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/fileTemplates/Gradle Kotlin DSL Settings.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/fileTemplates/includes/File Header.java

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions .idea/navEditor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

### Configuration

* Versioning in [app-version.gradle](config/app-version.gradle)
* Versioning in [app-version.gradle](config/app-version.gradle)[versioning-reference](https://medium.com/@maxirosson/versioning-android-apps-d6ec171cfd82)
* Dependencies management in [dependencies.gradle](config/dependencies.gradle)

### Code Style

You can check code style using `./gradlew check` and you get the report in report directory inside `build` directory.
You can check code style using [`./gradlew ktlint`](https://ktlint.github.io/).

### Branching

* **master** -> for release app
* **develop** -> for next-release built
* **onprogress** -> for development
* **onprogress/feature** -> for feature branch in development
* **onprogress/feature/<feature_name>** -> for feature branch in development

### Ask to

* [ali](@mustofa.ali)
* [edityo](@edityomurti)
* [edityo](@edityomurti)
* [untung](@untungs)
* [yazid](@yazid)
Loading

0 comments on commit 87c2599

Please sign in to comment.