From d545ee6ea7b16ed53d088cf76821885002856575 Mon Sep 17 00:00:00 2001 From: akartasov Date: Fri, 30 Sep 2022 08:32:13 +0700 Subject: [PATCH] fix: remove global default, use anchors (#415) --- ui/.gitlab-ci.yml | 4 +++- ui/packages/ce/.gitlab-ci.yml | 9 +++++++++ ui/packages/platform/.gitlab-ci.yml | 12 ++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ui/.gitlab-ci.yml b/ui/.gitlab-ci.yml index 3adbebf81..1297c64ea 100644 --- a/ui/.gitlab-ci.yml +++ b/ui/.gitlab-ci.yml @@ -12,7 +12,7 @@ include: changes: - ui/**/* -default: +.ui_cache: &ui_cache image: node:lts-alpine cache: &cache key: "$CI_COMMIT_REF_SLUG" @@ -22,6 +22,7 @@ default: check-code-style: <<: *only_ui + <<: *ui_cache stage: test before_script: - apk add --no-cache curl @@ -41,6 +42,7 @@ semgrep-sast: stage: test image: returntocorp/semgrep <<: *only_ui + <<: *ui_cache variables: # See more at semgrep.dev/explore. SEMGREP_RULES: >- diff --git a/ui/packages/ce/.gitlab-ci.yml b/ui/packages/ce/.gitlab-ci.yml index f4a4bc232..56ad7523f 100644 --- a/ui/packages/ce/.gitlab-ci.yml +++ b/ui/packages/ce/.gitlab-ci.yml @@ -15,8 +15,17 @@ rules: - if: $CI_COMMIT_TAG =~ /^ui\/[0-9.]+$/ +.ui_cache: &ui_cache + image: node:lts-alpine + cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - .pnpm-store + policy: pull + # Jobs templates. .build_definition: &build_definition + <<: *ui_cache image: docker:20.10.12 stage: build services: diff --git a/ui/packages/platform/.gitlab-ci.yml b/ui/packages/platform/.gitlab-ci.yml index 64bde832f..763eb91f4 100644 --- a/ui/packages/platform/.gitlab-ci.yml +++ b/ui/packages/platform/.gitlab-ci.yml @@ -23,6 +23,14 @@ - ui/**/* when: manual +.ui_cache: &ui_cache + image: node:lts-alpine + cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - .pnpm-store + policy: pull + # Environments. .environment_production: &env_production environment: @@ -58,6 +66,7 @@ # Jobs templates. .build_definition: &build_definition + <<: *ui_cache stage: build image: docker:20.10.12 services: @@ -65,6 +74,9 @@ script: - apk add --no-cache bash - bash ./ui/packages/platform/ci_docker_build_push.sh + needs: + - job: check-code-style + artifacts: false .deploy_definition: &deploy_definition stage: deploy -- GitLab