Skip to content

add Jenkinsfile for build ci pipeline#542

Open
fpichler wants to merge 4 commits into
devfrom
jenkinsfile-ci-pipeline
Open

add Jenkinsfile for build ci pipeline#542
fpichler wants to merge 4 commits into
devfrom
jenkinsfile-ci-pipeline

Conversation

@fpichler

@fpichler fpichler commented Jun 11, 2026

Copy link
Copy Markdown
Member

Add Jenkinsfile for build CI pipeline and align environment profiles

Description

This PR introduces a declarative Jenkinsfile at the root of the repository to build and push the celements-admin-frontend Docker image to the GitHub Container Registry (ghcr.io). It also introduces the celdev environment profile and aligns/updates the integration environment configuration.

Proposed Changes

Jenkins Pipeline

  • Added Jenkinsfile:
    • Configures a multi-stage declarative pipeline (Checkout -> Build Frontend Docker Image -> Push to GHCR).
    • Generates and tags the image using the current aligned version (7.1) as well as the short Git SHA.
    • Assumes credentials with ID ghcr-credentials are configured in Jenkins for authorization with ghcr.io.

Environment Configurations (celements-admin-frontend)

  • Added .env.celdev:
    • Configured environment settings for the celdev profile pointing to https://bellis.celdev.sneakapeek.ch and Keycloak realm celdev.
  • Renamed & Updated .env.int ➡️ .env.celint:
    • Aligned the filename with the celint naming standard.
    • Corrected VITE_CEL_API_URL to point to the demospace.ch domain: https://bellis.celint.demospace.ch (previously pointed to sneakapeek.ch).

Comment thread Jenkinsfile Outdated
@msladek msladek assigned fpichler and unassigned msladek Jun 13, 2026
@fpichler fpichler requested a review from msladek June 18, 2026 01:04
@fpichler fpichler assigned msladek and unassigned fpichler Jun 18, 2026
Comment thread Jenkinsfile Outdated
Comment thread Jenkinsfile Outdated
Comment thread Jenkinsfile Outdated
@msladek msladek assigned fpichler and unassigned msladek Jun 21, 2026

const localDev =
options.localDev ?? (import.meta.env.VITE_ENABLE_LOCAL_DEVELOPMENT ?? 'true') === 'true';
options.localDev ?? appConfig.enableLocalDevelopment;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldnt it be simpler to use import.meta.env.DEV (true in npm run dev) instead of a local config value?


# cel access
VITE_CEL_USER=
VITE_CEL_TOKEN=

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we remove .env.celdev and .env.celint? appConfig should be the preferred configuration mechanism. env- or node-specific values belong on the target nodes, not in this public code repo.

for local configuration:

cp config.sample.js public/config.js && vim public/config.js

Comment on lines +12 to +16
appBaseUrl: '$(escape_js_string "${APP_BASE_URL:-}")',
keycloakBaseUrl: '$(escape_js_string "${KEYCLOAK_BASE_URL:-}")',
keycloakRealm: '$(escape_js_string "${KEYCLOAK_REALM:-}")',
keycloakClientId: '$(escape_js_string "${KEYCLOAK_CLIENT_ID:-}")',
keycloakClientSecret: '$(escape_js_string "${KEYCLOAK_CLIENT_SECRET:-}")',

@msladek msladek Jun 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
appBaseUrl: '$(escape_js_string "${APP_BASE_URL:-}")',
keycloakBaseUrl: '$(escape_js_string "${KEYCLOAK_BASE_URL:-}")',
keycloakRealm: '$(escape_js_string "${KEYCLOAK_REALM:-}")',
keycloakClientId: '$(escape_js_string "${KEYCLOAK_CLIENT_ID:-}")',
keycloakClientSecret: '$(escape_js_string "${KEYCLOAK_CLIENT_SECRET:-}")',
appBaseUrl: '$(escape_js_string "${APP_BASE_URL}")',
keycloakBaseUrl: '$(escape_js_string "${KEYCLOAK_BASE_URL}")',
keycloakRealm: '$(escape_js_string "${KEYCLOAK_REALM}")',
keycloakClientId: '$(escape_js_string "${KEYCLOAK_CLIENT_ID}")',
keycloakClientSecret: '$(escape_js_string "${KEYCLOAK_CLIENT_SECRET}")',

mandatory fields should fast fail if unset (sh strict mode) to prevent config errors.

@@ -0,0 +1,22 @@
#!/bin/sh
set -eu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set -eu
set -euo pipefail

POSIX.1-2024 specification added support for pipefail, so it is fine in sh files.

Comment on lines +13 to +17
const appBaseUrl = appConfig.appBaseUrl;
const authBaseUrl = appConfig.keycloakBaseUrl;
const realm = appConfig.keycloakRealm;
const clientId = appConfig.keycloakClientId;
const clientSecret = appConfig.keycloakClientSecret;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const appBaseUrl = appConfig.appBaseUrl;
const authBaseUrl = appConfig.keycloakBaseUrl;
const realm = appConfig.keycloakRealm;
const clientId = appConfig.keycloakClientId;
const clientSecret = appConfig.keycloakClientSecret;
const { appBaseUrl, authBaseUrl, realm, clientId, clientSecret } = appConfig.appBaseUrl;


# Layer: dependencies
COPY package*.json ./
RUN npm install --legacy-peer-deps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUN npm ci

Comment thread .gitignore

# End of https://www.toptal.com/developers/gitignore/api/java,linux,macos,maven,eclipse,windows,visualstudiocode,node

celements-admin-frontend/public/config.js

@msladek msladek Jun 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
celements-admin-frontend/public/config.js
**/public/config.js

more frontends will likely follow :)

@msladek msladek Jun 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants