diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1cafe88..d099538 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ docker-build: - cd gitlab-app - docker buildx create --use - docker buildx build --push --platform linux/amd64 -f Dockerfile-linux -t "upagge/test:latest" . - - docker buildx build --push --platform linux/arm64/v8 -f Dockerfile-mac -t "upagge/test:latest" . + - docker buildx build --push --platform linux/arm64/v8 -f Dockerfile-linux2 -t "upagge/test:latest" . # - docker push "$CI_REGISTRY_IMAGE:latest" # - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" diff --git a/gitlab-app/Dockerfile-linux b/gitlab-app/Dockerfile-linux index 93c937c..b62fa23 100644 --- a/gitlab-app/Dockerfile-linux +++ b/gitlab-app/Dockerfile-linux @@ -8,7 +8,6 @@ RUN apk add --no-cache bash && \ WORKDIR /bot USER gitlabbot:gitlabbot COPY target/gitlab-notification.jar app.jar -VOLUME logs ENV TELEGRAM_PERSON_ID=TELEGRAM_PERSON_ID DATASOURCE_URL=DATASOURCE_URL \ DATASOURCE_PASSWORD=DATASOURCE_PASSWORD DATASOURCE_USERNAME=DATASOURCE_USERNAME \ GITLAB_PERSONAL_TOKEN=GITLAB_PERSONAL_TOKEN TELEGRAM_BOT_TOKEN=TELEGRAM_BOT_TOKEN \ diff --git a/gitlab-app/Dockerfile-linux2 b/gitlab-app/Dockerfile-linux2 new file mode 100644 index 0000000..5936ad2 --- /dev/null +++ b/gitlab-app/Dockerfile-linux2 @@ -0,0 +1,24 @@ +FROM openjdk:17-jdk-oraclelinux8 +MAINTAINER uPagge +RUN apk add --no-cache bash && \ + addgroup -S gitlabbot && \ + adduser -S gitlabbot -G gitlabbot && \ + mkdir -p /bot && \ + chown -R gitlabbot:gitlabbot /bot +WORKDIR /bot +USER gitlabbot:gitlabbot +COPY target/gitlab-notification.jar app.jar +ENV TELEGRAM_PERSON_ID=TELEGRAM_PERSON_ID DATASOURCE_URL=DATASOURCE_URL \ + DATASOURCE_PASSWORD=DATASOURCE_PASSWORD DATASOURCE_USERNAME=DATASOURCE_USERNAME \ + GITLAB_PERSONAL_TOKEN=GITLAB_PERSONAL_TOKEN TELEGRAM_BOT_TOKEN=TELEGRAM_BOT_TOKEN \ + TELEGRAM_BOT_USERNAME=TELEGRAM_BOT_USERNAME GITLAB_URL=GITLAB_URL GITLAB_REPLACE_URL=GITLAB_REPLACE_URL +ENTRYPOINT java -DTELEGRAM_BOT_USERNAME=${TELEGRAM_BOT_USERNAME} \ + -DTELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN \ + -DTELEGRAM_PERSON_ID=$TELEGRAM_PERSON_ID \ + -DDATASOURCE_URL=$DATASOURCE_URL \ + -DDATASOURCE_PASSWORD=$DATASOURCE_PASSWORD \ + -DDATASOURCE_USERNAME=$DATASOURCE_USERNAME \ + -DGITLAB_PERSONAL_TOKEN=$GITLAB_PERSONAL_TOKEN \ + -DGITLAB_URL=$GITLAB_URL \ + -DGITLAB_REPLACE_URL=$GITLAB_REPLACE_URL \ + -jar app.jar \ No newline at end of file diff --git a/gitlab-app/Dockerfile-mac b/gitlab-app/Dockerfile-mac index 61d4353..c327fcf 100644 --- a/gitlab-app/Dockerfile-mac +++ b/gitlab-app/Dockerfile-mac @@ -1,10 +1,9 @@ -FROM openjdk:17-jdk-oraclelinux8 +FROM upagge/openjdk-mac-slim:17.0.2 MAINTAINER uPagge RUN mkdir -p /bot && adduser gitlabbot --disabled-password && chown -R gitlabbot:gitlabbot /bot WORKDIR /bot USER gitlabbot:gitlabbot COPY target/gitlab-notification.jar app.jar -VOLUME logs ENV TELEGRAM_PERSON_ID=TELEGRAM_PERSON_ID DATASOURCE_URL=DATASOURCE_URL \ DATASOURCE_PASSWORD=DATASOURCE_PASSWORD DATASOURCE_USERNAME=DATASOURCE_USERNAME \ GITLAB_PERSONAL_TOKEN=GITLAB_PERSONAL_TOKEN TELEGRAM_BOT_TOKEN=TELEGRAM_BOT_TOKEN \