-
Notifications
You must be signed in to change notification settings - Fork 49
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
Revert unix command to command to prevend breaking changes #127
base: master
Are you sure you want to change the base?
Conversation
2cc4db6
to
ab8dd92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker-swarm-plugin/src/main/java/org/jenkinsci/plugins/docker/swarm/DockerSwarmAgentTemplate.java
Line 38 in ab8dd92
private String unixCommand; |
$JENKINS_HOME/config.xml
. (You can use @LocalData
to test this sort of thing by the way.) configuration-as-code
users on the other hand will need docker-swarm-plugin/src/main/java/org/jenkinsci/plugins/docker/swarm/DockerSwarmAgentTemplate.java
Line 265 in ab8dd92
public String getUnixCommand() { |
As an aside, similar to https://www.jenkins.io/doc/developer/plugin-development/pipeline-integration/#constructor-vs-setters it is recommended to limit @DataBoundConstructor
parameters to those fields which are obligatory (no sensible default could be provided), and use @DataBoundSetter
for everything else. If you do this right, config.xml
can avoid serializing fields unmodified from their default, and JCasC users will need only set interesting fields (and exporting JCasC YAML will display only those fields which were really edited).
<f:entry title="Unix Command" field="unixCommand"> | ||
<f:textarea value="${dockerSwarmAgentTemplate.unixCommand}" default="sh -cx curl --connect-timeout 20 --max-time 60 -o agent.jar $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL && java -classpath agent.jar hudson.remoting.jnlp.Main -headless -url $DOCKER_SWARM_PLUGIN_JENKINS_URL -noreconnect -workDir /tmp $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_NAME"/> | ||
<f:entry title="Unix Command" field="command"> | ||
<f:textarea value="${dockerSwarmAgentTemplate.command}" default="sh -cx curl --connect-timeout 20 --max-time 60 -o agent.jar $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL && java -classpath agent.jar hudson.remoting.jnlp.Main -headless -url $DOCKER_SWARM_PLUGIN_JENKINS_URL -noreconnect -workDir /tmp $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_NAME"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way just
<f:textarea value="${dockerSwarmAgentTemplate.command}" default="sh -cx curl --connect-timeout 20 --max-time 60 -o agent.jar $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL && java -classpath agent.jar hudson.remoting.jnlp.Main -headless -url $DOCKER_SWARM_PLUGIN_JENKINS_URL -noreconnect -workDir /tmp $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_NAME"/> | |
<f:textarea default="sh -cx curl --connect-timeout 20 --max-time 60 -o agent.jar $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_JAR_URL && java -classpath agent.jar hudson.remoting.jnlp.Main -headless -url $DOCKER_SWARM_PLUGIN_JENKINS_URL -noreconnect -workDir /tmp $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_SECRET $DOCKER_SWARM_PLUGIN_JENKINS_AGENT_NAME"/> |
should work (same for other properties): the point of the field
attr on f:entry
is that it takes care of the plumbing needed for config form round-trips so long as you are consistent in your naming.
Stalled? |
Revert an incompatible change from #118