Skip to content

Commit

Permalink
SIGBMWDEX-163 SLC-29 SAP Approved build container (#213)
Browse files Browse the repository at this point in the history
* SIGBMWDEX-163 SLC-29 SAP Approved build container

Switch to node:20

* Revert changes done for testing the circle-ci workflows

* Fix workspace root

* Renew cache key

* Switch blackduck to node sap approved) image

* Blackduck requires image with node and java or a split of build and scan

* Blackduck requires image with node and java or a split of build and scan

* update to node:22

As requested in code review, updating to node:22
  • Loading branch information
TorgeHarbig authored May 31, 2024
1 parent 6ce2f9c commit e696885
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ orbs:
blackduck: signavio/blackduck@1.16.4

references:
workspace_root: &workspace_root /home/circleci/repo
workspace_root: &workspace_root ~/repo

container_config: &container_config
docker:
- image: cimg/node:lts

dep_cache_key: &dep_cache_key deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
dep_backup_cache_key: &dep_backup_cache_key deps-{{ .Branch }}
dep_cache_key: &dep_cache_key deps2-{{ .Branch }}-{{ checksum "yarn.lock" }}
dep_backup_cache_key: &dep_backup_cache_key deps2-{{ .Branch }}

restore_deps: &restore_deps
restore_cache:
Expand All @@ -28,31 +24,38 @@ references:
path: junit.xml
prefix: tests

# define images as executor/not via 'reference' so that renovate will pick it
# up for updates
executors:
node:
resource_class: medium+
docker:
# On Circle-CI We have to use a build images approved by SAP (for build compliance)
# see https://wiki.one.int.sap/wiki/pages/viewpage.action?pageId=2650697023
- image: node:22

jobs:
build:
<<: *container_config

executor: node
working_directory: *workspace_root

steps:
- checkout

- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc

- restore_cache:
keys:
- deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- *dep_backup_cache_key
- *restore_deps

- run: yarn install

- save_cache:
key: deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
key: *dep_cache_key
paths:
- node_modules

black-duck-scan:
docker:
# blackduck requires node and java
- image: cimg/node:lts-browsers

working_directory: *workspace_root
Expand Down Expand Up @@ -92,7 +95,7 @@ jobs:
--client-secret $CX_CLIENT_SECRET \
test:
<<: *container_config
executor: node

working_directory: *workspace_root

Expand Down Expand Up @@ -122,7 +125,7 @@ jobs:
- *store_test_results

lint:
<<: *container_config
executor: node

working_directory: *workspace_root

Expand All @@ -134,7 +137,7 @@ jobs:
- run: yarn lint

flow:
<<: *container_config
executor: node

working_directory: *workspace_root

Expand Down

0 comments on commit e696885

Please sign in to comment.