Skip to content

Commit

Permalink
Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodforGod committed Sep 23, 2024
0 parents commit 672e640
Show file tree
Hide file tree
Showing 34 changed files with 2,523 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# all-encompassing default settings unless otherwise specified
[*]
end_of_line = lf
charset = utf-8

# Json
[*.json]
indent_size = 2
indent_style = space
insert_final_newline = false
trim_trailing_whitespace = true

# Yaml
[{*.yml, *.yaml}]
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# Property files
[*.properties]
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# XML files
[*.xml]
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
60 changes: 60 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto


# The above will handle all files NOT found below
# These files are text and should be normalized (Convert crlf => lf)
*.bash text eol=lf
*.css text diff=css
*.df text
*.htm text diff=html
*.html text diff=html eol=lf
*.java text diff=java eol=lf
*.js text
*.json text eol=lf
*.jsp text eol=lf
*.jspf text eol=lf
*.jspx text eol=lf
*.properties text eol=lf
*.sh text eol=lf
*.tld text
*.txt text eol=lf
*.tag text
*.tagx text
*.xml text
*.yml text eol=lf


# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
# Archives
*.7z binary
*.br binary
*.gz binary
*.tar binary
*.zip binary
*.jar binary
*.so binary
*.war binary
*.dll binary

# Documents
*.pdf binary

# Images
*.ico binary
*.gif binary
*.jpg binary
*.jpeg binary
*.png binary
*.psd binary
*.webp binary

# Fonts
*.woff2 binary

# Other
*.exe binary
*.class binary
*.ear binary
27 changes: 27 additions & 0 deletions .github/workflows/test-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Master

on:
push:
branches:
- "master"

jobs:
test:
runs-on: ubuntu-latest
name: Running tests
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "21"
distribution: "adopt"

- name: Build classes
run: "./gradlew classes"

- name: Build tests
run: "./gradlew testClasses"

- name: Run tests
run: "./gradlew test jacocoTestReport --no-parallel"
40 changes: 40 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test PR

on:
pull_request:
branches:
- "master"


permissions:
contents: read
checks: write
pull-requests: write


jobs:
build-tests:
runs-on: ubuntu-latest
name: Pull Request Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "21"
distribution: "adopt"

- name: Build classes
run: "./gradlew classes"

- name: Build tests
run: "./gradlew testClasses"

- name: Run tests
run: "./gradlew test jacocoTestReport"

- name: Report tests
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
**/test-results/**/*.xml
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Package Files
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

### Gradle template
.gradle
build/
target/

### Idea generated files
.idea
.settings/
*.iml
out/
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG RUN_IMAGE=eclipse-temurin:21-jre-jammy
FROM ${RUN_IMAGE}

ARG TARGET_DIR=/opt/app
ARG SOURCE_DIR=build/distributions

COPY $SOURCE_DIR/*.tar application.tar
RUN mkdir $TARGET_DIR
RUN tar -xf application.tar -C $TARGET_DIR
RUN rm application.tar

ARG DOCKER_USER=app
RUN groupadd -r $DOCKER_USER && useradd -rg $DOCKER_USER $DOCKER_USER
USER $DOCKER_USER

ENV JAVA_OPTS="-Dfile.encoding=UTF-8"

EXPOSE 8080/tcp
EXPOSE 8085/tcp
CMD [ "/opt/app/application/bin/application" ]
Loading

0 comments on commit 672e640

Please sign in to comment.