Add jenkinsfile & dockerfile

master
Araozu 2024-05-06 13:44:21 -05:00
parent 40ff1d67bc
commit 8f9f0d8c5d
6 changed files with 48 additions and 2 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM eclipse-temurin:11
EXPOSE 8080:8080
# When this is run, Jenkins has already built the FAT JAR
RUN mkdir /app
COPY ./build/libs/rimajon-0.0.1-all.jar /app/backend.jar
ENTRYPOINT ["java","-jar","/app/backend.jar"]

20
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,20 @@
pipeline {
agent {
docker {
image "gradle:7.6.4-jdk11"
}
}
stages {
stage('Build FAT JAR') {
steps {
sh 'gradle shadowJar'
}
}
stage("Deploy jar") {
steps {
sh "echo ':D (need to spin up container)'"
}
}
}
}

View File

@ -8,6 +8,10 @@ buildscript {
} }
} }
plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
apply plugin: 'kotlin' apply plugin: 'kotlin'
apply plugin: 'application' apply plugin: 'application'
@ -28,6 +32,12 @@ repositories {
maven { url 'https://kotlin.bintray.com/ktor' } maven { url 'https://kotlin.bintray.com/ktor' }
} }
shadowJar {
manifest {
attributes 'Main-Class': 'com.example.ApplicationKt'
}
}
dependencies { dependencies {
compile("org.jetbrains.exposed:exposed-core:0.24.1") compile("org.jetbrains.exposed:exposed-core:0.24.1")
compile("org.jetbrains.exposed:exposed-dao:0.24.1") compile("org.jetbrains.exposed:exposed-dao:0.24.1")
@ -40,5 +50,5 @@ dependencies {
implementation "io.ktor:ktor-gson:$ktor_version" implementation "io.ktor:ktor-gson:$ktor_version"
implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.google.code.gson:gson:2.8.5'
testImplementation "io.ktor:ktor-server-tests:$ktor_version" testImplementation "io.ktor:ktor-server-tests:$ktor_version"
testImplementation 'io.kotest:kotest-runner-junit5:$version' // testImplementation 'io.kotest:kotest-runner-junit5:$version'
} }

6
docker-compose.yml Normal file
View File

@ -0,0 +1,6 @@
services:
web:
build: .
ports:
- "9124:8080"

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: dev.araozu.ApplicationKt