Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multijob missing parameter: substitute name #187

Open
Tocard opened this issue Jul 8, 2019 · 0 comments
Open

Multijob missing parameter: substitute name #187

Tocard opened this issue Jul 8, 2019 · 0 comments

Comments

@Tocard
Copy link

Tocard commented Jul 8, 2019

Hi,

We have a factory who allow us to use the same jobs into a multijob n time for n different env.

this is a "short example of the multijob"

      executionType('PARALLEL')
      phaseJob('DEV/reporter_launcher') {
        currentJobParameters(true)
        parameters {
          predefinedProp('PROJECT', 'name')
          predefinedProp('STACK', 'Z')
          predefinedProp('HOST', 'E')
          predefinedProp('ENV_DEPLOY', 'C')
          predefinedProp('INVENTORY', 'X')
        }
        configure {
          phaseJobConfig ->
            phaseJobConfig / enableCondition << 'true'
            phaseJobConfig / condition << '${DEPLOY_HERE} == true && ${DEPLOY_STACK} == true && ${DEPLOY_C} == true'
        }
      }
      phaseJob('DEV/reporter_launcher') {
        currentJobParameters(true)
        parameters {
          predefinedProp('PROJECT', 'name')
          predefinedProp('STACK', 'Z')
          predefinedProp('HOST', 'E')
          predefinedProp('ENV_DEPLOY', 'B')
          predefinedProp('INVENTORY', 'X')
        }
        configure {
          phaseJobConfig ->
            phaseJobConfig / enableCondition << 'true'
            phaseJobConfig / condition << '${DEPLOY_HERE} == true && ${DEPLOY_STACK} == true && ${DEPLOY_B == true'
        }
      }
      phaseJob('DEV/reporter_launcher') {
        currentJobParameters(true)
        parameters {
          predefinedProp('PROJECT', 'name')
          predefinedProp('STACK', 'Z')
          predefinedProp('HOST', 'E')
          predefinedProp('ENV_DEPLOY', 'A')
          predefinedProp('INVENTORY', 'X')
        }
        configure {
          phaseJobConfig ->
            phaseJobConfig / enableCondition << 'true'
            phaseJobConfig / condition << '${DEPLOY_HERE} == true && ${DEPLOY_STACK} == true && ${DEPLOY_A} == true'
        }
      }
    }

the output is like something like that

    >> Job status: [reporter_launcher] the 'build only if scm changes' feature is disabled.
Triggering reporter_launcher. Condition was evaluated to true.
Starting build job DEV/reporter_launcher.
Finished Build : #84 of Job : DEV/reporter_launcher with status : SUCCESS
Finished Build : #83 of Job : DEV/reporter_launcher with status : SUCCESS
    >> Job status: [functional_testing] the 'build only if scm changes' feature is disabled.
Starting build job DEV/functional_testing.
Finished Build : #15 of Job : DEV/functional_testing with status : SUCCESS
    >> Job status: [galaxy_release] the 'build only if scm changes' feature is disabled.
Triggering galaxy_release. Condition was evaluated to true.

All link work perfectly, however, it should be very nice to be able to substiture the real job's link name by a given pameter like

        phaseUrl("Run of reporter_launcher on B with X ...")
 parameters {
          predefinedProp('PROJECT', 'name')
          predefinedProp('STACK', 'Z')
          predefinedProp('HOST', 'E')
          predefinedProp('ENV_DEPLOY', 'B')
          predefinedProp('INVENTORY', 'X')
        }
}

who would give something more pretty and accurate

    >> Job status: [reporter_launcher] the 'build only if scm changes' feature is disabled.
Triggering reporter_launcher. Condition was evaluated to true.
Starting build job Run of reporter_launcher on A with X.
Finished Build : #84 of Job : Run of reporter_launcher on B with X with status : SUCCESS
Finished Build : #83 of Job : Run of reporter_launcher on A with X with status : SUCCESS
    >> Job status: [functional_testing] the 'build only if scm changes' feature is disabled.
Starting build job DEV/functional_testing.
Finished Build : #15 of Job : DEV/functional_testing with status : SUCCESS
    >> Job status: [galaxy_release] the 'build only if scm changes' feature is disabled.
Triggering galaxy_release. Condition was evaluated to true.

We have found this on the code implemented in 1.30, but that is still not a simple parameter and i don't understand why ( if someone could explain those kind of configuration, i would love it =) 🐻

if (phaseConfig.getEnableCondition() && phaseConfig.getCondition() != null) {
            	String subJobDisplayName = subJob.getName();
            	if (phaseConfig.getJobAlias() != null && !phaseConfig.getJobAlias().equals("")) {
            		subJobDisplayName += " (" + phaseConfig.getJobAlias() + ")";
				}

This code can provide something like jobName + alias, however alias is enough if it's specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant