Update 8 files

- /security/npm.yml
- /security/composer.yml
- /security/security.yml
- /test/test.yml
- /build/composer.yml
- /build/npm.yml
- /build/docker.yml
- /build/build.yml
This commit is contained in:
Administrator 2023-02-17 12:19:49 +00:00
parent a3384d0cdf
commit e81737ba82
8 changed files with 122 additions and 1 deletions

10
build/build.yml Normal file
View file

@ -0,0 +1,10 @@
include:
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'build/composer.yml'
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'build/npm.yml'
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'build/docker.yml'

20
build/composer.yml Normal file
View file

@ -0,0 +1,20 @@
composer-build:
stage: build
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa:php8.1-1.0
before_script:
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
cache:
paths:
- vendor/
script:
- composer install --no-dev --optimize-autoloader --classmap-authoritative
artifacts:
expose_as: 'vendor'
paths:
- vendor
allow_failure: false
needs:
- phpcs
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "develop"

35
build/docker.yml Normal file
View file

@ -0,0 +1,35 @@
.docker-build:
stage: build
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${IMAGE_TAG}"
allow_failure: false
dependencies:
- npm-build
- composer-build
needs:
- job: npm-build
optional: true
- job: composer-build
optional: true
docker-build:develop:
extends: .docker-build
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/develop:$CI_COMMIT_SHORT_SHA
rules:
- if: $CI_COMMIT_BRANCH == "develop"
docker-build:review:
extends: .docker-build
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/review:$CI_MERGE_REQUEST_IID
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"

20
build/npm.yml Normal file
View file

@ -0,0 +1,20 @@
npm-build:
stage: build
image: node:17.9.1
before_script:
- npm install
cache:
paths:
- public/build/
script:
- npm run prod
artifacts:
expose_as: 'front-build'
paths:
- public/build
allow_failure: false
needs:
- front-build-test
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "develop"

14
security/composer.yml Normal file
View file

@ -0,0 +1,14 @@
composer-security:
stage: security
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa:php8.1-1.0
script:
- local-php-security-checker --format=json --path=./composer.lock > composer-security-checker-report.json
artifacts:
when: on_failure
expose_as: 'composer-security-checker'
paths:
- composer-security-checker-report.json
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "develop"

16
security/npm.yml Normal file
View file

@ -0,0 +1,16 @@
npm-security:
stage: security
image: node:17.9.1
before_script:
- npm install --location=global audit-ci@^6
script:
- audit-ci -p npm -o json > npm-security-checker-report.json
artifacts:
when: on_failure
expose_as: 'npm-security-checker'
paths:
- npm-security-checker-report.json
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "develop"

7
security/security.yml Normal file
View file

@ -0,0 +1,7 @@
include:
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'security/composer.yml'
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'security/npm.yml'

View file

@ -1,4 +1,3 @@
include:
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
- template: Security/Container-Scanning.gitlab-ci.yml