Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4803ae78c9 |
@@ -25,7 +25,6 @@ jobs:
|
|||||||
./gradlew bootJar -x test
|
./gradlew bootJar -x test
|
||||||
-PartefactVersion="${{ gitea.event.release.tag_name }}"
|
-PartefactVersion="${{ gitea.event.release.tag_name }}"
|
||||||
-PbuildChannel=stable
|
-PbuildChannel=stable
|
||||||
-Pvendor=${{ vars.VENDOR }}
|
|
||||||
|
|
||||||
- name: Resolve JAR file path
|
- name: Resolve JAR file path
|
||||||
id: jar
|
id: jar
|
||||||
@@ -50,37 +49,24 @@ jobs:
|
|||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ vars.DOCKER_HUB_USERNAME }}
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
- name: Generate image tags
|
- name: Generate image tags
|
||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
DOCKERHUB_USER="${{ vars.DOCKER_HUB_USERNAME }}"
|
DOCKERHUB_USER="${{ secrets.DOCKER_HUB_USERNAME }}"
|
||||||
echo "tag_version=${DOCKERHUB_USER}/${APP_NAME}:${{ gitea.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
|
REPO_NAME=$(echo "${{ gitea.repository.name }}" | tr '[:upper:]' '[:lower:]')
|
||||||
echo "tag_latest=${DOCKERHUB_USER}/${APP_NAME}:latest" >> "$GITHUB_OUTPUT"
|
echo "tag_version=${DOCKERHUB_USER}/${REPO_NAME}:${{ gitea.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "tag_latest=${DOCKERHUB_USER}/${REPO_NAME}:latest" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile.ci
|
file: Dockerfile.ci
|
||||||
build-args: |
|
build-args: JAR_FILE=${{ steps.jar.outputs.file }}
|
||||||
JAR_FILE=${{ steps.jar.outputs.file }}
|
|
||||||
IMAGE_VERSION=${{ gitea.event.release.tag_name }}
|
|
||||||
IMAGE_VENDOR=${{ vars.VENDOR }}
|
|
||||||
BUILD_DATE=${{ gitea.event.release.published_at }}
|
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.meta.outputs.tag_version }}
|
${{ steps.meta.outputs.tag_version }}
|
||||||
${{ steps.meta.outputs.tag_latest }}
|
${{ steps.meta.outputs.tag_latest }}
|
||||||
|
|
||||||
- name: Push README to Docker Hub
|
|
||||||
uses: christian-korneck/update-container-description-action@v1
|
|
||||||
env:
|
|
||||||
DOCKER_USER: ${{ vars.DOCKER_HUB_USERNAME }}
|
|
||||||
DOCKER_PASS: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
destination_container_repo: ${{ vars.DOCKER_HUB_USERNAME }}/${{ env.APP_NAME }}
|
|
||||||
provider: dockerhub
|
|
||||||
readme_file: README.md
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
variables:
|
||||||
|
GRADLE_OPTS: -Dorg.gradle.daemon=false
|
||||||
|
DOCKER_HOST: unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- release
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
image: amazoncorretto:21-alpine
|
||||||
|
cache:
|
||||||
|
key: gradle
|
||||||
|
paths:
|
||||||
|
- .gradle/wrapper
|
||||||
|
- .gradle/caches
|
||||||
|
before_script:
|
||||||
|
- chmod +x gradlew
|
||||||
|
- apk add --no-cache docker-cli
|
||||||
|
script:
|
||||||
|
- ./gradlew bootJar -x test -PartefactVersion="$CI_COMMIT_TAG"
|
||||||
|
- JAR_FILE=$(find build/libs -name '*.jar' | head -1)
|
||||||
|
- echo "Building Docker image for tag $CI_COMMIT_TAG with JAR $JAR_FILE"
|
||||||
|
- docker build
|
||||||
|
-f Dockerfile.ci
|
||||||
|
--build-arg JAR_FILE="$JAR_FILE"
|
||||||
|
-t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
|
||||||
|
.
|
||||||
|
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" "$CI_REGISTRY_IMAGE:latest"
|
||||||
|
- echo "Pushing image $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
|
||||||
|
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:latest"
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
@@ -2,18 +2,6 @@ FROM amazoncorretto:21-alpine
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ARG JAR_FILE
|
ARG JAR_FILE
|
||||||
ARG IMAGE_VERSION=dev
|
|
||||||
ARG IMAGE_VENDOR=OnixByte
|
|
||||||
ARG BUILD_DATE
|
|
||||||
|
|
||||||
COPY ${JAR_FILE} app.jar
|
COPY ${JAR_FILE} app.jar
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="delta-force-guide-server" \
|
|
||||||
org.opencontainers.image.description="REST API backend for managing Delta Force game firearm builds and modifications" \
|
|
||||||
org.opencontainers.image.version="${IMAGE_VERSION}" \
|
|
||||||
org.opencontainers.image.vendor="${IMAGE_VENDOR}" \
|
|
||||||
org.opencontainers.image.source="https://git.onixbyte.com/onixbyte/delta-force-guide-server" \
|
|
||||||
org.opencontainers.image.licenses="MIT" \
|
|
||||||
org.opencontainers.image.created="${BUILD_DATE}"
|
|
||||||
|
|
||||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||||
|
|||||||
@@ -9,19 +9,15 @@ spring:
|
|||||||
host: localhost
|
host: localhost
|
||||||
port: 6379
|
port: 6379
|
||||||
database: 0
|
database: 0
|
||||||
# password: qwerty # Uncomment if password is necessary
|
# password: 6hLFVqfGPviTYukn # Uncomment if password is necessary
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
pattern:
|
pattern:
|
||||||
# dateformat: dd MMM yyyy HH:mm:ss.SSS # Modify this for custom date format.
|
# dateformat: dd MMM yyyy HH:mm:ss.SSS # Modify this for custom date format.
|
||||||
|
|
||||||
app:
|
app:
|
||||||
cookie:
|
common:
|
||||||
http-only: true
|
version: 1.3.0.8-dev # Application version, you can change to any version you like, used for communication with frontend.
|
||||||
secure: false
|
|
||||||
same-site: none
|
|
||||||
path: '/'
|
|
||||||
max-age: P1D
|
|
||||||
cors:
|
cors:
|
||||||
allowed-origins: # Cross-origin allowed origins
|
allowed-origins: # Cross-origin allowed origins
|
||||||
- "http://localhost:5173" # Dev server for vite.
|
- "http://localhost:5173" # Dev server for vite.
|
||||||
@@ -45,10 +41,12 @@ app:
|
|||||||
issuer: dfguide.local # Issuer host
|
issuer: dfguide.local # Issuer host
|
||||||
secret: qwertyuiopasdfghjklzxcvbnm123456 # JWT singing secret, a 32-byte long or longer string is recommended
|
secret: qwertyuiopasdfghjklzxcvbnm123456 # JWT singing secret, a 32-byte long or longer string is recommended
|
||||||
valid-time: PT2H # JWT valid duration
|
valid-time: PT2H # JWT valid duration
|
||||||
webhook:
|
cookie: # Cookie settings.
|
||||||
github:
|
http-only: true
|
||||||
secret: 123456
|
secure: false
|
||||||
allowed-users: [ octotcat, onixbyte ]
|
same-site: lax
|
||||||
|
path: '/'
|
||||||
|
max-age: PT2H
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
api-docs:
|
api-docs:
|
||||||
|
|||||||
Reference in New Issue
Block a user