add Jenkinsfile for build ci pipeline#542
Conversation
|
|
||
| const localDev = | ||
| options.localDev ?? (import.meta.env.VITE_ENABLE_LOCAL_DEVELOPMENT ?? 'true') === 'true'; | ||
| options.localDev ?? appConfig.enableLocalDevelopment; |
There was a problem hiding this comment.
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= |
There was a problem hiding this comment.
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| 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:-}")', |
There was a problem hiding this comment.
| 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 | |||
There was a problem hiding this comment.
| set -eu | |
| set -euo pipefail |
POSIX.1-2024 specification added support for pipefail, so it is fine in sh files.
| const appBaseUrl = appConfig.appBaseUrl; | ||
| const authBaseUrl = appConfig.keycloakBaseUrl; | ||
| const realm = appConfig.keycloakRealm; | ||
| const clientId = appConfig.keycloakClientId; | ||
| const clientSecret = appConfig.keycloakClientSecret; |
There was a problem hiding this comment.
| 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 |
|
|
||
| # End of https://www.toptal.com/developers/gitignore/api/java,linux,macos,maven,eclipse,windows,visualstudiocode,node | ||
|
|
||
| celements-admin-frontend/public/config.js |
There was a problem hiding this comment.
| celements-admin-frontend/public/config.js | |
| **/public/config.js |
more frontends will likely follow :)
There was a problem hiding this comment.
use newly available dockerImagePipeline in with mode: 'node'
e.g.: https://github.com/progonline/progon-apps/blob/dev/event-webform/event-webform-frontend/Jenkinsfile
Add Jenkinsfile for build CI pipeline and align environment profiles
Description
This PR introduces a declarative
Jenkinsfileat the root of the repository to build and push thecelements-admin-frontendDocker image to the GitHub Container Registry (ghcr.io). It also introduces theceldevenvironment profile and aligns/updates the integration environment configuration.Proposed Changes
Jenkins Pipeline
Jenkinsfile:7.1) as well as the short Git SHA.ghcr-credentialsare configured in Jenkins for authorization withghcr.io.Environment Configurations (
celements-admin-frontend).env.celdev:celdevprofile pointing tohttps://bellis.celdev.sneakapeek.chand Keycloak realmceldev..env.int➡️.env.celint:celintnaming standard.VITE_CEL_API_URLto point to thedemospace.chdomain:https://bellis.celint.demospace.ch(previously pointed tosneakapeek.ch).