Skip to content

Commit

Permalink
#000 | use kill_gradle_daemons only in ci builds
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Oct 1, 2024
1 parent c2ef4c4 commit 089789d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- v1-dependencies-
- run: sudo chmod a+x packages/openchs-android/android/gradlew
- run: sudo npm i -g react-native-cli
- run: make deps_ci release_no_env_universal_without_clean
- run: make deps_ci kill_gradle_daemons release_no_env_universal_without_clean
- save_cache:
key: v1-dependencies-{{ checksum "packages/openchs-android/android/app/build.gradle" }}-generic
paths:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- v1-dependencies-
- run: sudo chmod a+x packages/openchs-android/android/gradlew
- run: sudo npm i -g react-native-cli
- run: make deps_ci release_staging_dev_without_clean
- run: make deps_ci kill_gradle_daemons release_staging_dev_without_clean
- run: make deploy_platform_translations_staging
- save_cache:
key: v1-dependencies-{{ checksum "packages/openchs-android/android/app/build.gradle" }}-staging
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
- v1-dependencies-
- run: sudo chmod a+x packages/openchs-android/android/gradlew
- run: sudo npm i -g react-native-cli
- run: make deps_ci release_gramin_staging_dev_without_clean
- run: make deps_ci kill_gradle_daemons release_gramin_staging_dev_without_clean
- run: make deploy_platform_translations_gramin_staging
- save_cache:
key: v1-dependencies-{{ checksum "packages/openchs-android/android/app/build.gradle" }}-staging
Expand Down Expand Up @@ -170,14 +170,14 @@ jobs:
- aws-cli/setup:
role_arn: 'arn:aws:iam::118388513628:role/CircleCI-OIDC'
region: 'ap-south-1'
- run: make deps_ci release_prerelease_dev_without_clean
- run: make deps_ci kill_gradle_daemons release_prerelease_dev_without_clean
- aws-s3/copy:
from: packages/openchs-android/android/app/build/outputs/apk/<< pipeline.parameters.flavor >>/release/app-<< pipeline.parameters.flavor >>-release.apk
to: s3://samanvay/openchs/<< pipeline.number >>-<< pipeline.git.revision >>/prerelease_dev/
- store_artifacts:
path: packages/openchs-android/android/app/build/outputs/apk/<< pipeline.parameters.flavor >>/release/app-<< pipeline.parameters.flavor >>-release.apk
destination: << pipeline.parameters.flavor >>-prerelease_dev-<< pipeline.git.revision >>.apk
- run: make deps_ci release_prerelease_without_clean
- run: make deps_ci kill_gradle_daemons release_prerelease_without_clean
- aws-s3/copy:
from: packages/openchs-android/android/app/build/outputs/apk/<< pipeline.parameters.flavor >>/release/app-<< pipeline.parameters.flavor >>-release.apk
to: s3://samanvay/openchs/<< pipeline.number >>-<< pipeline.git.revision >>/prerelease/
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
- v1-dependencies-
- run: sudo chmod a+x packages/openchs-android/android/gradlew
- run: sudo npm i -g react-native-cli
- run: make deps_ci release_perf_without_clean
- run: make deps_ci kill_gradle_daemons release_perf_without_clean
- run: make deploy_platform_translations_prerelease
- save_cache:
key: v1-dependencies-{{ checksum "packages/openchs-android/android/app/build.gradle" }}-perf
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ renew_env: clean_all deps
deps: build_env apply_patch
deps_ci: build_env_ci apply_patch

kill_gradle_daemons:
pkill -f '.*GradleDaemon.*' || true
# Kill all previous gradle daemons irrespective of version to release memory used

ignore_deps_changes:
git checkout package-lock.json
# </deps>
Expand Down Expand Up @@ -366,10 +370,8 @@ build: build_env build_app


build_env_ci:
pkill -f '.*GradleDaemon.*'
export NODE_OPTIONS=--max_old_space_size=2048
cd packages/openchs-android && npm install --legacy-peer-deps
# Kill all previous gradle daemons irrespective of version to release memory used
# export GRADLE_OPTS="-Dorg.gradle.daemon=false -Dkotlin.compiler.execution.strategy=in-process -Dorg.gradle.workers.max=4 -Xms1024m -Xmx4096M -XX:MaxMetaspaceSize=2g"
# GRADLE_OPTS set via circleci env vars ui

Expand Down

0 comments on commit 089789d

Please sign in to comment.