diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ecf577a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +image: docker:latest +services: + - docker:dind + +stages: + - build + +variables: + IMAGE_TAG: $CI_REGISTRY_IMAGE:latest + NAME: $CI_PROJECT_NAME + +build_and_push: + stage: build + only: + - master + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker build -t $IMAGE_TAG . + - docker push $IMAGE_TAG + +only_build: + stage: build + except: + - master + script: + - docker build -t $IMAGE_TAG . diff --git a/Dockerfile b/Dockerfile index 063c036..38d0c7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,6 @@ RUN ./gradlew bootJar FROM openjdk:8-jre-alpine -COPY --from=build /app/build/libs/OttoBot*.jar /otto.jar -RUN chmod +x /otto.jar +COPY --from=build /app/build/libs/ottobot.jar /otto.jar CMD java -jar /otto.jar \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7d270f2..2bccbe0 100644 --- a/build.gradle +++ b/build.gradle @@ -43,6 +43,7 @@ dependencies { bootJar { mainClassName = 'nl.voidcorp.discord.MainKt' + archiveName="ottobot.jar" } compileKotlin {