Skip to content

Commit

Permalink
🎉 initial project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
McPringle committed Mar 24, 2024
0 parents commit 6f2872a
Show file tree
Hide file tree
Showing 29 changed files with 2,820 additions and 0 deletions.
590 changes: 590 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.bat text eol=crlf
*.cmd text eol=crlf
mvnw eol=lf
25 changes: 25 additions & 0 deletions .github/workflows/all-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: All Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
name: All Tests

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: ./mvnw verify
- name: Check clean git state
run: ./.github/workflows/check-clean-git-state.sh
6 changes: 6 additions & 0 deletions .github/workflows/check-clean-git-state.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
R=`git status --porcelain | wc -l`
if [ "$R" -ne "0" ]; then
echo "The git repository is not clean after compiling and testing. Did you forget to commit or ignore files?";
git status --porcelain
exit 1;
fi
57 changes: 57 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/target/
.gradle
build/
!**/src/main/**/target/
!**/src/test/**/target/
!**/src/main/**/build/
!**/src/test/**/build/

.DS_Store

# The following files are generated/updated by vaadin-maven-plugin or vaadin-gradle-plugin
src/main/dev-bundle
node_modules/
frontend/generated/
pnpmfile.js
.npmrc
webpack.generated.js
vite.generated.ts

# Browser drivers for local integration tests
drivers/

# Error screenshots generated by TestBench for failed integration tests
error-screenshots/

# Eclipse and STS
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

# IntelliJ IDEA
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

# NetBeans
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

# VS Code
.vscode/

# The following are auto-generated by Vaadin if missing, but they should be added to source control if customized.
tsconfig.json
types.d.ts
index.html
26 changes: 26 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM gitpod/workspace-full

RUN sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN sudo apt-get -q update
RUN sudo apt -y install ./google-chrome-stable_current_amd64.deb
RUN sudo apt-get -y install libnss3\
libnspr4\
libatk1.0-0\
libatk-bridge2.0-0\
libcups2\
libdrm2\
libxkbcommon0\
libxcomposite1\
libxdamage1\
libxfixes3\
libxrandr2\
libgbm1\
libgtk-3-0\
libatspi2.0-0\
libx11-xcb-dev
RUN sudo rm -rf /var/lib/apt/lists/*

RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
&& sdk update \
&& sdk install java 21.0.2-tem \
&& sdk default java 21.0.2-tem"
14 changes: 14 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
tasks:
- init: mvn package -Pproduction

command: mvn
ports:
- port: 8080
onOpen: open-preview
image:
file: .gitpod.Dockerfile
vscode:
extensions:
- [email protected]:llHUlx8TJ6tFKGa1t6dpLQ==
- [email protected]:gNh98vNbqtZC6ydHasFxAQ==
- [email protected]:1iLvjTfznJrV611qRUeOHg==
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Stage that builds the application, a prerequisite for the running stage
FROM maven:3-openjdk-21-slim AS build
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update -qq \
&& apt-get install -y -qq --no-install-recommends nodejs \
&& apt-get clean

# Stop running as root at this point
RUN useradd -m myuser
WORKDIR /usr/src/app/
RUN chown myuser:myuser /usr/src/app/
USER myuser

# Copy pom.xml and prefetch dependencies so a repeated build can continue from the next step with existing dependencies
COPY --chown=myuser pom.xml ./
RUN mvn dependency:go-offline -Pproduction

# Copy all needed project files to a folder
COPY --chown=myuser:myuser src src
COPY --chown=myuser:myuser frontend frontend
COPY --chown=myuser:myuser package.json ./

# Using * after the files that are autogenerated so that so build won't fail if they are not yet created
COPY --chown=myuser:myuser package-lock.json* pnpm-lock.yaml* webpack.config.js* ./


# Build the production package, assuming that we validated the version before so no need for running tests again
RUN mvn clean package -DskipTests -Pproduction

# Running stage: the part that is used for running the application
FROM openjdk:21-jdk-slim
COPY --from=build /usr/src/app/target/*.jar /usr/app/app.jar
RUN useradd -m myuser
USER myuser
EXPOSE 8080
CMD java -jar /usr/app/app.jar
Loading

0 comments on commit 6f2872a

Please sign in to comment.