| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- stages:
- - build
- - test
- - analysis
- variables:
- APP_ENV: ci
- GIT_CLEAN_FLAGS: -ffd
- YARN_ENABLE_GLOBAL_CACHE: 'false'
- YARN_ENABLE_TELEMETRY: 'false'
- cache:
- key: ${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}
- paths:
- - ./node_modules
- build_image:
- stage: build
- image: docker:20.10
- before_script:
- - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- script:
- - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
- - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
- - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- - docker push $CI_REGISTRY_IMAGE:latest
- .default_config: &default_config
- image: $CI_REGISTRY_IMAGE:latest
- before_script:
- #- rm -rf node_modules/ .yarn/ || true
- - echo "" > ./env/local.app.opentalent.fr.crt
- - echo "" > ./env/local.app.opentalent.fr.key
- - yarn install --frozen-lockfile --network-timeout 60000
- - HOSTNAME=ci yarn prepare
- unit:
- <<: *default_config
- stage: test
- script:
- - yarn test
- artifacts:
- paths:
- - ./coverage/
- when: always
- reports:
- junit: coverage/junit.xml
- coverage_report:
- coverage_format: cobertura
- path: coverage/cobertura-coverage.xml
- # Extract total coverage from job logs (https://docs.gitlab.com/15.6/ee/ci/yaml/index.html#coverage)
- coverage: '/All files\s*|\s*\d+\.\d+/'
- code_quality:
- <<: *default_config
- stage: analysis
- script:
- - yarn eslint
- code_style:
- <<: *default_config
- stage: analysis
- script:
- - yarn prettier . --check
|