Compare commits
68 commits
add-update
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d19fa9b7f | ||
|
|
e071a603f6 | ||
|
|
fedde1e0a8 | ||
|
|
fa814e8d55 | ||
|
|
6606eb89e7 | ||
|
|
b9c76afa6d | ||
|
|
a75ff7e880 | ||
|
|
8adc82419f | ||
|
|
494539a2e3 | ||
|
|
2bf7556e36 | ||
|
|
9742e761c6 | ||
|
|
396d5761db | ||
|
|
bdfdf9e5e7 | ||
|
|
384b4da9ad | ||
|
|
e951b5a2c2 | ||
|
|
9d4a029160 | ||
|
|
afd9b33c1a | ||
|
|
1dae191892 | ||
|
|
1594e75961 | ||
|
|
25270cf2a5 | ||
|
|
647b49831f | ||
|
|
a2646d700a | ||
|
|
d119c9dde6 | ||
|
|
ad05da74ab | ||
|
|
2e9110839c | ||
|
|
a9cbc35796 | ||
|
|
cdf3fc956e | ||
|
|
772b5f3535 | ||
|
|
b1e7bec849 | ||
|
|
62dd61d007 | ||
|
|
ae9e7adb89 | ||
|
|
8c0115a5e4 | ||
|
|
7bdda5445a | ||
|
|
619249d8c4 | ||
|
|
41e7fd2b3e | ||
|
|
8b813bbd1f | ||
|
|
2617138e84 | ||
|
|
49d0055be1 | ||
|
|
5b03768d21 | ||
|
|
48101ac07a | ||
|
|
762323d645 | ||
|
|
d4541d8c51 | ||
|
|
3d7cf89a2f | ||
|
|
2077795637 | ||
|
|
aa210160db | ||
|
|
74ed18852a | ||
|
|
ee19be6dd3 | ||
|
|
cf8f8560d2 | ||
|
|
2e0a17df49 | ||
|
|
6bb6d39f9c | ||
|
|
4a40c2a8f1 | ||
|
|
5af11a522e | ||
|
|
0f393a153a | ||
|
|
35a30ce9af | ||
|
|
a42eff5580 | ||
|
|
6e41653e80 | ||
|
|
d00dc073ff | ||
|
|
c27c80b48a | ||
|
|
766bc977b7 | ||
|
|
10838a0ffa | ||
|
|
6735bb6403 | ||
|
|
1683182234 | ||
|
|
7037483107 | ||
|
|
539269c8fd | ||
|
|
7bf789e472 | ||
|
|
bc032620a0 | ||
|
|
6e4eb2124d | ||
|
|
e67b4e4536 |
18 changed files with 303 additions and 84 deletions
28
build/composer-bedrock-8.3.yml
Normal file
28
build/composer-bedrock-8.3.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
composer-build:
|
||||
stage: build
|
||||
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa-8.3:latest
|
||||
before_script:
|
||||
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
|
||||
- composer config http-basic.connect.advancedcustomfields.com $APP_ACF_USER $APP_ACF_PWD
|
||||
cache:
|
||||
paths:
|
||||
- vendor/
|
||||
- public/
|
||||
|
||||
|
||||
script:
|
||||
- composer install --no-dev --optimize-autoloader --classmap-authoritative
|
||||
artifacts:
|
||||
expose_as: 'composer-build'
|
||||
paths:
|
||||
- vendor
|
||||
- public
|
||||
allow_failure: false
|
||||
dependencies:
|
||||
- composer-security
|
||||
needs:
|
||||
- job: composer-security
|
||||
optional: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
|
|
@ -24,6 +24,5 @@ composer-build:
|
|||
- job: composer-security
|
||||
optional: true
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
|
|
@ -1,24 +1,27 @@
|
|||
composer-build:
|
||||
stage: build
|
||||
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa-8.2:latest
|
||||
before_script:
|
||||
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
|
||||
image: composer:2.10
|
||||
cache:
|
||||
key:
|
||||
files:
|
||||
- composer.lock
|
||||
paths:
|
||||
- vendor/
|
||||
policy: pull-push
|
||||
before_script:
|
||||
- composer config gitlab-token.lab.s-web.fr "${CI_DEPLOY_USER}" "${CI_DEPLOY_PASSWORD}"
|
||||
script:
|
||||
- composer install --no-dev --optimize-autoloader --classmap-authoritative --no-scripts
|
||||
- composer install --ignore-platform-reqs --no-interaction --no-plugins --no-scripts --no-dev --prefer-dist
|
||||
artifacts:
|
||||
expose_as: 'vendor'
|
||||
paths:
|
||||
- vendor
|
||||
allow_failure: false
|
||||
paths:
|
||||
- vendor/
|
||||
expire_in: 1h
|
||||
dependencies:
|
||||
- composer-security
|
||||
needs:
|
||||
- job: composer-security
|
||||
optional: true
|
||||
allow_failure: false
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
composer-build:
|
||||
stage: build
|
||||
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa:php7.3-1.0
|
||||
image: composer:2.9.7
|
||||
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 --no-scripts
|
||||
- composer install --no-dev --optimize-autoloader --classmap-authoritative --no-scripts --ignore-platform-reqs
|
||||
artifacts:
|
||||
expose_as: 'vendor'
|
||||
paths:
|
||||
- vendor
|
||||
allow_failure: false
|
||||
allow_failure: true
|
||||
dependencies:
|
||||
- composer-security
|
||||
needs:
|
||||
- job: composer-security
|
||||
optional: true
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
|
|
|
|||
51
build/docker-bedrock-multistage.yml
Normal file
51
build/docker-bedrock-multistage.yml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
.docker-build:
|
||||
stage: build
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:v1.23.2-debug
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- /kaniko/executor
|
||||
--context "${CI_PROJECT_DIR}"
|
||||
--build-arg "GITLAB_USER=${CI_DEPLOY_USER}"
|
||||
--build-arg "GITLAB_PASSWORD=${CI_DEPLOY_PASSWORD}"
|
||||
--build-arg "APP_ACF_USER=${APP_ACF_USER}"
|
||||
--build-arg "APP_ACF_PWD=${APP_ACF_PWD}"
|
||||
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
|
||||
--destination "${IMAGE_TAG}"
|
||||
--cache=true
|
||||
--cache-ttl 24h
|
||||
allow_failure: false
|
||||
dependencies:
|
||||
- composer-security
|
||||
- npm-security
|
||||
needs:
|
||||
- job: composer-security
|
||||
optional: true
|
||||
- job: npm-security
|
||||
optional: true
|
||||
|
||||
docker-build:staging:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:s-${CI_COMMIT_SHA}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "trunk"
|
||||
allow_failure: true
|
||||
|
||||
|
||||
docker-build:latest:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:p-${CI_COMMIT_SHA}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"
|
||||
allow_failure: true
|
||||
|
||||
|
||||
docker-build:release:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
allow_failure: true
|
||||
|
|
@ -15,15 +15,6 @@
|
|||
- job: composer-build
|
||||
optional: true
|
||||
|
||||
|
||||
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"
|
||||
|
||||
|
||||
docker-build:staging:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
|
|
|
|||
50
build/docker-multistage.yml
Normal file
50
build/docker-multistage.yml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
.docker-build:
|
||||
stage: build
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:v1.23.2-debug
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- /kaniko/executor
|
||||
--context "${CI_PROJECT_DIR}"
|
||||
--build-arg "GITLAB_USER=${CI_DEPLOY_USER}"
|
||||
--build-arg "GITLAB_PASSWORD=${CI_DEPLOY_PASSWORD}"
|
||||
--build-arg "PHP_8_5_TAG=${PHP_8_5_TAG}"
|
||||
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
|
||||
--destination "${IMAGE_TAG}"
|
||||
--cache=true
|
||||
--cache-ttl 24h
|
||||
allow_failure: false
|
||||
dependencies:
|
||||
- composer-security
|
||||
- npm-security
|
||||
needs:
|
||||
- job: composer-security
|
||||
optional: true
|
||||
- job: npm-security
|
||||
optional: true
|
||||
|
||||
docker-build:staging:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:s-${CI_COMMIT_SHA}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "trunk"
|
||||
allow_failure: true
|
||||
|
||||
|
||||
docker-build:latest:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:p-${CI_COMMIT_SHA}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"
|
||||
allow_failure: true
|
||||
|
||||
|
||||
docker-build:release:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
allow_failure: true
|
||||
|
|
@ -18,21 +18,14 @@
|
|||
- job: composer-build
|
||||
optional: true
|
||||
|
||||
|
||||
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"
|
||||
|
||||
|
||||
docker-build:staging:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:s-${CI_COMMIT_SHA}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "trunk"
|
||||
when: manual
|
||||
allow_failure: true
|
||||
|
||||
|
||||
docker-build:latest:
|
||||
|
|
@ -41,6 +34,8 @@ docker-build:latest:
|
|||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:p-${CI_COMMIT_SHA}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"
|
||||
when: manual
|
||||
allow_failure: true
|
||||
|
||||
|
||||
docker-build:release:
|
||||
|
|
@ -48,4 +43,6 @@ docker-build:release:
|
|||
variables:
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
when: manual
|
||||
allow_failure: true
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
npm-build:
|
||||
stage: build
|
||||
image: node:18
|
||||
image: node:24
|
||||
before_script:
|
||||
- npm config set @ldc-web:registry https://${CI_SERVER_HOST}/api/v4/packages/npm/
|
||||
- npm config set -- '//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken' "${CI_DEPLOY_PASSWORD}"
|
||||
- npm config set @uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/
|
||||
- npm config set -- '//${CI_SERVER_HOST}/api/v4/groups/ldc-web/-/packages/npm/:_authToken' "${CI_DEPLOY_PASSWORD}"
|
||||
- npm install
|
||||
cache:
|
||||
paths:
|
||||
|
|
@ -21,6 +23,5 @@ npm-build:
|
|||
- job: npm-security
|
||||
optional: true
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"
|
||||
- if: $CI_COMMIT_TAG != null
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
variables:
|
||||
KUBERNETES_CLUSTER_NAME: prod-k8s-ldc-web
|
||||
KUBERNETES_VERSION: 1.29.2
|
||||
|
||||
.kubernetes:
|
||||
stage: deploy
|
||||
image:
|
||||
name: alpine/k8s:1.26.0
|
||||
name: "alpine/k8s:${KUBERNETES_VERSION}"
|
||||
entrypoint: ['']
|
||||
variables:
|
||||
KUBE_CONTEXT: ldc-web/cluster-k8s:k8s-ldc-web
|
||||
KUBE_CONTEXT: "ldc-web/cluster-k8s:${KUBERNETES_CLUSTER_NAME}"
|
||||
KUBE_NAMESPACE: default
|
||||
CRT_TLS_NAME: "wildcard-k8s-ldc"
|
||||
REDIRECT:
|
||||
before_script:
|
||||
- kubectl config use-context ${KUBE_CONTEXT}
|
||||
script:
|
||||
|
|
@ -19,34 +25,31 @@
|
|||
environment:
|
||||
action: stop
|
||||
|
||||
kubernetes:review:
|
||||
extends: .kubernetes
|
||||
variables:
|
||||
KUBE_NAMESPACE: review
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:review-${CI_MERGE_REQUEST_IID}"
|
||||
needs:
|
||||
- job: docker-build:review
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
when: manual
|
||||
environment:
|
||||
name: review/${CI_MERGE_REQUEST_IID}
|
||||
url: https://${DOMAIN}
|
||||
on_stop: kubernetes_stop:review
|
||||
|
||||
kubernetes_upgrade:review:
|
||||
extends: kubernetes:review
|
||||
script:
|
||||
- envsubst < manifest.yaml | kubectl set image --namespace ${KUBE_NAMESPACE} -f - ${CI_REGISTRY_IMAGE}=${IMAGE_TAG}
|
||||
# kubernetes:review:
|
||||
# extends: .kubernetes
|
||||
# variables:
|
||||
# KUBE_NAMESPACE: review
|
||||
# IMAGE_TAG: "${CI_REGISTRY_IMAGE}:review-${CI_MERGE_REQUEST_IID}"
|
||||
# needs:
|
||||
# - job: docker-build:review
|
||||
# rules:
|
||||
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
# when: manual
|
||||
# environment:
|
||||
# name: review/${CI_MERGE_REQUEST_IID}
|
||||
# url: https://${DOMAIN}
|
||||
# on_stop: kubernetes_stop:review
|
||||
|
||||
# kubernetes_stop:review:
|
||||
# extends: .kubernetes_stop
|
||||
# variables:
|
||||
# KUBE_NAMESPACE: review
|
||||
# rules:
|
||||
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
# environment:
|
||||
# name: review/${CI_MERGE_REQUEST_IID}
|
||||
|
||||
kubernetes_stop:review:
|
||||
extends: .kubernetes_stop
|
||||
variables:
|
||||
KUBE_NAMESPACE: review
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
environment:
|
||||
name: review/${CI_MERGE_REQUEST_IID}
|
||||
|
||||
kubernetes:staging:
|
||||
extends: .kubernetes
|
||||
|
|
@ -57,17 +60,15 @@ kubernetes:staging:
|
|||
- job: docker-build:staging
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "trunk"
|
||||
script:
|
||||
- envsubst < manifest.yaml | kubectl apply --namespace ${KUBE_NAMESPACE} -f -
|
||||
- envsubst < staging-resources.yaml | kubectl apply --namespace ${KUBE_NAMESPACE} -f -
|
||||
when: manual
|
||||
environment:
|
||||
name: staging
|
||||
url: https://${DOMAIN}
|
||||
on_stop: kubernetes_stop:staging
|
||||
|
||||
kubernetes_upgrade:staging:
|
||||
extends: kubernetes:staging
|
||||
script:
|
||||
- envsubst < manifest.yaml | kubectl set image --namespace ${KUBE_NAMESPACE} -f - ${CI_REGISTRY_IMAGE}=${IMAGE_TAG}
|
||||
|
||||
kubernetes_stop:staging:
|
||||
extends: .kubernetes_stop
|
||||
variables:
|
||||
|
|
@ -77,15 +78,21 @@ kubernetes_stop:staging:
|
|||
environment:
|
||||
name: staging
|
||||
|
||||
|
||||
kubernetes:prod:
|
||||
extends: .kubernetes
|
||||
variables:
|
||||
KUBE_NAMESPACE: production
|
||||
IMAGE_TAG: "${CI_REGISTRY_IMAGE}:p-${CI_COMMIT_SHA}"
|
||||
CRT_TLS_NAME: "${APP_DOMAIN}"
|
||||
REDIRECT: "www."
|
||||
needs:
|
||||
- job: docker-build:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"
|
||||
script:
|
||||
- envsubst < manifest.yaml | kubectl apply --namespace ${KUBE_NAMESPACE} -f -
|
||||
- envsubst < production-resources.yaml | kubectl apply --namespace ${KUBE_NAMESPACE} -f -
|
||||
when: manual
|
||||
environment:
|
||||
name: production
|
||||
|
|
@ -100,8 +107,3 @@ kubernetes:prod:
|
|||
# - if: $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"
|
||||
# environment:
|
||||
# name: production
|
||||
|
||||
kubernetes_upgrade:prod:
|
||||
extends: kubernetes:prod
|
||||
script:
|
||||
- envsubst < manifest.yaml | kubectl set image --namespace ${KUBE_NAMESPACE} -f - ${CI_REGISTRY_IMAGE}=${IMAGE_TAG}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
eslint:
|
||||
stage: lint
|
||||
image: node:18
|
||||
image: node:24
|
||||
before_script:
|
||||
- npm config set @ldc-web:registry https://${CI_SERVER_HOST}/api/v4/packages/npm/
|
||||
- npm config set -- '//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken' "${CI_DEPLOY_PASSWORD}"
|
||||
- npm config set @uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/
|
||||
- npm config set -- '//${CI_SERVER_HOST}/api/v4/groups/ldc-web/-/packages/npm/:_authToken' "${CI_DEPLOY_PASSWORD}"
|
||||
- npm install
|
||||
cache:
|
||||
paths:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,22 @@
|
|||
spec:
|
||||
inputs:
|
||||
larastan_bootstrap:
|
||||
default: false
|
||||
type: boolean
|
||||
db_connection:
|
||||
default: "sqlite"
|
||||
db_database:
|
||||
default: ":memory:"
|
||||
cache_store:
|
||||
default: "array"
|
||||
session_driver:
|
||||
default: "array"
|
||||
enable_rector:
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
---
|
||||
|
||||
include:
|
||||
- project: 'ldc-web/shared-ci'
|
||||
ref: 'main'
|
||||
|
|
@ -5,6 +24,17 @@ include:
|
|||
- project: 'ldc-web/shared-ci'
|
||||
ref: 'main'
|
||||
file: 'lint/phpstan.yml'
|
||||
inputs:
|
||||
larastan_bootstrap: $[[ inputs.larastan_bootstrap ]]
|
||||
db_connection: $[[ inputs.db_connection ]]
|
||||
db_database: $[[ inputs.db_database ]]
|
||||
cache_store: $[[ inputs.cache_store ]]
|
||||
session_driver: $[[ inputs.session_driver ]]
|
||||
- project: "ldc-web/shared-ci"
|
||||
ref: "main"
|
||||
file: "lint/rector.yml"
|
||||
inputs:
|
||||
enable_rector: $[[ inputs.enable_rector ]]
|
||||
- project: 'ldc-web/shared-ci'
|
||||
ref: 'main'
|
||||
file: 'lint/eslint.yml'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
phpcs:
|
||||
stage: lint
|
||||
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa-8.2:latest
|
||||
image: composer:2.10
|
||||
before_script:
|
||||
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
|
||||
- composer install --no-scripts
|
||||
|
|
|
|||
|
|
@ -1,9 +1,40 @@
|
|||
spec:
|
||||
inputs:
|
||||
larastan_bootstrap:
|
||||
default: false
|
||||
type: boolean
|
||||
db_connection:
|
||||
default: "sqlite"
|
||||
db_database:
|
||||
default: ":memory:"
|
||||
cache_store:
|
||||
default: "array"
|
||||
session_driver:
|
||||
default: "array"
|
||||
|
||||
---
|
||||
|
||||
phpstan:
|
||||
stage: lint
|
||||
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa-8.2:latest
|
||||
image: composer:2.10
|
||||
cache:
|
||||
key: phpstan-cache-${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- vendor/
|
||||
- .phpstan-cache/
|
||||
variables:
|
||||
DB_CONNECTION: "$[[ inputs.db_connection ]]"
|
||||
DB_DATABASE: "$[[ inputs.db_database ]]"
|
||||
CACHE_STORE: "$[[ inputs.cache_store ]]"
|
||||
SESSION_DRIVER: "$[[ inputs.session_driver ]]"
|
||||
before_script:
|
||||
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
|
||||
- composer install --no-scripts
|
||||
- composer install --no-scripts --no-interaction
|
||||
- |
|
||||
if [ "$[[ inputs.larastan_bootstrap ]]" = "true" ]; then
|
||||
cp .env.example .env
|
||||
php artisan key:generate
|
||||
fi
|
||||
script:
|
||||
- vendor/bin/phpstan --error-format=junit > phpstan-report.xml
|
||||
artifacts:
|
||||
|
|
|
|||
31
lint/rector.yml
Normal file
31
lint/rector.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
spec:
|
||||
inputs:
|
||||
enable_rector:
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
---
|
||||
|
||||
rector:
|
||||
stage: lint
|
||||
image: composer:2.10
|
||||
cache:
|
||||
key: rector-cache-$CI_COMMIT_REF_SLUG
|
||||
paths:
|
||||
- vendor/
|
||||
- .rector-cache/
|
||||
before_script:
|
||||
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
|
||||
- composer install --no-scripts --no-interaction
|
||||
script:
|
||||
- vendor/bin/rector process --dry-run --no-progress-bar --output-format=junit > rector-report.xml
|
||||
artifacts:
|
||||
when: always
|
||||
expose_as: 'rector'
|
||||
paths:
|
||||
- rector-report.xml
|
||||
reports:
|
||||
junit: rector-report.xml
|
||||
allow_failure: true
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && "$[[ inputs.enable_rector ]]" == "true"'
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
stylelint:
|
||||
stage: lint
|
||||
image: node:18
|
||||
image: node:24
|
||||
before_script:
|
||||
- npm config set @ldc-web:registry https://${CI_SERVER_HOST}/api/v4/packages/npm/
|
||||
- npm config set -- '//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken' "${CI_DEPLOY_PASSWORD}"
|
||||
- npm config set @uwil:registry=https://lab.s-web.fr/api/v4/groups/ldc-web/-/packages/npm/
|
||||
- npm config set -- '//${CI_SERVER_HOST}/api/v4/groups/ldc-web/-/packages/npm/:_authToken' "${CI_DEPLOY_PASSWORD}"
|
||||
- npm install
|
||||
cache:
|
||||
paths:
|
||||
|
|
@ -18,4 +20,4 @@ stylelint:
|
|||
allow_failure: false
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_COMMIT_BRANCH == "develop"
|
||||
- if: $CI_COMMIT_BRANCH == "develop"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
composer-security:
|
||||
stage: security
|
||||
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa-8.2:latest
|
||||
image: composer:2.10
|
||||
before_script:
|
||||
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
|
||||
script:
|
||||
- local-php-security-checker --format=json --path=./composer.lock > composer-security-checker-report.json
|
||||
- composer audit --locked --format=json > composer-security-checker-report.json || true
|
||||
artifacts:
|
||||
when: on_failure
|
||||
expose_as: 'composer-security-checker'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
npm-security:
|
||||
stage: security
|
||||
image: node:17.9.1
|
||||
image: node:24
|
||||
before_script:
|
||||
- npm install --location=global audit-ci@^6
|
||||
script:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue