Skip to content

Commit

Permalink
fix: Make default project name lowercase, fixes #378
Browse files Browse the repository at this point in the history
  • Loading branch information
aykborstelmann authored and augi committed Nov 11, 2022
1 parent 960adc4 commit f48270d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ abstract class ComposeSettings {
else {
return "${safeProjectNamePrefix}_${nestedName}"
}
})
}).map{ String projectName ->
// docker-compose project names must be lowercase
projectName.toLowerCase()
}

useComposeFiles.empty()
startedServices.empty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,32 @@ class DockerComposePluginTest extends Specification {
up.composeExecutor.get().parameters.useComposeFiles.get() == ['test.yml']
}

def "project name should always be lowercase"() {
def project = ProjectBuilder.builder().build()
when:
project.plugins.apply 'docker-compose'
project.dockerCompose {
nestedUppercaseTask {
useComposeFiles = ['docker-compose.yml']
}
nestedUppercaseProjectName {
projectNamePrefix = "UPPERCASE"
}
nestedUppercaseProjectNamePrefix {
projectNamePrefix = "UPPERCASE"
}
}

then:

['nestedUppercaseTask', 'nestedUppercaseProjectName'].forEach{ String config ->
def projectName = project.dockerCompose."$config".projectName.get()
assert projectName.toLowerCase() == projectName
}


}

def "is possible to access servicesInfos of nested setting"() {
def project = ProjectBuilder.builder().build()
when:
Expand Down

0 comments on commit f48270d

Please sign in to comment.