diff --git a/checkstyle.xml b/checkstyle.xml index 059f0e7..3c35ea1 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -43,7 +43,7 @@ Checkstyle configuration that checks coding conventions. - + diff --git a/pom.xml b/pom.xml index 9267ec0..6653ab4 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.jenkins-ci.plugins plugin - 1.554.3 + 1.580.1 org.jenkins-ci.plugins diff --git a/src/main/java/hudson/plugins/repo/RepoScm.java b/src/main/java/hudson/plugins/repo/RepoScm.java index 057dd40..acfbfe9 100644 --- a/src/main/java/hudson/plugins/repo/RepoScm.java +++ b/src/main/java/hudson/plugins/repo/RepoScm.java @@ -94,6 +94,7 @@ public class RepoScm extends SCM implements Serializable { private boolean forceSync; private final boolean trace; private final boolean showAllChanges; + private boolean noTags; /** * Returns the manifest repository URL. @@ -254,6 +255,11 @@ public boolean isForceSync() { */ @Exported public boolean isTrace() { return trace; } + /** + * Returns the value of noTags. + */ + @Exported + public boolean isNoTags() { return noTags; } /** * The constructor takes in user parameters and sets them. Each job using @@ -348,6 +354,18 @@ public void setForceSync(final boolean forceSync) { this.forceSync = forceSync; } + /** + * Set noTags. + * + * @param noTags + * If this value is true, add the "--no-tags" option when + * executing "repo sync". + */ + @DataBoundSetter + public final void setNoTags(final boolean noTags) { + this.noTags = noTags; + } + @Override public SCMRevisionState calcRevisionsFromBuild( final AbstractBuild, ?> build, final Launcher launcher, @@ -488,6 +506,10 @@ private int doSync(final Launcher launcher, final FilePath workspace, if (jobs > 0) { commands.add("--jobs=" + jobs); } + if (isNoTags()) { + commands.add("--no-tags"); + } + int returnCode = launcher.launch().stdout(logger).pwd(workspace) .cmds(commands).envs(env).join(); diff --git a/src/main/java/hudson/plugins/repo/TagAction.java b/src/main/java/hudson/plugins/repo/TagAction.java index 36575ef..1b80287 100644 --- a/src/main/java/hudson/plugins/repo/TagAction.java +++ b/src/main/java/hudson/plugins/repo/TagAction.java @@ -23,7 +23,7 @@ */ package hudson.plugins.repo; -import hudson.model.AbstractBuild; +import hudson.model.Run; import hudson.scm.AbstractScmTagAction; import org.kohsuke.stapler.export.ExportedBean; @@ -42,7 +42,7 @@ public class TagAction extends AbstractScmTagAction { * @param build * Build which we are interested in tagging */ - TagAction(final AbstractBuild, ?> build) { + TagAction(final Run, ?> build) { super(build); } diff --git a/src/main/resources/hudson/plugins/repo/RepoScm/config.jelly b/src/main/resources/hudson/plugins/repo/RepoScm/config.jelly index 202cf01..f09d440 100644 --- a/src/main/resources/hudson/plugins/repo/RepoScm/config.jelly +++ b/src/main/resources/hudson/plugins/repo/RepoScm/config.jelly @@ -60,6 +60,10 @@ + + + + diff --git a/src/main/webapp/help-noTags.html b/src/main/webapp/help-noTags.html new file mode 100644 index 0000000..5567c7f --- /dev/null +++ b/src/main/webapp/help-noTags.html @@ -0,0 +1,6 @@ + + + Don't fetch tags. + This is passed to repo as repo sync --no-tags. + +
+ Don't fetch tags. + This is passed to repo as repo sync --no-tags. +
repo sync --no-tags