Skip to content

Commit 66ea1d2

Browse files
authored
Merge pull request #1 from catenax-ng/sonar
chr: use SONAR_PROJECT_KEY and SONAR_ORGANIZATION env vars in build
2 parents d694f18 + 6e69f3c commit 66ea1d2

File tree

27 files changed

+230
-85
lines changed

27 files changed

+230
-85
lines changed

.github/workflows/kics.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: "KICS"
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [main, master]
67
# pull_request:
@@ -29,6 +30,10 @@ jobs:
2930
with:
3031
# Scanning directory .
3132
path: "."
33+
# Excluded paths:
34+
# - docker-compose.yml - used only on local env
35+
# - in cypress dir docker related files used only on local env
36+
exclude_paths: "docker-compose.yml,cypress/docker-compose.yml,cypress/Dockerfile"
3237
# Fail on HIGH severity results
3338
fail_on: high
3439
# Disable secrets detection - we use GitGuardian

.github/workflows/test.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,19 @@ jobs:
2424
cmd: install # will run `yarn install` command
2525
- name: Run npm test:ci
2626
run: CHROMIUM_BIN=$(which chrome) npm run test:ci # will run `test:ci` command
27-
- uses: SonarSource/sonarcloud-github-action@master
27+
- name: Run SonarCloud with organzation and project key from environment
28+
uses: SonarSource/sonarcloud-github-action@master
29+
if: ${{ vars.SONAR_ORGANIZATION != '' && vars.SONAR_PROJECT_KEY != '' }}
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
32+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
33+
with:
34+
args: >
35+
-Dsonar.organization=${{ vars.SONAR_ORGANIZATION }}
36+
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
37+
- name: Run SonarCloud with hardcoded organization and project key
38+
uses: SonarSource/sonarcloud-github-action@master # Fallback for the catenax-ng/product-traceability-foss-frontend
39+
if: ${{ vars.SONAR_ORGANIZATION == '' || vars.SONAR_PROJECT_KEY == '' }}
2840
env:
2941
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
3042
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

AUTHORS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#Authors
2+
3+
The following people have contributed to this repository:
4+
5+
- Blazej Kepa,doubleSlash Net-Business GmbH,https://github.com/ds-ext-bkepa
6+
- Dirk Blank,evia consulting GmbH,https://github.com/dblankevia
7+
- Fabian Bedarf,evia consulting GmbH,https://github.com/evia-fbedarf
8+
- Jedrzej Serwa,doubleSlash Net-Business GmbH,https://github.com/ds-ext-jserwa
9+
- Martin Kanal,doubleSlash Net-Business GmbH,https://github.com/mkanal
10+
- Anton Kononenko,doubleSlash Net-Business GmbH,https://github.com/ds-ext-akononenko
11+
- Sebastian Scherer,Mercedes-Benz Group AG,https://github.com/the-tatanka
12+
- Ivan Emelianov,T-Systems International GmbH,https://github.com/Anacin
13+
- Sebastian Bezold,Mercedes-Benz Group AG,https://github.com/SebastianBezold
14+
- Gregor Stelzer,msg DAVID GmbH,https://github.com/gregors101
15+
- Darek Skrzypczak,doubleSlash Net-Business GmbH,https://github.com/ds-ext-dskrzypczak
16+
- Nobert Geczi,msg Systems Romania SRL,https://github.com/norbertgeczi
17+
- Markus Kreuz,FEV Consulting GmbH,https://github.com/CXkreuz
18+
- Thomas Braun,ZF Friedrichshafen AG,https://github.com/tbraun-zf
19+
20+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
image:
3+
tag: $ARGOCD_APP_REVISION
4+
CATENAX_PORTAL_API_URL: 'https://traceability-test.dev.demo.catena-x.net/api'
5+
CATENAX_PORTAL_KEYCLOAK_URL: 'https://centralidp.dev.demo.catena-x.net/auth'
6+
CATENAX_PORTAL_CLIENT_ID: 'Cl17-CX-Part'
7+
CATENAX_PORTAL_DEFAULT_REALM: 'CX-Central'
8+
9+
nameOverride: "product-traceability-foss-test-frontend"
10+
fullnameOverride: "product-traceability-foss-test-frontend"
11+
12+
autoscaling:
13+
enabled: false
14+
15+
ingress:
16+
enabled: true
17+
className: "nginx"
18+
annotations:
19+
cert-manager.io/cluster-issuer: letsencrypt-prod
20+
hosts:
21+
- host: "traceability-portal-test.dev.demo.catena-x.net"
22+
paths:
23+
- path: /
24+
pathType: ImplementationSpecific
25+
tls:
26+
- hosts:
27+
- "traceability-portal-test.dev.demo.catena-x.net"
28+
secretName: "traceability-portal-test.dev.demo.catena-x.net-tls"

