The Unified and Autonomous Development Platform
Move service to dependencies & services group. Use Dns name for service name
Robin Shen0959799c3a2e
diff --git a/server-core/src/main/java/io/onedev/server/ci/job/Job.java b/server-core/src/main/java/io/onedev/server/ci/job/Job.javaindex b9520a0c2c..9526b0cc31 100644--- a/server-core/src/main/java/io/onedev/server/ci/job/Job.java+++ b/server-core/src/main/java/io/onedev/server/ci/job/Job.java@@ -75,14 +75,14 @@ public class Job implements Serializable, Validatable {private List<ProjectDependency> projectDependencies = new ArrayList<>();+ private List<JobService> services = new ArrayList<>();+private String artifacts;private List<JobReport> reports = new ArrayList<>();private List<JobTrigger> triggers = new ArrayList<>();- private List<JobService> services = new ArrayList<>();-private List<CacheSpec> caches = new ArrayList<>();private String cpuRequirement = "500m";@@ -227,7 +227,7 @@ public class Job implements Serializable, Validatable {return (boolean) EditContext.get().getInputValue("retrieveSource");}- @Editable(name="Job Dependencies", order=9110, group="Dependencies", description="Job dependencies determines the order and "+ @Editable(name="Job Dependencies", order=9110, group="Dependencies & Services", description="Job dependencies determines the order and "+ "concurrency when run different jobs. You may also specify artifacts to retrieve from upstream jobs")@Validpublic List<JobDependency> getJobDependencies() {@@ -238,7 +238,7 @@ public class Job implements Serializable, Validatable {this.jobDependencies = jobDependencies;}- @Editable(name="Project Dependencies", order=9113, group="Dependencies", description="Use project dependency to retrieve "+ @Editable(name="Project Dependencies", order=9112, group="Dependencies & Services", description="Use project dependency to retrieve "+ "artifacts from other projects")@Validpublic List<ProjectDependency> getProjectDependencies() {@@ -249,6 +249,16 @@ public class Job implements Serializable, Validatable {this.projectDependencies = projectDependencies;}+ @Editable(order=9114, group="Dependencies & Services", description="Optionally define services used by this job")+ @Valid+ public List<JobService> getServices() {+ return services;+ }++ public void setServices(List<JobService> services) {+ this.services = services;+ }+@Editable(order=9115, group="Artifacts & Reports", description="Optionally specify files to publish as job artifacts. "+ "Artifact files are relative to OneDev workspace, and may use * or ? for pattern match. "+ "<b>Note:</b> Type <tt>@</tt> to <a href='https://github.com/theonedev/onedev/wiki/Variable-Substitution' tabindex='-1'>insert variable</a>, use <tt>\\</tt> to escape normal occurrences of <tt>@</tt> or <tt>\\</tt>")@@ -330,16 +340,6 @@ public class Job implements Serializable, Validatable {this.memoryRequirement = memoryRequirement;}- @Editable(order=10000, group="More Settings", description="Optionally define services used by this job")- @Valid- public List<JobService> getServices() {- return services;- }-- public void setServices(List<JobService> services) {- this.services = services;- }-@Editable(order=10100, group="More Settings", description="Cache specific paths to speed up job execution. For instance for node.js "+ "projects, you may cache the <tt>node_modules</tt> folder to avoid downloading node modules for "+ "subsequent job executions. Note that cache is considered as a best-effort approach and your "diff --git a/server-core/src/main/java/io/onedev/server/ci/job/JobService.java b/server-core/src/main/java/io/onedev/server/ci/job/JobService.javaindex 2ab8c8d4f5..5972090bdc 100644--- a/server-core/src/main/java/io/onedev/server/ci/job/JobService.java+++ b/server-core/src/main/java/io/onedev/server/ci/job/JobService.java@@ -7,7 +7,7 @@ import java.util.List;import org.hibernate.validator.constraints.NotEmpty;import io.onedev.commons.codeassist.InputSuggestion;-import io.onedev.server.util.validation.annotation.VariableName;+import io.onedev.server.util.validation.annotation.DnsName;import io.onedev.server.web.editable.annotation.Editable;import io.onedev.server.web.editable.annotation.Interpolative;@@ -30,10 +30,10 @@ public class JobService implements Serializable {private String memoryRequirement = "128m";- @Editable(order=100, description="Specify name of the service, which can be used to access "+ @Editable(order=100, description="Specify name of the service, which will be used as host name to access "+ "the service. <b>Note:</b> Type <tt>@</tt> to <a href='https://github.com/theonedev/onedev/wiki/Variable-Substitution' tabindex='-1'>insert variable</a>, use <tt>\\</tt> to escape normal occurrences of <tt>@</tt> or <tt>\\</tt>")@Interpolative(variableSuggester="suggestVariables")- @VariableName(interpolative = true)+ @DnsName(interpolative = true)@NotEmptypublic String getName() {return name;