Skip to content

Commit

Permalink
Merge pull request #510 from diggsweden/release-5.0.7
Browse files Browse the repository at this point in the history
Release 5.0.7
  • Loading branch information
MickeA authored Nov 21, 2024
2 parents 2c9862a + d8cab1b commit d65c5ad
Show file tree
Hide file tree
Showing 128 changed files with 7,236 additions and 5,076 deletions.
10 changes: 9 additions & 1 deletion .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ HTTP_PROXY_PASS=secretpass
# Screen9 token for video player.
REACT_APP_SCREEN9_API_TOKEN=secret

## Connect to a local backend.
## Develop with local backend.
## Connect to localhost backend.
#APOLLO_URL=http://localhost:1301
#REACT_APP_APOLLO_URL=http://localhost:1301
#IMAGE_DOMAIN=localhost
Expand All @@ -26,6 +27,13 @@ REACT_APP_SCREEN9_API_TOKEN=secret
#IMAGE_DOMAIN=127.0.0.1
#REACT_APP_MEDIA_BASE_URL=http://127.0.0.1:1337

## Develop without a local backend.
## Connect to dev1 backend (beta.dataportal.dev1.se).
# APOLLO_URL=https://dev.beta.graphql.dataportal.dev1.se/
# REACT_APP_APOLLO_URL=https://dev.beta.graphql.dataportal.dev1.se/
# IMAGE_DOMAIN=dev.beta.graphql.dataportal.dev1.se
# REACT_APP_MEDIA_BASE_URL=https://dev.beta.strapi.dataportal.dev1.se

## Connect to production backend (beta.dataportal.se).
APOLLO_URL=https://graphql.digg.se/
REACT_APP_APOLLO_URL=https://graphql.digg.se/
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"no-console": ["error", { "allow": ["warn", "error"] }],
"react-hooks/exhaustive-deps": "off",
"@next/next/no-sync-scripts": "off",
"cypress": "off",
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": "off",
"no-unused-vars": 2,
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ yarn-error.log*

__ENV.js

# Cypress
cypress/screenshots

# yarn
.pnp.*
.yarn/*
Expand Down
192 changes: 0 additions & 192 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ image: docker:20.10.16-dind

include:
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Code-Quality.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/Container-Scanning.gitlab-ci.yml

workflow:
rules:
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
Expand All @@ -26,14 +23,6 @@ stages:
- deploy
- test

.dt-upload:
stage: .post
image: docker:20.10.16-dind
services:
- name: docker:20.10.16-dind
before_script:
- apk add --update curl

image:build:release:
stage: build
rules:
Expand All @@ -50,27 +39,6 @@ image:build:release:
- cat $DOCKER_AUTH_CONFIG > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile $KANIKO_CACHE_ARGS --destination $IMAGE:$TAG

image:build:tagged:
stage: build
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
- .next/cache/
rules:
- if: $CI_COMMIT_TAG
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo APOLLO_URL=$APOLLO_URL >> .env.production
- echo REACT_APP_APOLLO_URL=$REACT_APP_APOLLO_URL >> .env.production
- echo IMAGE_DOMAIN=$IMAGE_DOMAIN >> .env.production
script:
- mkdir -p /kaniko/.docker
- cat $DOCKER_AUTH_CONFIG > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile $KANIKO_CACHE_ARGS --destination $IMAGE:$CI_COMMIT_TAG

update:deploy:branch:
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
Expand All @@ -82,163 +50,3 @@ update:deploy:branch:
trigger:
project: digg/deploy-dataportal
branch: main

update:deploy:tag:
rules:
- if: $CI_COMMIT_TAG
variables:
WEBTAG: $CI_COMMIT_TAG
AUTHOR: $CI_COMMIT_AUTHOR
MESSAGE: $CI_COMMIT_MESSAGE
stage: deploy
trigger:
project: digg/deploy-dataportal
branch: main

cloc:
dependencies: []
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
stage: test
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:18-alpine
before_script:
- apk add perl
- npm install -g cloc
script:
- cloc src --json -out cloc.json
artifacts:
paths:
- cloc.json
when: always
expire_in: 1 day

container_scanning:
stage: test
variables:
GIT_STRATEGY: fetch
CS_IMAGE: $IMAGE:$TAG
CS_REGISTRY_USER: $DOCKER_USER
CS_REGISTRY_PASSWORD: $DOCKER_PASSWORD
needs:
- image:build:release
artifacts:
paths:
- gl-container-scanning-report.json
- gl-dependency-scanning-report.json
- gl-sbom-report.cdx.json
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'

code_quality:
variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_VERIFY: 1
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
before_script:
- until docker info; do sleep 1; done

code_quality_html:
extends: code_quality
variables:
REPORT_FORMAT: html
artifacts:
paths: [gl-code-quality-report.html]
before_script:
- until docker info; do sleep 1; done

semgrep-sast:
dependencies: []
after_script:
- cp gl-sast-report.json gl-semgrep-report.json
artifacts:
paths:
- gl-semgrep-report.json

nodejs-scan-sast:
dependencies: []
after_script:
- cp gl-sast-report.json gl-nodejs-report.json
artifacts:
paths:
- gl-nodejs-report.json

gemnasium-dependency_scanning:
rules: # override rules to not require lockfile to be committed
- when: on_success
after_script: cp gl-dependency-scanning-report.json gl-dependency-node-scanning-report.json
artifacts:
paths:
- gl-dependency-node-scanning-report.json

dd:upload:cloc:
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
image: maibornwolff/dd-import:latest
needs:
- job: cloc
artifacts: true
stage: .post
variables:
DD_FILE_NAME: "cloc.json"
script:
- dd-import-languages.sh

dd:upload:nodejs:dependency:scanning:
image: maibornwolff/dd-import:latest
needs:
- job: gemnasium-dependency_scanning
artifacts: true
stage: .post
variables:
GIT_STRATEGY: none
DD_TEST_NAME: "GitLab Dependency Scanning Report"
DD_TEST_TYPE_NAME: "GitLab Dependency Scanning Report"
DD_FILE_NAME: "gl-dependency-node-scanning-report.json"
script:
- dd-reimport-findings.sh

dd:upload:nodejs:sast:scanning:
image: maibornwolff/dd-import:latest
needs:
- job: nodejs-scan-sast
artifacts: true
stage: .post
variables:
GIT_STRATEGY: none
DD_TEST_NAME: "GitLab SAST Report"
DD_TEST_TYPE_NAME: "GitLab SAST Report"
DD_FILE_NAME: "gl-nodejs-report.json"
script:
- dd-reimport-findings.sh

dt-import-sbom-scan:
extends: .dt-upload
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
needs:
- job: container_scanning
artifacts: true
script:
- |
curl -X "POST" "$DT_URL" \
-H "application/json; charset=utf8" \
-H "X-Api-Key: $DT_API_KEY" \
-F "autoCreate=true" \
-F "projectName=$CI_PROJECT_NAME" \
-F "projectVersion=$CI_COMMIT_BRANCH" \
-F "bom=@gl-sbom-report.cdx.json"
dd:upload:container:dependency:scanning:
image: maibornwolff/dd-import:latest
needs:
- job: container_scanning
artifacts: true
stage: .post
variables:
GIT_STRATEGY: none
DD_TEST_NAME: "GitLab Container Scan"
DD_TEST_TYPE_NAME: "GitLab Container Scan"
DD_FILE_NAME: "gl-container-scanning-report.json"
script:
- dd-reimport-findings.sh
Loading

0 comments on commit d65c5ad

Please sign in to comment.