diff --git a/.drone.yml b/.drone.yml index 848d7f0..a07d022 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,16 +9,17 @@ environment: CRE_PORT: 9090 steps: -# - name: test -# image: gradle:7.1-jdk11 -# commands: -# - gradle test + # - name: test + # image: gradle:7.1-jdk11 + # commands: + # - gradle test - name: build image: gradle:7.1-jdk11 commands: - gradle bootJar -Pversion=$CRE_VERSION - mv build/libs/ColorRecipesExplorer-$CRE_VERSION.jar $CRE_ARTIFACT_NAME.jar + - echo -n "latest,$CRE_VERSION" > .tags when: branch: - master @@ -26,10 +27,12 @@ steps: - name: containerize image: plugins/docker settings: + build_args: + - JAVA_VERSION=11 + build_args_from_env: + - CRE_ARTIFACT_NAME + - CRE_PORT repo: registry.fyloz.dev:5443/colorrecipesexplorer/backend - tags: - - latest - - $CRE_VERSION when: branch: - master diff --git a/Dockerfile b/Dockerfile index 8d55776..fb252b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,11 @@ FROM openjdk:$JAVA_VERSION WORKDIR /usr/bin/cre/ -ARG ARTIFACT_NAME=ColorRecipesExplorer -COPY $ARTIFACT_NAME.jar ColorRecipesExplorer.jar +ARG CRE_ARTIFACT_NAME=ColorRecipesExplorer +COPY $CRE_ARTIFACT_NAME.jar ColorRecipesExplorer.jar -ARG PORT=9090 -EXPOSE $PORT +ARG CRE_PORT=9090 +EXPOSE $CRE_PORT ENV spring_profiles_active=h2,rest ENV server_port=$PORT