Skip to content

Commit

Permalink
Make the newApi task play well with docker subprojects (#6331)
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaydewan authored and bdpiprava committed May 27, 2019
1 parent 448867a commit 6c323cd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1162,9 +1162,11 @@ task newApi {
out.println("")
out.println("rootProject.name = 'gocd'")
out.println("")
def existingProjects = rootProject.allprojects.findAll { prj -> prj.childProjects.isEmpty() }.collect { it.path }
def existingProjects = rootProject.allprojects.findAll { prj -> prj.childProjects.isEmpty() && !prj.path.startsWith(":docker") }.collect { it.path }
def newProjects = existingProjects + [":api:${newProjectName}"]
newProjects.sort().unique().each { out.println "include '${it}'" }
out.println("")
out.println("apply from: 'settings-docker.gradle'")
}

file('.gitignore').withWriterAppend { out ->
Expand Down
27 changes: 27 additions & 0 deletions settings-docker.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2019 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import com.thoughtworks.go.build.docker.Distro
import com.thoughtworks.go.build.docker.DistroVersion

Distro.values().each { Distro distro ->
distro.supportedVersions.each { DistroVersion version ->
include ":docker:gocd-agent:${distro.projectName(version)}"
}
}

include ":docker:gocd-server:${Distro.centos.projectName(Distro.centos.getVersion('7'))}"
include ":docker:gocd-server:${Distro.alpine.projectName(Distro.alpine.getVersion('3.9'))}"
12 changes: 1 addition & 11 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import com.thoughtworks.go.build.docker.Distro
import com.thoughtworks.go.build.docker.DistroVersion

/*
* Copyright 2019 ThoughtWorks, Inc.
*
Expand Down Expand Up @@ -112,11 +109,4 @@ include ':tfs-impl:tfs-impl-14'
include ':tw-go-plugins'
include ':util'

Distro.values().each { Distro distro ->
distro.supportedVersions.each { DistroVersion version ->
include ":docker:gocd-agent:${distro.projectName(version)}"
}
}

include ":docker:gocd-server:${Distro.centos.projectName(Distro.centos.getVersion('7'))}"
include ":docker:gocd-server:${Distro.alpine.projectName(Distro.alpine.getVersion('3.9'))}"
apply from: 'settings-docker.gradle'

0 comments on commit 6c323cd

Please sign in to comment.