forked from damoeb/rss-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
37 lines (33 loc) · 1.14 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath ("com.github.node-gradle:gradle-node-plugin:${findProperty("gradleNodePluginVersion")}")
}
}
plugins {
id("org.ajoberstar.grgit") version "4.1.0"
}
tasks.register("buildDockerImage", Exec::class) {
dependsOn(tasks.findByPath("packages:playground:build"))
val majorMinorPatch = findProperty("proxyVersion") as String
val parts = majorMinorPatch.split(".")
val major = parts[0]
val majorMinor = parts.slice(0..1).joinToString(".")
val imageName = findProperty("dockerImageTag") as String
val gitHash = grgit.head().abbreviatedId
// see https://github.com/docker-library/official-images#multiple-architectures
// install plarforms https://stackoverflow.com/a/60667468/807017
// docker buildx ls
// commandLine("docker", "buildx", "build",
commandLine("docker", "build",
"--build-arg", "PROXY_VERSION=${majorMinorPatch}-${gitHash}",
// "--platform=linux/amd64",
// "--platform=arm64v8",
"-t", "${imageName}:${majorMinorPatch}",
"-t", "${imageName}:${majorMinor}",
"-t", "${imageName}:${major}",
"-t", imageName,
".")
}