Try to add a docker build thingy, guaranteed not to work ™️

This commit is contained in:
Julius de Jeu 2019-05-22 13:25:54 +02:00
parent bd95ae33dd
commit 6e3f57d1bf
5 changed files with 155 additions and 1 deletions

136
.dockerignore Normal file
View file

@ -0,0 +1,136 @@
# Created by https://www.gitignore.io/api/java,gradle,intellij+all
# Edit at https://www.gitignore.io/?templates=java,gradle,intellij+all
### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
# JetBrains templates
**___jb_tmp___
### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
.idea/
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
*.iml
modules.xml
.idea/misc.xml
*.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Gradle ###
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### Gradle Patch ###
**/build/
# End of https://www.gitignore.io/api/java,gradle,intellij+all

13
Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM openjdk:8-stretch as build
COPY . /app
WORKDIR /app
RUN ./gradlew bootJar
FROM openjdk:8-jre-alpine
COPY --from=build /app/build/libs/OttoBot*.jar /otto.jar
RUN chmod +x /otto.jar
CMD java -jar /otto.jar

View file

@ -41,6 +41,10 @@ dependencies {
}
bootJar {
mainClassName = 'nl.voidcorp.discord.MainKt'
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]

0
gradlew vendored Normal file → Executable file
View file

View file

@ -3,10 +3,11 @@ package nl.voidcorp.discord.commands
import nl.voidcorp.discord.command.Command
import nl.voidcorp.discord.command.CommandMessage
import nl.voidcorp.discord.command.CommandResult
import nl.voidcorp.discord.command.CommandSource
import org.springframework.stereotype.Component
@Component
class PermissionLevelCommand : Command("permissions") {
class PermissionLevelCommand : Command("permissions", location = CommandSource.GUILD) {
override fun handle(event: CommandMessage): CommandResult {
event.reply("Your highest permission level is `${getLevel(event.member!!).levelName}`")
return CommandResult.SUCCESS