Skip to content

Commit af4baa4

Browse files
Use latest custom stack approach, fix demo project and IT (#43)
1 parent 6b1b8a0 commit af4baa4

File tree

14 files changed

+256
-303
lines changed

14 files changed

+256
-303
lines changed

.github/workflows/build.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,47 +45,44 @@ jobs:
4545
continue-on-error: true
4646
strategy:
4747
matrix:
48-
os: [ windows ]
48+
os: [ macos ]
4949
steps:
5050
- name: Setup Chrome
51-
uses: browser-actions/setup-chrome@v1.3.0
51+
uses: browser-actions/setup-chrome@v1.5.0
5252
with:
5353
chrome-version: stable
5454
- if: runner.os == 'Linux'
5555
run: chrome --version
5656
- if: runner.os == 'macOS'
57-
run: chromium --version
57+
run: '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version'
5858
- if: runner.os == 'Windows'
5959
run: (Get-Item (Get-Command chrome).Source).VersionInfo.ProductVersion
60-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6161
with:
6262
fetch-depth: 0
6363
- name: Cache local Maven repository
64-
uses: actions/cache@v3
64+
uses: actions/cache@v4
6565
with:
6666
path: ~/.m2/repository
6767
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
6868
restore-keys: ${{ runner.os }}-maven-
6969
- name: Set up JDK Corretto 21
70-
uses: actions/setup-java@v3
70+
uses: actions/setup-java@v4
7171
with:
7272
distribution: 'corretto'
73-
java-version: '21'
74-
architecture: x64
73+
java-version: 21
7574
- name: Install NodeJS
76-
uses: actions/setup-node@v3
75+
uses: actions/setup-node@v4
7776
with:
7877
node-version: 18
7978
- name: Install esbuild
8079
run: npm i -g esbuild
8180
- name: Install TypeScript compiler
8281
run: npm i -g typescript
83-
- name: Maven Build
84-
run: mvn -T 1C clean install -D skipTests -D maven.javadoc.skip=true -D license.skip=true -U
8582
- name: Integration tests
86-
run: mvn verify -P integration-tests
83+
run: mvn clean install -P integration-tests
8784
- name: Upload selenide screenshots
88-
uses: actions/upload-artifact@v3.1.3
85+
uses: actions/upload-artifact@v4.3.1
8986
if: always()
9087
with:
9188
retention-days: 1

.github/workflows/pull-request.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,46 +43,44 @@ jobs:
4343
continue-on-error: true
4444
strategy:
4545
matrix:
46-
os: [ windows ]
46+
os: [ macos ]
4747
steps:
4848
- name: Setup Chrome
49-
uses: browser-actions/setup-chrome@v1.3.0
49+
uses: browser-actions/setup-chrome@v1.5.0
5050
with:
5151
chrome-version: stable
5252
- if: runner.os == 'Linux'
5353
run: chrome --version
5454
- if: runner.os == 'macOS'
55-
run: chromium --version
55+
run: '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version'
5656
- if: runner.os == 'Windows'
5757
run: (Get-Item (Get-Command chrome).Source).VersionInfo.ProductVersion
58-
- uses: actions/checkout@v3
58+
- uses: actions/checkout@v4
5959
with:
6060
fetch-depth: 0
6161
- name: Cache local Maven repository
62-
uses: actions/cache@v3
62+
uses: actions/cache@v4
6363
with:
6464
path: ~/.m2/repository
6565
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
6666
restore-keys: ${{ runner.os }}-maven-
6767
- name: Set up JDK Corretto 21
68-
uses: actions/setup-java@v3
68+
uses: actions/setup-java@v4
6969
with:
7070
distribution: 'corretto'
7171
java-version: 21
7272
- name: Install NodeJS
73-
uses: actions/setup-node@v3
73+
uses: actions/setup-node@v4
7474
with:
7575
node-version: 18
7676
- name: Install esbuild
7777
run: npm i -g esbuild
7878
- name: Install TypeScript compiler
7979
run: npm i -g typescript
80-
- name: Maven Build
81-
run: mvn -T 1C clean install -D skipTests -D maven.javadoc.skip=true -D license.skip=true -U
8280
- name: Integration tests
83-
run: mvn verify -P integration-tests
81+
run: mvn clean install -P integration-tests
8482
- name: Upload selenide screenshots
85-
uses: actions/upload-artifact@v3.1.3
83+
uses: actions/upload-artifact@v4.3.1
8684
if: always()
8785
with:
8886
retention-days: 1

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,42 @@ It is good for exploration about the different features and their applicability
77

88
#### Docker
99

10+
- Build image locally (if you have local changes)
11+
```
12+
docker build application/. --tag ghcr.io/dirigiblelabs/custom-stack:latest
13+
```
14+
- Run directly the released image
1015
```
1116
docker pull ghcr.io/dirigiblelabs/custom-stack:latest
1217
docker run --name custom-stack --rm -p 8080:8080 ghcr.io/dirigiblelabs/custom-stack:latest
1318
```
14-
15-
- For Apple's M1: provide `--platform=linux/arm64` for better performance
19+
**Note:** for Apple's M1: provide `--platform=linux/arm64` for better performance
1620

1721
#### Build
1822

1923
```
2024
mvn clean install
2125
```
26+
##### Maven Profiles
27+
28+
| Profile Name | Description |
29+
|-------------------|---------------------------------------------|
30+
| tests | Run unit and integration tests |
31+
| unit-tests | Run unit tests |
32+
| integration-tests | Run integration tests |
33+
| quick-build | Build project quickly by skipping all tests |
34+
2235

2336
#### Run
2437

2538
```
26-
java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED -jar application/target/custom-stack-application-*.jar
39+
java -jar application/target/custom-stack-application-*.jar
2740
```
2841

2942
#### Debug
3043

3144
```
32-
java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -jar application/target/custom-stack-application-*.jar
45+
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -jar application/target/custom-stack-application-*.jar
3346
```
3447

3548
#### Web
@@ -160,4 +173,4 @@ export class ExampleClient {
160173
return response;
161174
}
162175
}
163-
```
176+
```

