Compare commits

..

6 Commits

3 changed files with 137 additions and 38 deletions

76
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,76 @@
# ============================================================================
# Template — .gitea/workflows/ci.yml
# Drop this file into each app repo (adjust LIONS_JAVA_VERSION +
# LIONS_APP_NAME + optional --deploy-repo-url). It runs inside the
# registry.lions.dev/lionsdev/lionsctl-ci:latest image, so lionsctl,
# kubectl, helm, docker CLI, JDK 17+21 and Maven are all pre-installed.
#
# Required Gitea repo secrets:
# LIONS_REGISTRY_USERNAME (typically "lionsregistry")
# LIONS_REGISTRY_PASSWORD
# LIONS_GIT_USERNAME (typically "lionsdev")
# LIONS_GIT_ACCESS_TOKEN (Gitea PAT with write:repository, write:package)
# LIONS_GIT_PASSWORD (Gitea password for same user — Helm mode)
# SMTP_HOST SMTP_PORT SMTP_USERNAME SMTP_PASSWORD SMTP_FROM
# ============================================================================
name: CI/CD Pipeline
on:
push:
branches: [ main ]
workflow_dispatch: {}
env:
# Adjust per repo:
# - unionflow-server-impl-quarkus -> 21
# - all others -> 17
LIONS_JAVA_VERSION: "17"
LIONS_CLUSTER: "k1"
jobs:
pipeline:
runs-on: ubuntu-latest
container:
image: registry.lions.dev/lionsdev/lionsctl-ci:latest
credentials:
username: ${{ secrets.LIONS_REGISTRY_USERNAME }}
password: ${{ secrets.LIONS_REGISTRY_PASSWORD }}
# Mount the host docker socket so `docker build/push` inside the
# container hits the runner's daemon (DinD-free).
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: Show tooling
run: |
lionsctl --version || true
docker --version
kubectl version --client=true
helm version --short
mvn --version | head -n2
- name: Pipeline deploy
env:
LIONS_REGISTRY_USERNAME: ${{ secrets.LIONS_REGISTRY_USERNAME }}
LIONS_REGISTRY_PASSWORD: ${{ secrets.LIONS_REGISTRY_PASSWORD }}
LIONS_GIT_USERNAME: ${{ secrets.LIONS_GIT_USERNAME }}
LIONS_GIT_ACCESS_TOKEN: ${{ secrets.LIONS_GIT_ACCESS_TOKEN }}
LIONS_GIT_PASSWORD: ${{ secrets.LIONS_GIT_PASSWORD }}
SMTP_HOST: ${{ secrets.SMTP_HOST }}
SMTP_PORT: ${{ secrets.SMTP_PORT }}
SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
SMTP_FROM: ${{ secrets.SMTP_FROM }}
# No actions/checkout — lionsctl clones internally using git_access_token.
run: |
# For btpxpress-backend add: --deploy-repo-url https://git.lions.dev/lionsdev/btpxpress-server-k1
# For btpxpress-frontend add: --deploy-repo-url https://git.lions.dev/lionsdev/btpxpress-client-k1
lionsctl pipeline \
-u ${{ gitea.server_url }}/${{ gitea.repository }} \
-b ${{ gitea.ref_name }} \
-j ${{ env.LIONS_JAVA_VERSION }} \
-e production \
-c ${{ env.LIONS_CLUSTER }} \
-p prod \
--deploy-repo-url https://git.lions.dev/lionsdev/lionsdev-client-impl-quarkus-k1 \
-m admin@lions.dev

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
# Dockerfile for lionsdev-client-impl-quarkus
# Used by lionsctl pipeline. Expects `mvn clean package -Pprod` to have produced target/quarkus-app/ (fast-jar).
FROM registry.access.redhat.com/ubi8/openjdk-21:1.21
ENV LANGUAGE='en_US:en'
COPY --chown=1001:1001 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=1001:1001 target/quarkus-app/*.jar /deployments/
COPY --chown=1001:1001 target/quarkus-app/app/ /deployments/app/
COPY --chown=1001:1001 target/quarkus-app/quarkus/ /deployments/quarkus/
USER 1001
EXPOSE 8080
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
ENTRYPOINT [ "java", "-jar", "/deployments/quarkus-run.jar" ]

View File

@@ -1,58 +1,59 @@
# lionsdev-client-impl-quarkus # lionsdev-client-impl-quarkus
This project uses Quarkus, the Supersonic Subatomic Java Framework. > Landing + portail LionsDev — `https://lions.dev`
If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>. ## Rôle
## Running the application in dev mode Application web vitrine de l'écosystème LionsDev : présentation des produits (UnionFlow, LUM, BTPXpress), auto-inscription, téléchargements, accès aux différents portails d'administration.
You can run your application in dev mode that enables live coding using: ## Stack
```shell script | Composant | Technologie |
|-----------|-------------|
| Framework | Quarkus 3.27.3 LTS |
| UI | PrimeFaces 14 + Freya |
| Auth | OIDC (Keycloak) |
| Java | 21 |
## Développement local
```shell
./mvnw quarkus:dev ./mvnw quarkus:dev
``` ```
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at <http://localhost:8080/q/dev/>. Dev UI : `http://localhost:8080/q/dev/`
## Packaging and running the application ### Storage local
The application can be packaged using: La propriété `app.storage.base-path` (stockage des fichiers upload) doit être définie. En `%dev`, elle vaut `${user.home}/lionsdev/storage`. En `%prod`, elle lit la variable d'env `STORAGE_PATH`.
```shell script ## Déploiement (lionsctl)
./mvnw package
```bash
lionsctl pipeline \
-u https://git.lions.dev/lionsdev/lionsdev-client-impl-quarkus \
-b feature/business-enhancement \
-j 21 -e production -c k1 -p prod
``` ```
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory. > ⚠️ La branche prod est `feature/business-enhancement` (pas `main`).
Be aware that its not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`. **URL prod** : `https://lions.dev`
**Health** : `https://lions.dev/q/health`
If you want to build an _über-jar_, execute the following command: **Pré-requis infrastructure** avant pipeline (migration Helm → lionsctl) :
- `Dockerfile` racine (fast-jar, `ubi8/openjdk-21:1.21`, UID 1001, `java -jar` direct)
- Deployment Helm existant supprimé au préalable (selector immutable)
- Override env `STORAGE_PATH=/tmp/lionsdev-storage` sur le deployment (lionsctl ne l'injecte pas)
- Service selector à repatcher après pipeline (retirer labels `app.kubernetes.io/*`)
```shell script ## Build
./mvnw package -Dquarkus.package.jar.type=uber-jar
```shell
./mvnw clean package -DskipTests
java -jar target/quarkus-app/quarkus-run.jar
``` ```
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`. ## Licence
## Creating a native executable Propriétaire — Lions Dev © 2026
You can create a native executable using:
```shell script
./mvnw package -Dnative
```
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
```shell script
./mvnw package -Dnative -Dquarkus.native.container-build=true
```
You can then execute your native executable with: `./target/lionsdev-client-impl-quarkus-1.0.0-SNAPSHOT-runner`
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
## Related Guides
- PrimeFaces ([guide](https://quarkiverse.github.io/quarkiverse-docs/quarkus-primefaces/dev/)): PrimeFaces - lets you utilize PrimeFaces and PF Extensions to make JavaServer Faces (JSF) development so much easier!