Skip to content

Commit beffc7b

Browse files
authored
Merge pull request #263 from danger/update-docker-from-release-artifacts
Update docker from release artifacts
2 parents d8d32c2 + d452995 commit beffc7b

File tree

6 files changed

+33
-26
lines changed

6 files changed

+33
-26
lines changed

Dockerfile

+18-19
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
FROM gradle:7.4.2-jdk8
1+
FROM adoptopenjdk/openjdk8
22

3-
MAINTAINER Franco Meloni
3+
MAINTAINER Konstantin Aksenov
44

55
LABEL "com.github.actions.name"="Danger Kotlin"
66
LABEL "com.github.actions.description"="Runs Kotlin Dangerfiles"
77
LABEL "com.github.actions.icon"="zap"
88
LABEL "com.github.actions.color"="blue"
99

10-
# Install dependencies
11-
RUN apt-get update && \
12-
apt-get install -y ca-certificates && \
13-
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
14-
apt-get install -y make zip nodejs && \
15-
npm install -g danger
10+
ARG KOTLINC_VERSION="1.7.0"
11+
ARG DANGER_KOTLIN_VERSION="1.3.0"
1612

17-
# Install danger-kotlin globally
18-
COPY . /usr/local/_danger-kotlin
19-
RUN cd /usr/lib && \
20-
wget -q https://github.com/JetBrains/kotlin/releases/download/v1.7.0/kotlin-compiler-1.7.0.zip && \
21-
unzip kotlin-compiler-*.zip && \
22-
rm kotlin-compiler-*.zip && \
23-
cd /usr/local/_danger-kotlin && \
24-
make install && \
25-
rm -rf /usr/local/_danger-kotlin
13+
# Install dependencies
14+
RUN apt-get update
15+
RUN apt-get install -y npm nodejs wget unzip
2616

17+
# Install Kotlin compiler
18+
RUN wget -q "https://github.com/JetBrains/kotlin/releases/download/v$KOTLINC_VERSION/kotlin-compiler-$KOTLINC_VERSION.zip" && \
19+
unzip "kotlin-compiler-$KOTLINC_VERSION.zip" -d /usr/lib && \
20+
rm "kotlin-compiler-$KOTLINC_VERSION.zip"
2721
ENV PATH $PATH:/usr/lib/kotlinc/bin
2822

29-
# Run Danger Kotlin via Danger JS, allowing for custom args
30-
ENTRYPOINT ["danger-kotlin", "ci"]
23+
# Install Danger-JS
24+
RUN npm install -g danger
25+
26+
# Install Danger-Kotlin
27+
RUN wget -q "https://github.com/danger/kotlin/releases/download/$DANGER_KOTLIN_VERSION/danger-kotlin-$DANGER_KOTLIN_VERSION-linux.zip" && \
28+
unzip "danger-kotlin-$DANGER_KOTLIN_VERSION-linux.zip" -d /usr/local && \
29+
rm "danger-kotlin-$DANGER_KOTLIN_VERSION-linux.zip"

danger-kotlin-kts/version.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
group 'systems.danger'
2-
version '1.2.0'
2+
version '1.3.0'

danger-kotlin-library/version.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
group 'systems.danger'
2-
version '1.2.0'
2+
version '1.3.0'

danger-kotlin/build.gradle.kts

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@ kotlin {
66
/* Targets configuration omitted.
77
* To find out how to configure the targets, please follow the link:
88
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */
9-
val hostTarget = when (val hostOs = System.getProperty("os.name")) {
9+
10+
val targetOS: String by project
11+
val osName = if (project.hasProperty("targetOS")) {
12+
targetOS
13+
} else {
14+
System.getProperty("os.name")
15+
}
16+
17+
val buildTarget = when (osName) {
1018
"Mac OS X" -> macosX64("runner")
1119
"Linux" -> linuxX64("runner")
1220
"Mac OS X Apple silicon" -> macosArm64("runner")
1321
"Windows 11" -> mingwX64("runner")
14-
else -> throw GradleException("Host OS '$hostOs' is not supported.") as Throwable
22+
else -> throw GradleException("OS '$osName' is not supported.") as Throwable
1523
}
1624

17-
hostTarget.apply {
25+
buildTarget.apply {
1826
binaries {
1927
executable()
2028
}

danger-kotlin/src/runnerMain/kotlin/Main.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import systems.danger.cmd.Command
55
import systems.danger.cmd.dangerjs.DangerJS
66

77
const val PROCESS_DANGER_KOTLIN = "danger-kotlin"
8-
const val VERSION = "1.2.0"
8+
const val VERSION = "1.3.0"
99

1010
fun main(args: Array<String>) {
1111
Log.isVerbose = args.contains("--verbose") || (getenv("DEBUG")?.toString()?.isNotEmpty() ?: false)

scripts/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
VERSION=1.2.0
3+
VERSION=1.3.0
44

55
while getopts v:h: flag
66
do

0 commit comments

Comments
 (0)