application/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazoncorretto:22-alpine
1+
FROM amazoncorretto:21-alpine
22

33
VOLUME /tmp
44

@@ -7,4 +7,7 @@ RUN npm i -g esbuild
77
RUN npm i -g typescript
88

99
COPY target/*.jar custom-stack.jar
10+
11+
EXPOSE 8080
12+
1013
ENTRYPOINT ["java", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", "--add-opens", "java.base/java.nio=ALL-UNNAMED", "-jar", "/custom-stack.jar"]

application/pom.xml

Lines changed: 9 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919
<dependency>
2020
<groupId>io.dirigible.samples</groupId>
2121
<artifactId>custom-stack-apis</artifactId>
22-
<version>1.0.0-SNAPSHOT</version>
2322
</dependency>
2423
<dependency>
2524
<groupId>io.dirigible.samples</groupId>
2625
<artifactId>custom-stack-branding</artifactId>
27-
<version>1.0.0-SNAPSHOT</version>
2826
</dependency>
2927
<dependency>
3028
<groupId>uk.org.okapibarcode</groupId>
@@ -67,26 +65,6 @@
6765
<groupId>org.eclipse.dirigible</groupId>
6866
<artifactId>dirigible-components-group-engines</artifactId>
6967
<type>pom</type>
70-
<exclusions>
71-
<exclusion>
72-
<groupId>javax.validation</groupId>
73-
<artifactId>validation-api</artifactId>
74-
</exclusion>
75-
<exclusion>
76-
<groupId>javax.servlet</groupId>
77-
<artifactId>javax.servlet-api</artifactId>
78-
</exclusion>
79-
<exclusion>
80-
<groupId>org.apache.cxf</groupId>
81-
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
82-
</exclusion>
83-
<exclusion>
84-
<groupId>org.apache.cxf</groupId>
85-
<artifactId>
86-
cxf-spring-boot-starter-jaxrs
87-
</artifactId>
88-
</exclusion>
89-
</exclusions>
9068
</dependency>
9169
<dependency>
9270
<groupId>org.eclipse.dirigible</groupId>
@@ -137,13 +115,6 @@
137115
<artifactId>spring-boot-starter-validation</artifactId>
138116
</dependency>
139117

140-
<dependency>
141-
<groupId>com.codeborne</groupId>
142-
<artifactId>selenide</artifactId>
143-
<version>7.3.1</version>
144-
<scope>test</scope>
145-
</dependency>
146-
147118
<!-- Drivers -->
148119
<dependency>
149120
<groupId>org.postgresql</groupId>
@@ -156,59 +127,33 @@
156127
<dependency>
157128
<groupId>com.sap.cloud.db.jdbc</groupId>
158129
<artifactId>ngdbc</artifactId>
159-
<version>${ngdbc.version}</version>
160130
</dependency>
161131
<dependency>
162132
<groupId>net.snowflake</groupId>
163133
<artifactId>snowflake-jdbc</artifactId>
164-
<version>${snowflake.version}</version>
165134
</dependency>
166135
<dependency>
167136
<groupId>org.eclipse.dirigible</groupId>
168137
<artifactId>dirigible-tests-framework</artifactId>
169138
</dependency>
170-
171139
</dependencies>
172140

173141
<build>
174-
<plugins>
175-
<plugin>
176-
<groupId>org.springframework.boot</groupId>
177-
<artifactId>spring-boot-maven-plugin</artifactId>
178-
<configuration>
179-
<mainClass>io.dirigible.samples.CustomStackApplication</mainClass>
180-
</configuration>
181-
<executions>
182-
<execution>
183-
<goals>
184-
<goal>repackage</goal>
185-
</goals>
186-
</execution>
187-
</executions>
188-
</plugin>
189-
<plugin>
190-
<groupId>pl.project13.maven</groupId>
191-
<artifactId>git-commit-id-plugin</artifactId>
192-
<version>${git-commit-id-plugin.version}</version>
193-
<executions>
194-
<execution>
195-
<id>get-the-git-infos</id>
196-
<goals>
197-
<goal>revision</goal>
198-
</goals>
199-
</execution>
200-
</executions>
201-
<configuration>
202-
<dotGitDirectory>../.git</dotGitDirectory>
203-
</configuration>
204-
</plugin>
205-
</plugins>
142+
206143
<resources>
207144
<resource>
208145
<directory>src/main/resources</directory>
209146
<filtering>true</filtering>
210147
</resource>
211148
</resources>
149+
150+
<plugins>
151+
<plugin>
152+
<groupId>org.springframework.boot</groupId>
153+
<artifactId>spring-boot-maven-plugin</artifactId>
154+
</plugin>
155+
</plugins>
156+
212157
</build>
213158

214159
</project>

application/src/main/resources/application-keycloak.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ spring.security.oauth2.client.registration.keycloak.client-id=${DIRIGIBLE_KEYCLO
88
spring.security.oauth2.client.registration.keycloak.scope=openid,profile,roles,microprofile-jwt,email,phone,web-origins,address,offline_access
99
spring.security.oauth2.client.registration.keycloak.authorization-grant-type=authorization_code
1010

11-
spring.security.oauth2.client.provider.keycloak.user-name-attribute=preferred_username
11+
spring.security.oauth2.client.provider.keycloak.user-name-attribute=preferred_username
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
basic.enabled=false
2+
3+
spring.security.oauth2.client.registration.github.clientId=${GITHUB_CLIENT_ID}
4+
spring.security.oauth2.client.registration.github.clientSecret=${GITHUB_CLIENT_SECRET}

application/src/main/resources/application.properties

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,18 @@ spring.mvc.async.request-timeout=3600000
1616

1717
basic.enabled=${DIRIGIBLE_BASIC_ENABLED:true}
1818

19-
terminal.enabled=${DIRIGIBLE_TERMINAL_ENABLED:false}
20-
21-
keycloak.enabled=${DIRIGIBLE_KEYCLOAK_ENABLED:false}
22-
keycloak.realm=${DIRIGIBLE_KEYCLOAK_REALM:null}
23-
keycloak.auth-server-url=${DIRIGIBLE_KEYCLOAK_AUTH_SERVER_URL:null}
24-
keycloak.ssl-required=${DIRIGIBLE_KEYCLOAK_SSL_REQUIRED:external}
25-
keycloak.resource=${DIRIGIBLE_KEYCLOAK_CLIENT_ID:null}
26-
keycloak.public-client=true
27-
keycloak.principal-attribute=preferred_username
28-
keycloak.confidential-port=${DIRIGIBLE_KEYCLOAK_CONFIDENTIAL_PORT:443}
29-
keycloak.use-resource-role-mappings=true
19+
terminal.enabled=${DIRIGIBLE_TERMINAL_ENABLED:true}
3020

3121
management.metrics.mongo.command.enabled=false
3222
management.metrics.mongo.connectionpool.enabled=false
3323

34-
management.endpoints.jmx.exposure.include=*
35-
management.endpoints.jmx.exposure.exclude=
24+
cxf.path=/odata/v2
25+
3626
management.endpoints.web.exposure.include=*
37-
management.endpoints.web.exposure.exclude=
38-
management.endpoint.health.show-details=always
3927

4028
springdoc.api-docs.path=/api-docs
4129

42-
cxf.path=/odata/v2
43-
4430
# the following are used to force the Spring to create QUARTZ tables
4531
# quartz properties are manged in quartz.properties don't try to add them here
4632
spring.quartz.job-store-type=jdbc
47-
spring.quartz.jdbc.initialize-schema=always
33+
spring.quartz.jdbc.initialize-schema=always

0 commit comments

Comments
 (0)