Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
support runtime vars in addon itself
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Nov 12, 2021
1 parent 57a3005 commit 29ce50f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pipeline {
script {
try {
sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg'''
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e RAZZLE_FRONTEND_VERSION=eeacms/forests-frontend:2.4.3 -e RAZZLE_FRONTEND_VERSION_URL=https://github.com/eea/forests-frontend/releases/tag/2.4.3 -e RAZZLE_FRONTEND_PUBLISHED_AT=2021-06-18T15:15:04Z -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
Expand Down
4 changes: 4 additions & 0 deletions src/constants/runtime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const RAZZLE_FRONTEND_VERSION = 'eeacms/forests-frontend:2.4.3';
export const RAZZLE_FRONTEND_VERSION_URL =
'https://github.com/eea/forests-frontend/releases/tag/2.4.3';
export const RAZZLE_FRONTEND_PUBLISHED_AT = '2021-06-18T15:15:04Z';
14 changes: 11 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { applyConfig as installFiseFrontend } from './localconfig';

import ObjectListInlineWidget from './components/manage/Widgets/ObjectListInlineWidget';
import reducers from '@eeacms/volto-forests-theme/reducers';
import {
RAZZLE_FRONTEND_VERSION,
RAZZLE_FRONTEND_VERSION_URL,
RAZZLE_FRONTEND_PUBLISHED_AT,
} from '@eeacms/volto-forests-theme/constants/runtime';

import '@plone/volto/config';

Expand All @@ -19,9 +24,12 @@ export default function applyConfig(config) {
config.settings = {
...config.settings,
frontendMeta: {
version: process.env.RAZZLE_FRONTEND_VERSION || null,
version_url: process.env.RAZZLE_FRONTEND_VERSION_URL || null,
published_at: process.env.RAZZLE_FRONTEND_PUBLISHED_AT || null,
version: process.env.RAZZLE_FRONTEND_VERSION || RAZZLE_FRONTEND_VERSION,
version_url:
process.env.RAZZLE_FRONTEND_VERSION_URL || RAZZLE_FRONTEND_VERSION_URL,
published_at:
process.env.RAZZLE_FRONTEND_PUBLISHED_AT ||
RAZZLE_FRONTEND_PUBLISHED_AT,
},
timezone: 'CET',
pathsWithFullobjects: ['/news', '/events'],
Expand Down

0 comments on commit 29ce50f

Please sign in to comment.