From 010204de6c5e1e01f7c2d05175844493abe6d879 Mon Sep 17 00:00:00 2001 From: Slava Leleka Date: Thu, 29 Aug 2024 18:02:18 +0300 Subject: [PATCH] add specs for companiesdb data update. AG-35366 Squashed commit of the following: commit 6b95caa08bf9728de9e275674ee1cedcfb248632 Author: Slava Leleka Date: Thu Aug 29 13:06:39 2024 +0300 add specs for companiesdb data update. AG-35366 Squashed commit of the following: commit 0fb8750cb8c273f38db3082a406cac90d89c346c Author: Slava Leleka Date: Wed Aug 28 20:35:29 2024 +0300 add pnpm install to update-companiesdb specs commit b7e967e62de7978f72028d8619d1861892b577da Author: Slava Leleka Date: Wed Aug 28 20:32:47 2024 +0300 rename commit 18991c5b4df65e6114bb68de72b0c9639342c0a3 Author: Slava Leleka Date: Wed Aug 28 20:32:03 2024 +0300 add todo commit b1e8f14b416c6a78b2121a4be6af55f48cde6ab3 Author: Slava Leleka Date: Wed Aug 28 20:31:03 2024 +0300 update specs commit 9456aa94ee45797781fa2dc962b66d200715afe9 Merge: a2c4ceb8 e0c580fb Author: Slava Leleka Date: Wed Aug 28 20:30:22 2024 +0300 Merge branch 'fix/AG-35366' into fix/AG-35366-02 commit a2c4ceb82631446685667b6a71dbc534a2f4413a Author: Slava Leleka Date: Wed Aug 28 20:28:18 2024 +0300 fix comment commit c8750cc64aa63e422dc652b6efb20845ef38c4f6 Merge: 2c612c73 e84b09f0 Author: Slava Leleka Date: Wed Aug 28 20:27:38 2024 +0300 Merge branch 'fix/AG-35366' into fix/AG-35366-02 commit 2c612c73c71cc1546e32441434415cf8b1525697 Author: Slava Leleka Date: Tue Aug 27 12:51:44 2024 +0300 fix cron expression commit 202de3c16a22a0769e14f90c323677104074431d Author: Slava Leleka Date: Mon Aug 26 18:34:21 2024 +0300 fix comment commit ce84e523d8320abb8d30cdff9cac914a82dd24da Merge: e1405323 c6b0dadb Author: Slava Leleka Date: Mon Aug 26 18:33:50 2024 +0300 Merge branch 'fix/AG-35366' into fix/AG-35366-02 commit e14053236c7a61d49ac54df59dee09fcc6ca4834 Author: Slava Leleka Date: Mon Aug 26 18:30:19 2024 +0300 add specs for companiesdb data update --- bamboo-specs/bamboo.yaml | 3 + .../tswebextension-update-companiesdb.yaml | 97 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 bamboo-specs/tswebextension-update-companiesdb.yaml diff --git a/bamboo-specs/bamboo.yaml b/bamboo-specs/bamboo.yaml index 2ba546b40..31dc31c41 100644 --- a/bamboo-specs/bamboo.yaml +++ b/bamboo-specs/bamboo.yaml @@ -28,6 +28,9 @@ --- !include 'tswebextension-increment.yaml' +--- +!include 'tswebextension-update-companiesdb.yaml' + --- !include 'adguard-api-build.yaml' diff --git a/bamboo-specs/tswebextension-update-companiesdb.yaml b/bamboo-specs/tswebextension-update-companiesdb.yaml new file mode 100644 index 000000000..c4c47ada9 --- /dev/null +++ b/bamboo-specs/tswebextension-update-companiesdb.yaml @@ -0,0 +1,97 @@ +--- +version: 2 +plan: + project-key: AJL + key: TSWEBEXTENSIONUPDCOMPANIESDB + name: tswebextension - update companiesdb +variables: + dockerContainer: adguard/node-ssh:18.19--0 + +stages: + - Build: + manual: false + final: false + jobs: + - Build + +Build: + key: TSWEBEXTUPDCOMPANIESDB + docker: + image: "${bamboo.dockerContainer}" + volumes: + ${system.PNPM_DIR}: "${bamboo.cachePnpm}" + tasks: + - checkout: + force-clean-build: 'true' + - script: + interpreter: SHELL + scripts: + - |- + set -e + set -x + + # Fix mixed logs + exec 2>&1 + + ls -alt + + branch="${bamboo.planRepository.branchName}" + + # TODO: remove when release/v3.1 is merged into master + # Throw error if current branch is not "release/v3.1", + if [ $branch != "release/v3.1" ] + then + echo "load companiesdb is not supported on branch ${branch}" + exit 1; + fi + + # Install dependencies + pnpm install + + # update companiesdb data + pnpm --filter @adguard/tswebextension update:companiesdb + - any-task: + plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.commit + configuration: + commitMessage: 'skipci: update companiesdb data' + selectedRepository: defaultRepository + final-tasks: + - script: + interpreter: SHELL + scripts: + - |- + set -x + set -e + + # Fix mixed logs + exec 2>&1 + + ls -la + + echo "Size before cleanup:" && du -h | tail -n 1 + + # Check if node_modules directory exists + if [ -d "node_modules" ]; then + pnpm clean + else + echo "node_modules directory does not exist, skipping pnpm clean" + fi + + echo "Size after cleanup:" && du -h | tail -n 1 + requirements: + - adg-docker: 'true' + +# run release build at 11:00 every Monday (after companiesdb update) +triggers: + - cron: + expression: 0 0 11 ? * MON + +branches: + create: manually + delete: never + link-to-jira: 'true' + +labels: [ ] + +other: + concurrent-build-plugin: system-default