-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* vaadin v bump * pom.xml: remove unused deps * add vaadin-boot * Fix vaadin-boot configuration * Fix maven run configuration * add github actions * Maven needs to be run with -Dvaadin.webpackForFrontendBuild=true * Add missing validation library * Mark com.vaadin:vaadin dependency properly as optional * Initial impl of Dockerfile * Dockerfile * Dockerfile: fix missing ARG clause
- Loading branch information
Showing
10 changed files
with
391 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Maven | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
java: [11] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', '.mvn/wrapper/maven-wrapper.properties') }} | ||
- name: Build with Maven | ||
run: ./mvnw -C -B -e -V clean package -Dvaadin.webpackForFrontendBuild=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Allows you to run this addon's app easily as a docker container. | ||
# See README.md for more details. | ||
# | ||
# 1. Build the image with: docker build --no-cache -t test/breeze-theme:latest . | ||
# 2. Run the image with: docker run --rm -ti -p8080:8080 test/breeze-theme | ||
# | ||
# Uses Docker Multi-stage builds: https://docs.docker.com/build/building/multi-stage/ | ||
|
||
# The "Build" stage. Copies the entire project into the container, into the /app/ folder, and builds it. | ||
# The app is actually packaged in src/test/java, so we need to run couple of specialized steps. | ||
FROM eclipse-temurin:17 AS BUILD | ||
COPY . /app/ | ||
WORKDIR /app/ | ||
# 1. Need to copy all routes to src/main/java otherwise Vaadin plugin won't include JS files into webpack build for all components. | ||
# Workaround for https://github.com/vaadin/flow/issues/14732 | ||
RUN cp -r src/test/java/* src/main/java/ | ||
# 2. Turn all test dependencies into compile deps, so that test files copied to src/main/java/ are compilable. | ||
RUN sed -i 's_<scope>test</scope>_<!-- -->_g' pom.xml | ||
# 3. Finally, build the app | ||
ARG offlinekey | ||
ENV VAADIN_OFFLINE_KEY=$offlinekey | ||
RUN ./mvnw -C clean package -Pproduction -Dvaadin.webpackForFrontendBuild=true -DskipTests | ||
# Prepare a folder with dependencies | ||
RUN ./mvnw dependency:copy-dependencies -DoutputDirectory=target/deps | ||
|
||
# At this point, we have the app as follows: | ||
# 1. All jar deps are at /app/target/deps/*.jar | ||
# 2. We also need to add /app/target/classes/ and /app/target/test-classes/ onto classpath, to include the app itself. | ||
|
||
|
||
# The "Run" stage. Start with a clean image, and copy over just the app itself, omitting gradle, npm and any intermediate build files. | ||
FROM eclipse-temurin:17 | ||
COPY --from=BUILD /app/target/deps /app/ | ||
COPY --from=BUILD /app/target/classes /app/classes | ||
COPY --from=BUILD /app/target/test-classes /app/test-classes | ||
WORKDIR /app/ | ||
RUN ls -la | ||
SHELL ["/bin/bash", "-c"] | ||
RUN echo $'#!/bin/bash\n\ | ||
set -e -o pipefail\n\ | ||
CP=`ls *.jar|tr \'\\n\' \':\'`\n\ | ||
java -cp "classes:test-classes:$CP" com.example.application.Main' >/app/run | ||
RUN chmod a+x /app/run | ||
EXPOSE 8080 | ||
ENTRYPOINT ./run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
This file is auto-generated by Vaadin. | ||
--> | ||
|
||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
body, #outlet { | ||
height: 100vh; | ||
width: 100%; | ||
margin: 0; | ||
} | ||
</style> | ||
<!-- index.ts is included here automatically (either by the dev server or during the build) --> | ||
</head> | ||
<body> | ||
<!-- This outlet div is where the views are rendered --> | ||
<div id="outlet"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.