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

Fix generation of repos using -DhostOnJenkinsGitHub=false #710

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common-files/archetype-post-generate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ if (properties.get("hostOnJenkinsGitHub") == "false") {
'.github',
]
filesToRemove.each {
new File(it, projectPath.toFile()).delete()
projectPath.resolve(it).toFile().delete()
}
directoriesToRemove.each {
new File(it, projectPath.toFile()).deleteDir()
projectPath.resolve(it).toFile().deleteDir()
}
}

Expand Down
18 changes: 10 additions & 8 deletions empty-plugin/src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,30 @@
<packaging>hpi</packaging>

<name>TODO Plugin</name>
#if( $hostOnJenkinsGitHub == "true" )<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>#end

#if( $hostOnJenkinsGitHub == "true" )<licenses>
#if( $hostOnJenkinsGitHub == "true" )
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/license/mit/</url>
</license>
</licenses>#end

#if( $hostOnJenkinsGitHub == "true" )<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
</licenses>
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
<tag>${scmTag}</tag>
<url>https://github.com/${gitHubRepo}</url>
</scm>#end
</scm>
#end

<properties>
<revision>1.0</revision>
<changelist>-SNAPSHOT</changelist>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.version>2.414.3</jenkins.version>
#if( $hostOnJenkinsGitHub == "true" )<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>#end
#if( $hostOnJenkinsGitHub == "true" )
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
#end

<spotless.check.skip>false</spotless.check.skip>
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
groupId=IGNORED
artifactId=testArtifact
version=1.0-SNAPSHOT
package=IGNORED
hostOnJenkinsGitHub=false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install -ntp
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,30 @@
<packaging>hpi</packaging>

<name>TODO Plugin</name>
#if( $hostOnJenkinsGitHub == "true" )<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>#end

#if( $hostOnJenkinsGitHub == "true" )<licenses>
#if( $hostOnJenkinsGitHub == "true" )
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/license/mit/</url>
</license>
</licenses>#end

#if( $hostOnJenkinsGitHub == "true" )<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
</licenses>
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
<tag>${scmTag}</tag>
<url>https://github.com/${gitHubRepo}</url>
</scm>#end
</scm>
#end

<properties>
<revision>1.0</revision>
<changelist>-SNAPSHOT</changelist>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.version>2.414.3</jenkins.version>
#if( $hostOnJenkinsGitHub == "true" )<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>#end
#if( $hostOnJenkinsGitHub == "true" )
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
#end

<spotless.check.skip>false</spotless.check.skip>
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
groupId=IGNORED
artifactId=testArtifact
version=1.0-SNAPSHOT
package=io.jenkins.plugins.sample
hostOnJenkinsGitHub=false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install -ntp
18 changes: 10 additions & 8 deletions hello-world/src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,31 @@
<packaging>hpi</packaging>

<name>TODO Plugin</name>
#if( $hostOnJenkinsGitHub == "true" )<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>#end

#if( $hostOnJenkinsGitHub == "true" )<licenses>
#if( $hostOnJenkinsGitHub == "true" )
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/license/mit/</url>
</license>
</licenses>#end

#if( $hostOnJenkinsGitHub == "true" )<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
</licenses>
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
<tag>${scmTag}</tag>
<url>https://github.com/${gitHubRepo}</url>
</scm>#end
</scm>
#end

<properties>
<revision>1.0</revision>
<changelist>-SNAPSHOT</changelist>

<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.version>2.414.3</jenkins.version>
#if( $hostOnJenkinsGitHub == "true" )<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>#end
#if( $hostOnJenkinsGitHub == "true" )
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
#end

<spotless.check.skip>false</spotless.check.skip>
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
groupId=IGNORED
artifactId=testArtifact
version=1.0-SNAPSHOT
package=io.jenkins.plugins.sample
hostOnJenkinsGitHub=false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install -ntp