mirror of
https://github.com/hmalik144/Driver.git
synced 2025-12-10 02:45:20 +00:00
Circleci branch deployment fix (#32)
- circleci Local testing - circleci deployment fixed - submodule circleci fix
This commit is contained in:
@@ -14,23 +14,22 @@ commands:
|
||||
description: checkout repo and android dependencies
|
||||
steps:
|
||||
- checkout
|
||||
# Setup files for build.
|
||||
- run:
|
||||
name: Setup subtree for test data
|
||||
name: Setup variables for build
|
||||
command: |
|
||||
git config --global user.email "$GIT_EMAIL"
|
||||
git config --global user.name "$GIT_EMAIL"
|
||||
git subtree add --prefix=driver_app_data https://github.com/hmalik144/driver_app_data main
|
||||
echo "$GOOGLE_SERVICES_KEY" > "app/google-services.json"
|
||||
- android/restore-gradle-cache
|
||||
build_gradle:
|
||||
description: Build the gradle
|
||||
steps:
|
||||
- android/restore-gradle-cache
|
||||
- run:
|
||||
name: Download Dependencies
|
||||
command: |
|
||||
sudo chmod +x ./gradlew
|
||||
./gradlew androidDependencies
|
||||
# Setup files for build.
|
||||
- run:
|
||||
name: Setup variables for build
|
||||
command: |
|
||||
echo "$GOOGLE_SERVICES_KEY" > "app/google-services.json"
|
||||
- android/save-gradle-cache
|
||||
run_tests:
|
||||
description: run non-instrumentation tests for flavour specified
|
||||
parameters:
|
||||
@@ -39,6 +38,7 @@ commands:
|
||||
default: "Driver"
|
||||
steps:
|
||||
# The next step will run the unit tests
|
||||
- build_gradle
|
||||
- run:
|
||||
name: Run non-instrumentation unit tests
|
||||
command: |
|
||||
@@ -56,6 +56,15 @@ commands:
|
||||
default: "AtlasWeather"
|
||||
steps:
|
||||
# Download and cache dependencies
|
||||
- build_gradle
|
||||
- run:
|
||||
name: Setup subtree for test data
|
||||
command: |
|
||||
git stash
|
||||
git config --global user.email "$GIT_EMAIL"
|
||||
git config --global user.name "$GIT_EMAIL"
|
||||
git remote add -f driver_app_data https://github.com/hmalik144/driver_app_data.git
|
||||
git subtree add --prefix=driver_app_data driver_app_data main --squash
|
||||
- restore_cache:
|
||||
keys:
|
||||
- emulator-cache-v1-
|
||||
@@ -105,6 +114,28 @@ commands:
|
||||
# Then publish the results of the Instrumentation tests!
|
||||
- store_test_results:
|
||||
path: app/build/outputs/androidTest-results/connected
|
||||
deploy_to_play_store:
|
||||
description: deploy to playstore based on flavour
|
||||
parameters:
|
||||
flavour:
|
||||
type: string
|
||||
default: "Driver"
|
||||
steps:
|
||||
# The next step will run the unit tests
|
||||
- android/decode-keystore:
|
||||
keystore-location: "./app/keystore.jks"
|
||||
- run:
|
||||
name: Setup playstore key
|
||||
command: |
|
||||
echo "$GOOGLE_PLAY_KEY" > "google-play-key.json"
|
||||
- build_gradle
|
||||
- run:
|
||||
name: Run fastlane command to deploy to playstore
|
||||
command: |
|
||||
pwd
|
||||
bundle exec fastlane deploy<< parameters.flavour >>
|
||||
- store_test_results:
|
||||
path: fastlane/report.xml
|
||||
# Define a job to be invoked later in a workflow.
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
||||
jobs:
|
||||
@@ -125,10 +156,24 @@ jobs:
|
||||
steps:
|
||||
# Checkout the code and its submodule as the first step.
|
||||
- setup_repo
|
||||
- run_tests:
|
||||
flavour: << parameters.flavour >>
|
||||
# - run_tests:
|
||||
# flavour: << parameters.flavour >>
|
||||
- run_ui_tests:
|
||||
flavour: << parameters.flavour >>
|
||||
deploy-to-playstore:
|
||||
parameters:
|
||||
flavour:
|
||||
type: string
|
||||
default: "Driver"
|
||||
docker:
|
||||
- image: cimg/android:2023.07-browsers
|
||||
auth:
|
||||
username: ${DOCKER_USERNAME}
|
||||
password: ${DOCKER_PASSWORD}
|
||||
steps:
|
||||
- setup_repo
|
||||
- deploy_to_play_store:
|
||||
flavour: << parameters.flavour >>
|
||||
# Invoke jobs via workflows
|
||||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
||||
workflows:
|
||||
@@ -136,30 +181,36 @@ workflows:
|
||||
build-release-driver:
|
||||
jobs:
|
||||
- build-and-test:
|
||||
context: appttude
|
||||
flavour: "Driver"
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- main_admin
|
||||
- deploy-to-playstore:
|
||||
context: appttude
|
||||
flavour: "Driver"
|
||||
- android/deploy-to-play-store:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main_driver
|
||||
requires:
|
||||
- build-and-test
|
||||
executor:
|
||||
name: android/android-machine
|
||||
tag: 2023.05.1
|
||||
lane-name: deployDriver
|
||||
build-release-admin:
|
||||
jobs:
|
||||
- build-and-test:
|
||||
context: appttude
|
||||
flavour: "Admin"
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- main_driver
|
||||
- deploy-to-playstore:
|
||||
context: appttude
|
||||
flavour: "Admin"
|
||||
- android/deploy-to-play-store:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main_driver
|
||||
- main_admin
|
||||
requires:
|
||||
- build-and-test
|
||||
executor:
|
||||
name: android/android-machine
|
||||
tag: 2023.05.1
|
||||
lane-name: deployAdmin
|
||||
- build-and-test
|
||||
@@ -10,6 +10,9 @@ def relStorePassword = System.getenv("RELEASE_STORE_PASSWORD")
|
||||
def relKeyPassword = System.getenv("RELEASE_KEY_PASSWORD")
|
||||
def relKeyAlias = System.getenv("RELEASE_KEY_ALIAS")
|
||||
|
||||
def keystorePath = System.getenv('PWD') + "/app/keystore.jks"
|
||||
def keystore = file(keystorePath).exists() ? file(keystorePath) : null
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
defaultConfig {
|
||||
@@ -40,7 +43,7 @@ android {
|
||||
storePassword relStorePassword
|
||||
keyPassword relKeyPassword
|
||||
keyAlias relKeyAlias
|
||||
storeFile file('./keystore')
|
||||
storeFile keystore
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
ci_local.sh
Normal file
2
ci_local.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
circleci config process .circleci/local_config.yml > process.yml
|
||||
circleci local execute -v $(pwd):/root/repo -c process.yml deploy-to-play-store-1 -e $GIT_EMAIL="h.malik144@gmail.com" -e BASE64_KEYSTORE=$BASE64_KEYSTORE -e RELEASE_KEYSTORE=$RELEASE_KEYSTORE -e RELEASE_STORE_PASSWORD=$RELEASE_STORE_PASSWORD -e RELEASE_KEY_PASSWORD=$RELEASE_KEY_PASSWORD -e RELEASE_KEY_ALIAS=$RELEASE_KEY_ALIAS -e DOCKER_USERNAME=$DOCKER_USERNAME -e DOCKER_PASSWORD=$DOCKER_PASSWORD -e DRIVER_GOOGLE_SERVICES_B64=$DRIVER_GOOGLE_SERVICES_B64
|
||||
@@ -32,13 +32,20 @@ platform :android do
|
||||
|
||||
desc "Deploy a new version of Driver to the Google Play"
|
||||
lane :deployDriver do
|
||||
gradle(task: "clean bundle", flavor: "driver", build_type: "Release")
|
||||
upload_to_play_store(aab: "app/build/outputs/bundle/driverRelease/app-driver-release.aab", json_key: "google-play-key.json", package_name: "h_mal.appttude.com.driver")
|
||||
gradle(
|
||||
task: "clean bundle",
|
||||
flavor: "Driver",
|
||||
build_type: "Release",
|
||||
)
|
||||
upload_to_play_store(
|
||||
aab: "app/build/outputs/bundle/driverRelease/app-driver-release.aab",
|
||||
json_key: "google-play-key.json",
|
||||
package_name: "h_mal.appttude.com.driver")
|
||||
end
|
||||
|
||||
desc "Deploy a new version of Admin to the Google Play"
|
||||
lane :deployAdmin do
|
||||
gradle(task: "clean bundle", flavor: "admin", build_type: "Release")
|
||||
gradle(task: "clean bundle", flavor: "Admin", build_type: "Release")
|
||||
upload_to_play_store(aab: "app/build/outputs/bundle/adminRelease/app-admin-release.aab", json_key: "google-play-key.json", package_name: "h_mal.appttude.com.driver.admin")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,12 +5,19 @@
|
||||
|
||||
|
||||
|
||||
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.002655">
|
||||
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000389544">
|
||||
|
||||
</testcase>
|
||||
|
||||
|
||||
<testcase classname="fastlane.lanes" name="1: clean bundleadminRelease" time="86.6186667">
|
||||
<testcase classname="fastlane.lanes" name="1: clean bundleDriverRelease" time="5.017797615">
|
||||
|
||||
</testcase>
|
||||
|
||||
|
||||
<testcase classname="fastlane.lanes" name="2: upload_to_play_store" time="21.58948528">
|
||||
|
||||
<failure message="/var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/actions/actions_helper.rb:67:in `execute_action' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:229:in `chdir' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing' Fastfile:40:in `block (2 levels) in parsing_binding' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/lane.rb:33:in `call' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:45:in `chdir' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/runner.rb:45:in `execute' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run' /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call' /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run' /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!' /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off' /var/lib/gems/3.0.0/gems/fastlane-2.214.0/bin/fastlane:23:in `<top (required)>' /usr/local/bin/fastlane:25:in `load' /usr/local/bin/fastlane:25:in `<top (required)>' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/cli/exec.rb:58:in `load' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/cli/exec.rb:58:in `kernel_load' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/cli/exec.rb:23:in `run' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/cli.rb:484:in `exec' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/cli.rb:31:in `dispatch' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/cli.rb:25:in `start' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/exe/bundle:48:in `block in <top (required)>' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors' /usr/share/rubygems-integration/all/gems/bundler-2.3.5/exe/bundle:36:in `<top (required)>' /usr/bin/bundle:25:in `load' /usr/bin/bundle:25:in `<main>' Google Api Error: Invalid request - APK specifies a version code that has already been used." />
|
||||
|
||||
</testcase>
|
||||
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Mon Feb 13 21:54:13 GMT 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
Reference in New Issue
Block a user