Skip to content

Commit

Permalink
Merge branch 'main' into upgrade-martin
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-markl authored Oct 21, 2024
2 parents 7f286c2 + 0155de8 commit 77cd35d
Show file tree
Hide file tree
Showing 596 changed files with 39,430 additions and 42,272 deletions.
324 changes: 233 additions & 91 deletions .circleci/config.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .circleci/src/@common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ parameters:
default: false
type: boolean
run_delivery_beta_all:
default: false
type: boolean
run_promote_all:
default: false
type: boolean
4 changes: 2 additions & 2 deletions .circleci/src/commands/install_dart_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ steps:
name: Install Dart
command: |
brew tap dart-lang/dart
brew install dart
brew link dart
brew install dart@3.3.1
brew link dart@3.3.1
- save_cache:
key: brew-dart-4
paths:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/commands/install_protobuf_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ steps:
- run:
name: Install protobuf
command: |
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v21.11/protoc-21.11-osx-x86_64.zip"
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v21.11/protoc-21.11-osx-universal_binary.zip"
unzip protoc*.zip -d $HOME/.local
echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
- run:
Expand Down
7 changes: 4 additions & 3 deletions .circleci/src/commands/restore_npm_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ description: Restores and saves the node_modules directories of the npm workspac
steps:
- restore_cache:
keys:
- v1-node-modules-{{ checksum "package.json" }}-{{checksum "package-lock.json" }}-{{ checksum "administration/package.json" }}-{{checksum "administration/package-lock.json" }}-{{ checksum "frontend/build-configs/package.json" }}-{{checksum "frontend/build-configs/package-lock.json" }}
- v2-node-modules-{{ checksum "package.json" }}-{{checksum "package-lock.json" }}-{{ checksum "administration/package.json" }}-{{ checksum "frontend/build-configs/package.json" }}
- run:
name: Install node dependencies for npm workspace
name: Install node dependencies for npm workspaces
command: "[ ! -d node_modules ] && npm ci --ignore-scripts --loglevel warn --yes || echo package.json and package-lock.json unchanged. Using cache."
- save_cache:
key: v1-node-modules-{{ checksum "package.json" }}-{{checksum "package-lock.json" }}-{{ checksum "administration/package.json" }}-{{checksum "administration/package-lock.json" }}-{{ checksum "frontend/build-configs/package.json" }}-{{checksum "frontend/build-configs/package-lock.json" }}
key: v2-node-modules-{{ checksum "package.json" }}-{{checksum "package-lock.json" }}-{{ checksum "administration/package.json" }}-{{ checksum "frontend/build-configs/package.json" }}
paths:
- ~/node_modules
- ~/administration/node_modules
- ~/frontend/build-configs/node_modules
4 changes: 2 additions & 2 deletions .circleci/src/jobs/build_administration.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
docker:
- image: cimg/node:19.1.0
- image: cimg/node:20.13.1
working_directory: ~/project
steps:
- checkout:
path: ~/project
- install_app_toolbelt
- install_dart_linux
- install_protobuf_linux
- install_app_toolbelt
- prepare_workspace
- restore_environment_variables
- restore_npm_cache
Expand Down
6 changes: 3 additions & 3 deletions .circleci/src/jobs/build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ parameters:
buildConfig:
description: "Name of the build config to use"
type: enum
enum: ['bayern', 'bayern-floss', 'nuernberg']
enum: ['bayern', 'bayern-floss', 'nuernberg', 'koblenz']
flutterFlavor:
description: "Flutter Flavor to use"
type: enum
enum: ['Bayern', 'BayernFloss', 'Nuernberg']
enum: ['Bayern', 'BayernFloss', 'Nuernberg', 'Koblenz']
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m" -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2'
resource_class: large
Expand All @@ -18,10 +18,10 @@ steps:
- add_ssh_keys: # Needed for credentials repo
fingerprints:
- 24:1d:3b:b7:b3:49:69:d7:54:c3:93:a5:a2:d1:71:db
- install_app_toolbelt
- prepare_workspace
- install_dart_linux
- install_fvm
- install_app_toolbelt
- install_protobuf_linux:
dart_plugin: true
- restore_environment_variables
Expand Down
2 changes: 2 additions & 0 deletions .circleci/src/jobs/build_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ working_directory: ~/project/backend
steps:
- checkout:
path: ~/project
- setup_remote_docker:
docker_layer_caching: true
- run: git submodule sync
- run: git submodule update --init
- install_app_toolbelt
Expand Down
6 changes: 5 additions & 1 deletion .circleci/src/jobs/build_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ parameters:
steps:
- checkout:
path: ~/project
- install_app_toolbelt
- install_dart_mac
- install_fvm
- install_app_toolbelt
- install_protobuf_mac
- prepare_workspace
- restore_environment_variables
# needed for circle ci mac m1 images
- run:
name: Install rosetta
command: softwareupdate --install-rosetta --agree-to-license
- restore_ruby_cache:
directory: frontend/ios
- run:
Expand Down
8 changes: 6 additions & 2 deletions .circleci/src/jobs/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ parameters:
description: Whether to prepare for a delivery. If true, the version bump is committed.
type: boolean
default: false
platforms:
description: Set one or multiple platforms for git tag f.e. "web" or "web/native"
default: 'all'
type: string
docker:
- image: cimg/node:18.14.1
- image: cimg/node:20.13.1
resource_class: small
steps:
- checkout:
Expand All @@ -22,7 +26,7 @@ steps:
steps:
- run:
name: Bump git version
command: app-toolbelt v0 release bump-to ${NEW_VERSION_NAME} ${NEW_VERSION_CODE} --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME} --branch ${CIRCLE_BRANCH}
command: app-toolbelt v0 release bump-to ${NEW_VERSION_NAME} ${NEW_VERSION_CODE} --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME} --branch ${CIRCLE_BRANCH} --platforms << parameters.platforms >>
- when:
condition:
and:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
docker:
- image: cimg/node:19.1.0-browsers
- image: cimg/node:20.13.1-browsers
resource_class: small
environment:
TOTAL_CPUS: 1 # For resource_class small
Expand Down
11 changes: 8 additions & 3 deletions .circleci/src/jobs/check_administration.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
docker:
- image: cimg/node:19.1.0
- image: cimg/node:20.13.1
working_directory: ~/project
steps:
- checkout:
path: ~/project
- install_app_toolbelt
- install_dart_linux
- install_protobuf_linux
- prepare_workspace
Expand All @@ -21,10 +22,14 @@ steps:
command: npm run lint
working_directory: ~/project/administration
- run:
name: Test
command: npm run test -- --maxWorkers=2
name: Run tests and generate coverage report
command: npm run test:coverage -- --maxWorkers=2
working_directory: ~/project/administration
- store_artifacts:
path: ~/project/administration/src/coverage
destination: ~/attached_workspace/coverage
- run:
name: Typescript
command: npm run ts:check
working_directory: ~/project/administration
- notify
12 changes: 12 additions & 0 deletions .circleci/src/jobs/check_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ working_directory: ~/project/backend
steps:
- checkout:
path: ~/project
- setup_remote_docker:
docker_layer_caching: true
- run: git submodule sync
- run: git submodule update --init
- install_app_toolbelt
- install_protobuf_linux
- prepare_workspace
- restore_cache:
Expand All @@ -27,6 +30,14 @@ steps:
name: Test
command: |
./gradlew test
- store_test_results:
path: ./build/test-results
- run:
name: Generate test coverage report
command: ./gradlew koverLog koverHtmlReport
- store_artifacts:
path: ./build/reports/kover/html
destination: test-coverage-report
- save_cache:
paths:
- ~/.gradle/wrapper
Expand All @@ -35,3 +46,4 @@ steps:
paths:
- ~/.gradle/caches
key: v3-gradle-cache-{{ checksum "build.gradle.kts" }}
- notify
4 changes: 2 additions & 2 deletions .circleci/src/jobs/check_frontend.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
docker:
- image: cimg/node:19.1.0-browsers
- image: cimg/node:20.13.1-browsers
resource_class: small
steps:
- checkout:
path: ~/project
- install_app_toolbelt
- browser-tools/install-chrome
- install_dart_linux
- install_fvm
- install_app_toolbelt
- install_protobuf_linux:
dart_plugin: true
- run:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/check_health_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
path: ~/project
- attach_workspace:
at: /tmp/workspace
- run: apt update -y && apt install -y nodejs npm curl
- run: apt update -y && apt install -y nodejs npm curl sudo
- install_app_toolbelt
- run:
name: Install ca-certificates-java # workaround for current issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030129
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/deliver_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ shell: /bin/bash --login -o pipefail
steps:
- checkout:
path: ~/project
- install_app_toolbelt
- prepare_workspace
- restore_environment_variables
- install_app_toolbelt
- restore_ruby_cache:
directory: ~/project/frontend/ios
- when:
Expand Down
26 changes: 26 additions & 0 deletions .circleci/src/jobs/install_packages_to_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
docker:
- image: cimg/node:20.13.1
parameters:
production:
description: Whether builds are delivered to production or beta.
type: boolean
steps:
- checkout:
path: ~/project
- install_app_toolbelt
- prepare_workspace
- when:
condition: << parameters.production >>
steps:
- run:
name: Install packages via webhook
command: |
curl https://webhook.entitlementcard.tuerantuer.org/hooks/install-backend-admin-$EAK_WEBHOOK
- unless:
condition: << parameters.production >>
steps:
- run:
name: Install packages via webhook
command: |
curl https://webhook.entitlementcard-test.tuerantuer.org/hooks/install-backend-admin-$EAK_WEBHOOK
- notify
10 changes: 8 additions & 2 deletions .circleci/src/jobs/notify_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ parameters:
description: Whether builds are delivered to the production or beta lane of the play store.
type: boolean
docker:
- image: cimg/node:19.1.0
- image: cimg/node:20.13.1
resource_class: small
steps:
- install_app_toolbelt
- prepare_workspace
- restore_environment_variables
- install_app_toolbelt
- run:
name: Create github release
command: echo "export RELEASE_ID='$(app-toolbelt v0 release create all ${NEW_VERSION_NAME} ${NEW_VERSION_CODE} --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME} <<# parameters.production_delivery >>--production-release<</ parameters.production_delivery >>)'" >> ${BASH_ENV}
- run:
name: Upload android apks to github release
command: app-toolbelt v0 release upload --releaseId ${RELEASE_ID} --files "$(ls ~/attached_workspace/*.apk)" --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
- run:
name: Upload administration debian package to github release
command: app-toolbelt v0 release upload --releaseId ${RELEASE_ID} --files "$(ls ~/attached_workspace/debs/administration/*.deb)" --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
- run:
name: Upload backend debian packages to github release
command: app-toolbelt v0 release upload --releaseId ${RELEASE_ID} --files "$(ls ~/attached_workspace/debs/backend/*.deb)" --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
- notify:
success_message: <<^ parameters.production_delivery >>[Beta] <</ parameters.production_delivery >>Ehrenamtskarte Bayern und Sozialpass Nürnberg ${NEW_VERSION_NAME} have been released successfully! https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases/tag/${NEW_VERSION_NAME}-all
channel: releases
Expand Down
1 change: 0 additions & 1 deletion .circleci/src/jobs/pack_administration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ steps:
- prepare_workspace
- restore_environment_variables
- run: ~/project/scripts/pack_deb.sh -v "${NEW_VERSION_NAME}" -f ~/attached_workspace/administration/build -d "Administration backend for the Ehrenamtskarte app" -n "eak-administration"
- install_app_toolbelt
- run: |
mkdir -p ~/attached_workspace/debs/administration
mv *.deb ~/attached_workspace/debs/administration
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/pack_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ working_directory: ~/project/backend
steps:
- checkout:
path: ~/project
- prepare_workspace
- restore_environment_variables
- run: apt update -y && apt install -y nodejs npm
- install_app_toolbelt
- prepare_workspace
- restore_environment_variables
- run: ~/project/scripts/pack_deb.sh -v "${NEW_VERSION_NAME}" -t ~/attached_workspace/backend/build/distributions/*.tar -s ~/project/scripts/eak-backend.service -d "Backend server for the Ehrenamtskarte app" -n "eak-backend" -c "openjdk-17-jre-headless"
- run: |
mkdir -p ~/attached_workspace/debs/backend
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/pack_meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ docker:
steps:
- checkout:
path: ~/project
- run: apt update -y && apt install -y nodejs npm
- install_app_toolbelt
- prepare_workspace
- restore_environment_variables
- run: ~/project/scripts/pack_deb.sh -v "${NEW_VERSION_NAME}" -d "Meta package for the Ehrenamtskarte app" -n "eak" -c "eak-backend, eak-administration, eak-martin"
- run: apt update -y && apt install -y nodejs npm
- install_app_toolbelt
- run: |
mkdir -p ~/attached_workspace/debs/backend
cp *.deb ~/attached_workspace/debs/backend
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/promote_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ environment:
steps:
- checkout:
path: ~/project
- install_app_toolbelt
- restore_ruby_cache:
directory: ~/project/frontend/android
- install_app_toolbelt
- run:
name: '[FL] Play Store Promotion'
command: bundle exec fastlane android playstore_promote build_config_name:<< parameters.build_config_name >>
Expand Down
8 changes: 8 additions & 0 deletions .circleci/src/jobs/promote_github_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
docker:
- image: cimg/node:20.13.1
steps:
- install_app_toolbelt
- run:
name: Remove prerelease flag from github release
command: app-toolbelt v0 release promote --platform all --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
- notify
3 changes: 2 additions & 1 deletion .circleci/src/jobs/promote_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ environment:
shell: /bin/bash --login -o pipefail
steps:
- checkout
- install_app_toolbelt
- restore_ruby_cache:
directory: ~/project/frontend/ios
- install_app_toolbelt
- run:
name: '[FL] Appstore Connect Store Promotion'
command: bundle exec fastlane ios appstoreconnect_promote build_config_name:<< parameters.build_config_name >>
working_directory: frontend/ios
- notify
Loading

0 comments on commit 77cd35d

Please sign in to comment.