From 41bbcdabf1606e12331c18e08b6d567e0df05d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= <57442769+gjedlicska@users.noreply.github.com> Date: Mon, 22 Aug 2022 16:04:12 +0200 Subject: [PATCH] gergo/downScaleCiWorkers (#950) * ci(circleci): downscale worker resource_class config The bigger workers do not give a significant advantage and they cost ton more. * ci(circleci): halt step execution for a cleaner downstream cancelation * ci(circleci): trying conditional setup * ci(circleci): conditional trigger build steps * ci(circleci): add conditional step to publish --- .circleci/config.yml | 58 +++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4647d4a7c..fc70fd8fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -249,7 +249,7 @@ jobs: type: string docker: - image: speckle/pre-commit-runner:latest - resource_class: large + resource_class: medium working_directory: *work-dir steps: - checkout @@ -360,26 +360,30 @@ jobs: docker-build: &build-job docker: &docker-image - image: cimg/node:16.15 - resource_class: xlarge + resource_class: medium working_directory: *work-dir steps: - - checkout - attach_workspace: at: /tmp/ci/workspace - run: cat workspace/env-vars >> $BASH_ENV - run: cat workspace/should-build >> $BASH_ENV - - setup_remote_docker: - # a weird issue with yarn installing packages throwing EPERM errors - # this fixes it - version: 20.10.12 - docker_layer_caching: true - - run: - name: Build and Publish - command: ./.circleci/build.sh - - persist_to_workspace: - root: workspace - paths: - - speckle* + - when: + condition: + equal: [true, '${SHOULD_BUILD}'] + steps: + - checkout + - setup_remote_docker: + # a weird issue with yarn installing packages throwing EPERM errors + # this fixes it + version: 20.10.12 + docker_layer_caching: true + - run: + name: Build and Publish + command: ./.circleci/build.sh + - persist_to_workspace: + root: workspace + paths: + - speckle* docker-build-server: <<: *build-job @@ -424,19 +428,23 @@ jobs: resource_class: medium working_directory: *work-dir steps: - - checkout - attach_workspace: at: /tmp/ci/workspace - run: cat workspace/env-vars >> $BASH_ENV - run: cat workspace/should-publish >> $BASH_ENV - - setup_remote_docker: - # a weird issue with yarn installing packages throwing EPERM errors - # this fixes it - version: 20.10.12 - docker_layer_caching: true - - run: - name: Publish - command: ./.circleci/publish.sh + - when: + condition: + equal: [true, '${SHOULD_PUBLISH}'] + steps: + - checkout + - setup_remote_docker: + # a weird issue with yarn installing packages throwing EPERM errors + # this fixes it + version: 20.10.12 + docker_layer_caching: true + - run: + name: Publish + command: ./.circleci/publish.sh docker-publish-server: <<: *publish-job @@ -502,7 +510,7 @@ jobs: - run: name: auth to npm as Speckle command: | - echo "npmRegistryServer: https://registry.npmjs.org/" >> .yarnrc.yml + echo "npmRegistryServer: https://registry.npmjs.org/" >> .yarnrc.yml echo "npmAuthToken: ${NPM_TOKEN}" >> .yarnrc.yml - run: name: try login to npm