opendevstack / ods-jenkins-shared-library

Shared Jenkins library which all ODS projects & components use - provisioning, SonarQube code scanning, Nexus publishing, OpenShift template based deployments and repository orchestration
Apache License 2.0
75 stars 57 forks source link

InfrastructureStage (org.ods.component) does not honor branchToEnvironmentMapping #1076

Open serverhorror opened 8 months ago

serverhorror commented 8 months ago

Describe the bug

org.ods.component.InfrastructureStage will always run (at least) make test regardless of branchToEnvironmentMapping.

To Reproduce Steps to reproduce the behavior:

  1. Create any component that has type: ods-infra
  2. Create a branch with any random name
  3. have one of the following in Jenkinsfile
    odsComponentStageInfrastructure(context, [cloudProvider: 'AWS'])
    odsComponentStageInfrastructure(context, [cloudProvider: 'Azure'])
  4. Have this in your Jenkinsfile
    branchToEnvironmentMapping: [
    'master': 'dev',
    ],
  5. git commit and push
  6. This will try and run make test

Expected behavior

This should honor branchToEnvironmentMapping and either stop, if it is not matching, or build if it is matching.

Screenshots

Affected version (please complete the following information):