Skip to content
Merged
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
31 changes: 31 additions & 0 deletions buildSrc/src/main/groovy/docker-database-saas.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,17 @@ ext {
return latestReleaseInfoDate
}

updateLXCRepository = {
File lxcRepositoryFolder = file(config.lxcRepositoryPath)

String repoURL = "git@github.com:liferay/liferay-lxc.git"

if (waitForCommand("git remote -v", lxcRepositoryFolder).readLines().any { it.contains(repoURL) }) {
println "Updating the liferay-lxc repo..."
waitForCommand("git pull --rebase ${repoURL} master", lxcRepositoryFolder)
}
}

updateVirtualHosts = {
executeSQLQuery("update VirtualHost set hostname = concat(hostname, '.localhost') where hostname <> 'localhost' and hostname not like '%.localhost'", config.databaseName)

Expand All @@ -407,6 +418,8 @@ ext {
}

tasks.register("copyLiferayLXCRepositoryConfigurations") {
dependsOn ":updateLXCRepository"

doFirst {
copyLiferayLXCRepositoryConfigurations();
}
Expand Down Expand Up @@ -612,4 +625,22 @@ tasks.register("importDatabaseDumps") {
}
}

tasks.register("updateLXCRepository") {
onlyIf("LXC repo is configured") {
if (config.lxcRepositoryPath == null) {
return false
}

if (config.lxcRepositoryPath == "") {
return false
}

return file(config.lxcRepositoryPath).exists()
}

doFirst {
updateLXCRepository()
}
}

project.plugins.apply "docker-common"