Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker from release artifacts #263

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
FROM gradle:7.4.2-jdk8
FROM adoptopenjdk/openjdk8

MAINTAINER Franco Meloni
MAINTAINER Konstantin Aksenov

LABEL "com.github.actions.name"="Danger Kotlin"
LABEL "com.github.actions.description"="Runs Kotlin Dangerfiles"
LABEL "com.github.actions.icon"="zap"
LABEL "com.github.actions.color"="blue"

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

# Install danger-kotlin globally
COPY . /usr/local/_danger-kotlin
RUN cd /usr/lib && \
wget -q https://github.com/JetBrains/kotlin/releases/download/v1.7.0/kotlin-compiler-1.7.0.zip && \
unzip kotlin-compiler-*.zip && \
rm kotlin-compiler-*.zip && \
cd /usr/local/_danger-kotlin && \
make install && \
rm -rf /usr/local/_danger-kotlin
# Install dependencies
RUN apt-get update
RUN apt-get install -y npm nodejs wget unzip

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

# Run Danger Kotlin via Danger JS, allowing for custom args
ENTRYPOINT ["danger-kotlin", "ci"]
# Install Danger-JS
RUN npm install -g danger

# Install Danger-Kotlin
RUN wget -q "https://github.com/danger/kotlin/releases/download/$DANGER_KOTLIN_VERSION/danger-kotlin-$DANGER_KOTLIN_VERSION-linux.zip" && \
unzip "danger-kotlin-$DANGER_KOTLIN_VERSION-linux.zip" -d /usr/local && \
rm "danger-kotlin-$DANGER_KOTLIN_VERSION-linux.zip"
2 changes: 1 addition & 1 deletion danger-kotlin-kts/version.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group 'systems.danger'
version '1.2.0'
version '1.3.0'
2 changes: 1 addition & 1 deletion danger-kotlin-library/version.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group 'systems.danger'
version '1.2.0'
version '1.3.0'
14 changes: 11 additions & 3 deletions danger-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ kotlin {
/* Targets configuration omitted.
* To find out how to configure the targets, please follow the link:
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */
val hostTarget = when (val hostOs = System.getProperty("os.name")) {

val targetOS: String by project
val osName = if (project.hasProperty("targetOS")) {
targetOS
} else {
System.getProperty("os.name")
}

val buildTarget = when (osName) {
"Mac OS X" -> macosX64("runner")
"Linux" -> linuxX64("runner")
"Mac OS X Apple silicon" -> macosArm64("runner")
"Windows 11" -> mingwX64("runner")
else -> throw GradleException("Host OS '$hostOs' is not supported.") as Throwable
else -> throw GradleException("OS '$osName' is not supported.") as Throwable
}

hostTarget.apply {
buildTarget.apply {
binaries {
executable()
}
Expand Down
2 changes: 1 addition & 1 deletion danger-kotlin/src/runnerMain/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import systems.danger.cmd.Command
import systems.danger.cmd.dangerjs.DangerJS

const val PROCESS_DANGER_KOTLIN = "danger-kotlin"
const val VERSION = "1.2.0"
const val VERSION = "1.3.0"

fun main(args: Array<String>) {
Log.isVerbose = args.contains("--verbose") || (getenv("DEBUG")?.toString()?.isNotEmpty() ?: false)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

VERSION=1.2.0
VERSION=1.3.0

while getopts v:h: flag
do
Expand Down
Loading