[skip ci] wip
This commit is contained in:
parent
2212286ea7
commit
241bc4fef3
2 changed files with 29 additions and 13 deletions
|
@ -1,26 +1,37 @@
|
|||
package org.domaindrivenarchitecture.provs.desktop.infrastructure
|
||||
|
||||
import org.domaindrivenarchitecture.provs.framework.core.Prov
|
||||
import org.domaindrivenarchitecture.provs.framework.core.ProvResult
|
||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.filesystem.base.createDirs
|
||||
import org.domaindrivenarchitecture.provs.framework.ubuntu.web.base.downloadFromURL
|
||||
|
||||
fun Prov.installBinariesC4k() = task {
|
||||
// check for latest stable release on: https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud/-/releases
|
||||
// release 1.0.2
|
||||
val jobId = "1824231745"
|
||||
|
||||
val installationPath = " /usr/local/bin/"
|
||||
val fileName = "c4k-nextcloud-standalone.jar"
|
||||
val c4kNextcloudSha256sum = "5b7eeecf745c720184be4fccdd61a49509ae5e322558506eb6bc3c3ed680c23f"
|
||||
|
||||
createDirs(installationPath, sudo = true)
|
||||
|
||||
downloadFromURL(
|
||||
"https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud/-/jobs/$jobId/artifacts/raw/target/uberjar/$fileName",
|
||||
path = installationPath,
|
||||
filename = fileName,
|
||||
sha256sum = c4kNextcloudSha256sum,
|
||||
sudo = true
|
||||
)
|
||||
cmd("chmod 755 $installationPath$fileName", sudo = true)
|
||||
class Binary(val jobId: String, val fileName: String, val sha256sum: String)
|
||||
|
||||
fun downloadC4k(bin : Binary) {
|
||||
with(bin) {
|
||||
downloadFromURL(
|
||||
"https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud/-/jobs/${jobId}/artifacts/raw/target/uberjar/${fileName}",
|
||||
path = installationPath,
|
||||
filename = fileName,
|
||||
sha256sum = sha256sum,
|
||||
sudo = true
|
||||
)
|
||||
cmd("chmod 755 $installationPath$fileName", sudo = true)
|
||||
}
|
||||
|
||||
}
|
||||
// check for latest stable release on: https://gitlab.com/domaindrivenarchitecture/c4k-nextcloud/-/releases
|
||||
// release 1.0.2
|
||||
val nextcloud = Binary("1824231745", "c4k-nextcloud-standalone.jar", "5b7eeecf745c720184be4fccdd61a49509ae5e322558506eb6bc3c3ed680c23f")
|
||||
|
||||
// release 1.0.6
|
||||
|
||||
ProvResult(true)
|
||||
|
||||
}
|
|
@ -15,5 +15,10 @@ internal class BinariesC4kKtTest {
|
|||
// then
|
||||
assertTrue(res.success)
|
||||
assertTrue(defaultTestContainer().fileExists(" /usr/local/bin/c4k-nextcloud-standalone.jar", sudo = true))
|
||||
assertTrue(defaultTestContainer().fileExists(" /usr/local/bin/c4k-jira-standalone.jar", sudo = true))
|
||||
assertTrue(defaultTestContainer().fileExists(" /usr/local/bin/c4k-jitsi-standalone.jar", sudo = true))
|
||||
assertTrue(defaultTestContainer().fileExists(" /usr/local/bin/c4k-shynet-standalone.jar", sudo = true))
|
||||
assertTrue(defaultTestContainer().fileExists(" /usr/local/bin/c4k-mastodon-bot-standalone.jar", sudo = true))
|
||||
assertTrue(defaultTestContainer().fileExists(" /usr/local/bin/c4k-keycloak-standalone.jar", sudo = true))
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue