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

replace worker template by a more flexible approach #82

Merged
merged 12 commits into from
Oct 26, 2021
Prev Previous commit
Next Next commit
refactoring
  • Loading branch information
Jens Thielscher committed Oct 20, 2021
commit 1a610a00cae5b620a9e0aa95433194b3535ebf08
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,12 @@ private static void migrateJobTemplate(NomadWorkerTemplate template, String jenk
String jobTemplate = getFieldValue(template, "jobTemplate");

if (StringUtils.isEmpty(jobTemplate)) {
j3t marked this conversation as resolved.
Show resolved Hide resolved
jobTemplate = createJobTemplate(template, jenkinsUrl, jenkinsTunnel, workerUrl);
jobTemplate = buildWorkerJob("%WORKER_NAME%", "%WORKER_SECRET%", jenkinsUrl, jenkinsTunnel, workerUrl, template);

setFieldValue(template, "jobTemplate", jobTemplate);
}
}

private static String createJobTemplate(NomadWorkerTemplate template, String jenkinsUrl, String jenkinsTunnel, String workerUrl) {
return buildWorkerJob("%WORKER_NAME%", "%WORKER_SECRET%", jenkinsUrl, jenkinsTunnel, workerUrl, template);
}

/**
* This is basically a copy of the old NomadApi#buildWorkerJob method (plugin version < 0.8.0).
*/
Expand Down