Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • 1
  • 1.5
  • 1.5.0
  • 1.4
  • 1.4.1
  • 1.4.0
  • 1.3
  • 1.3.0
  • 1.2
  • 1.2.2
  • 1.2.1
12 results

gitlab-ci-renovate.yml

Blame
  • gitlab-ci-renovate.yml 11.96 KiB
    # =========================================================================================
    # Copyright (C) 2021 Orange & contributors
    #
    # This program is free software; you can redistribute it and/or modify it under the terms
    # of the GNU Lesser General Public License as published by the Free Software Foundation;
    # either version 3 of the License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    # See the GNU Lesser General Public License for more details.
    #
    # You should have received a copy of the GNU Lesser General Public License along with this
    # program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
    # Floor, Boston, MA  02110-1301, USA.
    # =========================================================================================
    # default workflow rules: Merge Request pipelines
    spec:
      inputs:
        image:
          description: The Docker image used to run Renovate
          default: registry.hub.docker.com/renovate/renovate:latest
    ---
    workflow:
      rules:
        # prevent MR pipeline originating from production or integration branch(es)
        - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $PROD_REF || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ $INTEG_REF'
          when: never
        # on non-prod, non-integration branches: prefer MR pipeline over branch pipeline
        - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'
          when: never
        - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*tag(,[^],]*)*\]/" && $CI_COMMIT_TAG'
          when: never
        - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*branch(,[^],]*)*\]/" && $CI_COMMIT_BRANCH'
          when: never
        - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*mr(,[^],]*)*\]/" && $CI_MERGE_REQUEST_ID'
          when: never
        - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*default(,[^],]*)*\]/" && $CI_COMMIT_REF_NAME =~ $CI_DEFAULT_BRANCH'
          when: never
        - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*prod(,[^],]*)*\]/" && $CI_COMMIT_REF_NAME =~ $PROD_REF'
          when: never
        - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*integ(,[^],]*)*\]/" && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
          when: never
        - if: '$CI_COMMIT_MESSAGE =~ "/\[(ci skip|skip ci) on ([^],]*,)*dev(,[^],]*)*\]/" && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'
          when: never
        - when: always
    
    
    variables:
      # variabilized tracking image
      TBC_TRACKING_IMAGE: registry.gitlab.com/to-be-continuous/tools/tracking:master
    
      RENOVATE_IMAGE: $[[ inputs.image ]]
    
      # those are native Renovate configuration variables
      # see: https://docs.renovatebot.com/self-hosted-configuration
      RENOVATE_PLATFORM: gitlab
      RENOVATE_ENDPOINT: $CI_API_V4_URL
      RENOVATE_AUTODISCOVER_FILTER: ${CI_PROJECT_ROOT_NAMESPACE}/**
      RENOVATE_REGISTRY_ALIASES: "{\"$$CI_SERVER_FQDN\": \"$CI_SERVER_FQDN\"}"
      RENOVATE_BINARY_SOURCE: install
      # see: https://docs.renovatebot.com/config-overview/#logging-variables
      RENOVATE_LOG_FILE: renovate-log.ndjson
      RENOVATE_LOG_FILE_LEVEL: debug
      LOG_LEVEL: info
    
    .renovate-scripts: &renovate-scripts |
      # BEGSCRIPT
      set -e
    
      function log_info() {