release-0.9.9 add c4kbinaries download

This commit is contained in:
ansgarz 2022-02-25 21:11:04 +01:00
parent 3c6ce2ea31
commit a005e51729
5 changed files with 58 additions and 40 deletions

View file

@ -18,7 +18,7 @@ apply plugin: 'kotlinx-serialization'
group = 'org.domaindrivenarchitecture.provs' group = 'org.domaindrivenarchitecture.provs'
version = '0.9.9-SNAPSHOT' version = 'release-0.9.9'
repositories { repositories {
mavenCentral() mavenCentral()

View file

@ -1,7 +1,6 @@
package org.domaindrivenarchitecture.provs.desktop.domain package org.domaindrivenarchitecture.provs.desktop.domain
import org.domaindrivenarchitecture.provs.desktop.infrastructure.* import org.domaindrivenarchitecture.provs.desktop.infrastructure.*
import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig
import org.domaindrivenarchitecture.provs.framework.core.Prov import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult import org.domaindrivenarchitecture.provs.framework.core.ProvResult
import org.domaindrivenarchitecture.provs.framework.ubuntu.git.provisionGit import org.domaindrivenarchitecture.provs.framework.ubuntu.git.provisionGit
@ -129,7 +128,11 @@ fun Prov.provisionWorkplaceSubmodules(
) = task { ) = task {
if (submodules.contains(DesktopSubmodule.PROVSBINARIES.name.lowercase())) { if (submodules.contains(DesktopSubmodule.PROVSBINARIES.name.lowercase())) {
aptInstall("jarwrapper") aptInstall("jarwrapper")
installBinariesProvs() installBinariesProvs(true)
}
if (submodules.contains(DesktopSubmodule.C4KBINARIES.name.lowercase())) {
aptInstall("jarwrapper")
installBinariesC4k(true)
} }
ProvResult(true) ProvResult(true)
} }

View file

@ -1,5 +1,5 @@
package org.domaindrivenarchitecture.provs.desktop.domain package org.domaindrivenarchitecture.provs.desktop.domain
enum class DesktopSubmodule { enum class DesktopSubmodule {
PROVSBINARIES PROVSBINARIES, C4KBINARIES
} }

View file

@ -5,37 +5,51 @@ import org.domaindrivenarchitecture.provs.framework.core.ProvResult
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs
import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL
fun Prov.installBinariesC4k() = task { fun Prov.installBinariesC4k(reprovision: Boolean = false) = task {
val installationPath = " /usr/local/bin/" val installationPath = " /usr/local/bin/"
createDirs(installationPath, sudo = true) createDirs(installationPath, sudo = true)
class Binary(val jobId: String, val fileName: String, val sha256sum: String) fun Prov.downloadC4k(jobId: String, c4kName: String, sha256sum: String) = task {
val fileName = "$c4kName-standalone.jar"
fun downloadC4k(bin : Binary) {
with(bin) {
downloadFromURL( downloadFromURL(
"https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud/-/jobs/${jobId}/artifacts/raw/target/uberjar/${fileName}", "https://gitlab.com/domaindrivenarchitecture/$c4kName/-/jobs/${jobId}/artifacts/raw/target/uberjar/${fileName}",
path = installationPath, path = installationPath,
filename = fileName, filename = fileName,
sha256sum = sha256sum, sha256sum = sha256sum,
sudo = true sudo = true,
overwrite = reprovision
) )
// remark: chmod fails if file could not be downloaded (e.g. due to wrong link or checksum)
cmd("chmod 755 $installationPath$fileName", sudo = true) cmd("chmod 755 $installationPath$fileName", sudo = true)
} }
} downloadC4k(
downloadC4k(Binary("2138015489", "c4k-nextcloud-standalone.jar", "2138015489",
"47b6f71664903816eab0e4950d4ab0d564ea365ddb2b9c2a7bcb2736a2d941cb")) "c4k-nextcloud",
downloadC4k(Binary("2136806347", "c4k-jira-standalone.jar", "47b6f71664903816eab0e4950d4ab0d564ea365ddb2b9c2a7bcb2736a2d941cb"
"585f26e3b70bec32f052f488688718d8c9a6d15222b8a2141a69fa1bea136179")) )
downloadC4k(Binary("2136561868", "c4k-keycloak-standalone.jar", downloadC4k(
"81bd605b160c3d339cba745433271412eaa716cb7856d0227a1eb063badc9")) "2136806347",
downloadC4k(Binary("2136778473", "c4k-mastodon-bot-standalone.jar", "c4k-jira",
"9dbf981ce8b4aea92e0f45b182a39d2caffceb6e8f78ddfeeb49e74ca4a8d37d")) "585f26e3b70bec32f052f488688718d8c9a6d15222b8a2141a69fa1bea136179"
downloadC4k(Binary("2136801572", "c4k-shynet-standalone.jar", )
"4fa0d41896f2a9ea89ca70c475f9d1f89edf3fadf82d6b39789b90732f795429")) downloadC4k(
"2136561868",
"c4k-keycloak",
"81bd605b160c3d339cba745433271412eaa716cb7856d0227a1eb063badc9d9c"
)
downloadC4k(
"2136778473",
"c4k-mastodon-bot",
"9dbf981ce8b4aea92e0f45b182a39d2caffceb6e8f78ddfeeb49e74ca4a8d37d"
)
downloadC4k(
"2136801572",
"c4k-shynet",
"4fa0d41896f2a9ea89ca70c475f9d1f89edf3fadf82d6b39789b90732f795429"
)
ProvResult(true) ProvResult(true)

View file

@ -5,7 +5,7 @@ import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.creat
import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL
fun Prov.installBinariesProvs() = task { fun Prov.installBinariesProvs(reprovision: Boolean = false) = task {
// check for latest stable release on: https://gitlab.com/domaindrivenarchitecture/provs/-/releases // check for latest stable release on: https://gitlab.com/domaindrivenarchitecture/provs/-/releases
// release 0.9.8 // release 0.9.8
val jobId = "2137287031" val jobId = "2137287031"
@ -15,22 +15,23 @@ fun Prov.installBinariesProvs() = task {
createDirs(installationPath, sudo = true) createDirs(installationPath, sudo = true)
downloadFromURL(
"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/$jobId/artifacts/raw/build/libs/provs-server.jar",
path = installationPath,
filename = "provs-server.jar",
sha256sum = provsServerSha256sum,
sudo = true
)
downloadFromURL( downloadFromURL(
"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/$jobId/artifacts/raw/build/libs/provs-desktop.jar", "https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/$jobId/artifacts/raw/build/libs/provs-desktop.jar",
path = installationPath, path = installationPath,
filename = "provs-desktop.jar", filename = "provs-desktop.jar",
sha256sum = provsDesktopSha256sum, sha256sum = provsDesktopSha256sum,
sudo = true sudo = true,
overwrite = reprovision
) )
cmd("chmod 755 /usr/local/bin/provs-server.jar" , sudo = true)
cmd("chmod 755 /usr/local/bin/provs-desktop.jar", sudo = true) cmd("chmod 755 /usr/local/bin/provs-desktop.jar", sudo = true)
downloadFromURL(
"https://gitlab.com/domaindrivenarchitecture/provs/-/jobs/$jobId/artifacts/raw/build/libs/provs-server.jar",
path = installationPath,
filename = "provs-server.jar",
sha256sum = provsServerSha256sum,
sudo = true,
overwrite = reprovision
)
cmd("chmod 755 /usr/local/bin/provs-server.jar" , sudo = true)
} }