Skip to content

Commit

Permalink
upgrade to scout 24.1 (#5)
Browse files Browse the repository at this point in the history
* upgrade to scout 24.1

* add mvnw

* add simple Testcase
  • Loading branch information
nisrael authored Jun 2, 2024
1 parent 98ed078 commit 4ca72c3
Show file tree
Hide file tree
Showing 61 changed files with 1,135 additions and 868 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,42 @@ jobs:
contents: read
packages: write

strategy:
matrix:
java-version: [ 17 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
- name: Log into registry ${{ env.DOCKER_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build war and image with Maven and run tests
- name: Build zip with Maven and run tests
run: |
mvn verify \
-B --fail-at-end --no-transfer-progress --file pom.xml \
-D docker.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} \
-D docker.tag=${{ env.DOCKER_TAG_SHA }}
./mvnw verify \
-B --fail-at-end --no-transfer-progress --file pom.xml
- name: Publish Unit Test Report
if: success() || failure()
uses: scacap/action-surefire-report@v1
with:
report_paths: '**/surefire-reports/TEST-*.xml, **/failsafe-reports/TEST-*.xml, **/karma-reports/**/test-*.xml'

- name: Tag and push image except on PR
- name: Build and push image except on PR
if: github.event_name != 'pull_request'
run: |
docker tag \
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_TAG_SHA }} \
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_TAG_REF }}
docker push --all-tags ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
./mvnw install \
-B --no-transfer-progress --file pom.xml \
-P exec.docker.image \
-D docker.app.image.registry=${{ env.DOCKER_REGISTRY }} \
-D docker.app.image.name=${{ env.DOCKER_IMAGE_NAME }} \
-D docker.app.image.tag=${{ env.DOCKER_TAG_REF }} \
-D docker.app.image.tag2=${{ env.DOCKER_TAG_SHA }} \
-am -pl addondemo.app.image
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
20 changes: 3 additions & 17 deletions addondemo.app.dev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,17 @@
<parent>
<groupId>io.sxda.scout.apps</groupId>
<artifactId>addondemo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>24.1.0-SNAPSHOT</version>
<relativePath>../addondemo</relativePath>
</parent>

<!-- Application leaf module with dependencies only relevant for development including config.properties/logback.xml -->
<artifactId>addondemo.app.dev</artifactId>
<packaging>war</packaging>

<name>Addon Demo Application (Development)</name>

<dependencies>
<dependency>
<groupId>org.eclipse.scout.rt</groupId>
<artifactId>org.eclipse.scout.dev.jetty</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.scout.rt</groupId>
<artifactId>org.eclipse.scout.rt.serverbridge</artifactId>
</dependency>
<dependency>
<groupId>io.sxda.scout.apps</groupId>
<artifactId>addondemo.server</artifactId>
</dependency>
<dependency>
<groupId>io.sxda.scout.apps</groupId>
<artifactId>addondemo.ui.html</artifactId>
<artifactId>addondemo.app</artifactId>
</dependency>
</dependencies>
</project>
5 changes: 1 addition & 4 deletions addondemo.app.dev/src/main/resources/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ scout.application.version=development

### Environment
scout.devMode=true
scout.auth.cookieSessionValidateSecure=false

### Security
scout.auth.credentials=admin:admin;scott:tiger
scout.auth.credentialsPlaintext=true

### Storage location for FileSystemUserPreferencesStorageService
scout.client.userArea=${user.home}/io.sxda.scout.apps-addondemo.ui.html.dev

scout.cspDirective[img-src]='self' data:
scout.client.userArea=${user.home}/io.sxda.scout.apps-addondemo.dev
79 changes: 0 additions & 79 deletions addondemo.app.dev/src/main/webapp/WEB-INF/web.xml

This file was deleted.

59 changes: 59 additions & 0 deletions addondemo.app.image/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.sxda.scout.apps</groupId>
<artifactId>addondemo</artifactId>
<version>24.1.0-SNAPSHOT</version>
<relativePath>../addondemo</relativePath>
</parent>

<!-- Application leaf module with dependencies only relevant for docker image build including config.properties/logback.xml -->
<artifactId>addondemo.app.image</artifactId>

<build>
<plugins>
<plugin>
<!-- Google Jib goal 'build' is bound to phase 'package' via profile 'exec.docker.image' -->
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<to>
<image>${docker.app.image.registry}/addondemo</image>
<tags>
<tag>${docker.app.image.tag}</tag>
<tag>${docker.app.image.tag2}</tag>
</tags>
</to>
<from>
<image>${docker.java.image}</image>
</from>
<container>
<mainClass>org.eclipse.scout.rt.app.Application</mainClass>
<ports>
<port>8082</port>
</ports>
<environment>
<scout_app_port>8082</scout_app_port>
</environment>
</container>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>io.sxda.scout.apps</groupId>
<artifactId>addondemo.app</artifactId>
</dependency>

<dependency>
<!-- logback.xml: LogstashEncoder -->
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
</dependency>
</dependencies>
</project>
13 changes: 13 additions & 0 deletions addondemo.app.image/src/main/resources/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Application
scout.application.name=Scout Addon Demo
scout.application.version=${project.version}

### Service tunnel
#scout.backendUrl must be set via environment variable
scout.auth.privateKey=MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCA+vLkyisYR+3+rl6AFBDz6RcGWPeSUuB0KljhZEOoJjA==

### Security
scout.auth.credentials=admin:Q5hBRXwi25yU57UdwZESrw==.cvvCvJLQmtdQSu2VI8Di4f0j/bmf6q3YFOfb3esdRLiXnNnWIl3wHjBI8QSu8K1TfO1lvADmb9aOc1GEEfXztA==;scott:xeCQwEtqP6sRfuvAYYUPHw==.6plBwhPiyYurpq8EysozTOrXe/FTw+pA3uyM0jnuPYz0zx16a4yDxVmhHik/YFiWGhTwMnhx4+bSk3rb5IOn+A==

### Storage location for FileSystemUserPreferencesStorageService
scout.client.userArea=/tmp/io.sxda.scout.apps-addondemo
15 changes: 15 additions & 0 deletions addondemo.app.image/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<contextListener class="org.eclipse.scout.rt.platform.logger.AutoRegisteringJulLevelChangePropagator" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder" /> <!-- for JSON -->
<!-- <encoder class="org.eclipse.scout.rt.platform.logger.FixedPatternLogbackEncoder" /> --> <!-- for plain text -->
</appender>

<root level="INFO">
<appender-ref ref="STDOUT" />
</root>

<logger name="org.quartz" level="WARN" />
</configuration>
6 changes: 0 additions & 6 deletions addondemo.app.war/Dockerfile

This file was deleted.

66 changes: 0 additions & 66 deletions addondemo.app.war/pom.xml

This file was deleted.

20 changes: 0 additions & 20 deletions addondemo.app.war/src/main/resources/logback.xml

This file was deleted.

Loading

0 comments on commit 4ca72c3

Please sign in to comment.