Skip to content
Snippets Groups Projects
Select Git revision
  • 1583a5f6e2d2ff69514097e91ecfdc0440ffc33a
  • master default protected
  • 3.6
  • 3.5
  • 3.5.1
  • 3.5.0
6 results

gitlab-ci-bash.yml

Blame
  • gitlab-ci-bash.yml 15.17 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.
    # =========================================================================================
    spec:
      inputs:
        shellcheck-disabled:
          description: Disable ShellCheck
          type: boolean
          default: false
        shellcheck-image:
          description: The Docker image used to run [ShellCheck](https://github.com/koalaman/shellcheck)
          default: registry.hub.docker.com/koalaman/shellcheck-alpine:stable
        shellcheck-files:
          description: Shell file(s) or pattern(s) to analyse
          default: '**/*.sh'
        shellcheck-opts:
          description: ShellCheck [options](https://github.com/koalaman/shellcheck/blob/master/shellcheck.1.md)
          default: ''
        bats-enabled:
          description: Enable Bats
          type: boolean
          default: false
        bats-image:
          description: The Docker image used to run [Bats](https://hub.docker.com/r/bats/bats)
          default: registry.hub.docker.com/bats/bats:latest
        bats-tests:
          description: The path to a Bats test file, or the path to a directory containing Bats test files
          default: tests
        bats-opts:
          description: Bats [options](https://bats-core.readthedocs.io/en/stable/usage.html)
          default: ''
        bats-libraries:
          description: |-
            Coma separated list of Bats [libraries and add-ons](https://bats-core.readthedocs.io/en/stable/writing-tests.html#libraries-and-add-ons)
    
            Formatted as: `lib_name_1@archive_url_1 lib_name_2@archive_url_2 ...`
    
            Example: `bats-support@https://github.com/bats-core/bats-support/archive/v0.3.0.zip bats-assert@https://github.com/bats-core/bats-assert/archive/v2.0.0.zip`
          default: ''
        bash-shellcheck-job-tags:
          description: tags to filter applicable runners for bash-shellcheck job
          type: array
          default: []
    
    ---
    # default workflow rules: Merge Request pipelines
    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