charts/product-traceability-foss-frontend/values-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ingress:
1717
- host: "traceability-portal.dev.demo.catena-x.net"
1818
paths:
1919
- path: /
20-
pathType: Prefix
20+
pathType: ImplementationSpecific
2121
tls:
2222
- hosts:
2323
- "traceability-portal.dev.demo.catena-x.net"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
image:
2+
tag: $ARGOCD_APP_REVISION
3+
CATENAX_PORTAL_API_URL: 'https://traceability-test.int.demo.catena-x.net/api'
4+
CATENAX_PORTAL_KEYCLOAK_URL: 'https://centralidp.int.demo.catena-x.net/auth'
5+
CATENAX_PORTAL_CLIENT_ID: 'Cl17-CX-Part'
6+
CATENAX_PORTAL_DEFAULT_REALM: 'CX-Central'
7+
8+
nameOverride: "product-traceability-foss-test-frontend"
9+
fullnameOverride: "product-traceability-foss-test-frontend"
10+
11+
autoscaling:
12+
enabled: false
13+
14+
ingress:
15+
enabled: true
16+
className: "nginx"
17+
annotations:
18+
cert-manager.io/cluster-issuer: letsencrypt-prod
19+
hosts:
20+
- host: "traceability-portal-test.int.demo.catena-x.net"
21+
paths:
22+
- path: /
23+
pathType: ImplementationSpecific
24+
tls:
25+
- hosts:
26+
- "traceability-portal-test.int.demo.catena-x.net"
27+
secretName: "traceability-portal-test.int.demo.catena-x.net-tls"

charts/product-traceability-foss-frontend/values-int.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ingress:
1717
- host: "traceability-portal.int.demo.catena-x.net"
1818
paths:
1919
- path: /
20-
pathType: Prefix
20+
pathType: ImplementationSpecific
2121
tls:
2222
- hosts:
2323
- "traceability-portal.int.demo.catena-x.net"

cypress/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# DISCLAIMER!
2+
# purpose of this file is to run cypress E2E tests locally, we don't use it in other env
3+
# because of statement above, we don't need to change settings to comply with some KICS requirements
4+
15

26
# if you need to change image please make sure use the same version in all places
37
# (here and in .github/workflows/e2e-tests.yml)
@@ -8,6 +12,7 @@
812
# but cypress/included:12.3.0 version base on cypress/browsers:node16.16.0-chrome107-ff107-edge
913
FROM cypress/included:12.3.0
1014

15+
USER root
1116
RUN mkdir /ng-app
1217
WORKDIR /ng-app
1318

@@ -18,4 +23,3 @@ COPY yarn.lock /ng-app/yarn.lock
1823
RUN yarn install
1924
# https://docs.cypress.io/guides/guides/launching-browsers#Linux-Dependencies
2025
RUN npx playwright install --with-deps webkit
21-

cypress/docker-compose.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1+
# DISCLAIMER!
2+
# purpose of this file is to run cypress E2E tests locally, we don't use it in other env
3+
# because of statement above, we don't need to change settings to comply with some KICS requirements
4+
15
version: "3.9"
26
services:
37
cypress:
48
build:
59
context: ../
610
dockerfile: cypress/Dockerfile
11+
712
volumes:
813
- ../:/ng-app/
914
- /ng-app/node_modules/ # we don't want to override it by host machine
15+
security_opt:
16+
- label:user:testuser
17+
- no-new-privileges:true
1018
network_mode: host # important to be able to connect to localhost url on host machine
11-
12-
13-
networks:
14-
TRACE_X_FE:
19+
# to comply with KICS requirement:
20+
# [MEDIUM] Memory Not Limited
21+
# Memory limits should be defined for each container. This prevents potential resource exhaustion by ensuring that containers consume not more than the designated amount of memory
22+
deploy:
23+
resources:
24+
limits:
25+
cpus: "4"
26+
memory: "1024M"
27+
reservations:
28+
cpus: "2"
29+
memory: "512M"

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# DISCLAIMER!
2+
# purpose of this file is to run services locally, we don't use it in other env
3+
# because of statement above, we don't need to change settings to comply with some KICS requirements
4+
15
version: "3.9"
26
services:
37
keycloak:

0 commit comments

Comments
 (0)