Commit 7df66243 authored by Cédric OLIVIER's avatar Cédric OLIVIER
Browse files

Merge branch '5-switch-to-renovate-component' into 'main'

Resolve "switch to renovate component"

Closes #5

See merge request to-be-continuous/tools/renovate!6
parents f430792a a33e5e1a
Loading
Loading
Loading
Loading
+3 −65
Original line number Diff line number Diff line
include:
  # include the component
  - component: $CI_SERVER_FQDN/to-be-continuous/renovate/gitlab-ci-renovate@1.3.0
stages:
  - build
  - test

variables:
  RENOVATE_IMAGE: "registry.hub.docker.com/renovate/renovate:latest"
  RENOVATE_BASE_DIR: $CI_PROJECT_DIR/renovate
  RENOVATE_ENDPOINT: $CI_API_V4_URL
  
  RENOVATE_LOG_FILE: renovate-log.ndjson
  RENOVATE_AUTODISCOVER_FILTER: '${CI_PROJECT_ROOT_NAMESPACE}/**'
  RENOVATE_BINARY_SOURCE: install
  RENOVATE_LOG_FILE_LEVEL: debug
  LOG_LEVEL: info


workflow:
  rules:
    # exclude merge requests
    - if: $CI_MERGE_REQUEST_ID
      when: never
    # run the pipeline in other cases
    - when: always
.renovate-base:
  image: $RENOVATE_IMAGE
  # Cache downloaded dependencies and plugins between builds.
  # To keep cache across branches add 'key: "$CI_JOB_NAME"'
  # TODO (if necessary): define cache policy here
  cache:
    key: ${CI_COMMIT_REF_SLUG}-renovate
    paths:
      - renovate/cache/renovate/**


# (example) validator job
renovate-validator:
  extends: .renovate-base
  stage: build
  # force no dependency
  dependencies: []
  script:
    - renovate-config-validator

# dependency check job: on manual or schedule (dry-run otherwise)
renovate-depcheck:
  extends: .renovate-base
  stage: test
  # force no dependency
  dependencies: []
  variables:
    # dry-run by default
    RENOVATE_DRY_RUN: "true"
  script:
    - renovate $RENOVATE_EXTRA_FLAGS
  artifacts:
    when: always
    expire_in: 1d
    paths:
      - "$RENOVATE_LOG_FILE"
  rules:
    # not dry run on manual or schedule
    - if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
      variables:
        RENOVATE_DRY_RUN: "false"
    - if: $RENOVATE_TOKEN