Skip to content

Commit 9987c0f

Browse files
committed
LPD-67899 updates the repo if ssh is already configured for the remote
1 parent 2fb736c commit 9987c0f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

buildSrc/src/main/groovy/docker-database-saas.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,17 @@ ext {
399399
return latestReleaseInfoDate
400400
}
401401

402+
updateLXCRepository = {
403+
File lxcRepositoryFolder = file(config.lxcRepositoryPath)
404+
405+
String repoURL = "[email protected]:liferay/liferay-lxc.git"
406+
407+
if (waitForCommand("git remote -v", lxcRepositoryFolder).readLines().any { it.contains(repoURL) }) {
408+
println "Updating the liferay-lxc repo..."
409+
waitForCommand("git pull --rebase ${repoURL} master", lxcRepositoryFolder)
410+
}
411+
}
412+
402413
updateVirtualHosts = {
403414
executeSQLQuery("update VirtualHost set hostname = concat(hostname, '.localhost') where hostname <> 'localhost' and hostname not like '%.localhost'", config.databaseName)
404415

@@ -407,6 +418,8 @@ ext {
407418
}
408419

409420
tasks.register("copyLiferayLXCRepositoryConfigurations") {
421+
dependsOn ":updateLXCRepository"
422+
410423
doFirst {
411424
copyLiferayLXCRepositoryConfigurations();
412425
}
@@ -612,4 +625,22 @@ tasks.register("importDatabaseDumps") {
612625
}
613626
}
614627

628+
tasks.register("updateLXCRepository") {
629+
onlyIf("LXC repo is configured") {
630+
if (config.lxcRepositoryPath == null) {
631+
return false
632+
}
633+
634+
if (config.lxcRepositoryPath == "") {
635+
return false
636+
}
637+
638+
return file(config.lxcRepositoryPath).exists()
639+
}
640+
641+
doFirst {
642+
updateLXCRepository()
643+
}
644+
}
645+
615646
project.plugins.apply "docker-common"

0 commit comments

Comments
 (0)