OSC / ood_core

Open OnDemand core library

Home Page:https://osc.github.io/ood_core/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add equivalent of a dotenv file to batch connect (a local.sh)

sync-by-unito opened this issue · comments

A local.sh file, if present in the staged working directory, would be sourced before or after the before.sh and would affect the functionality of the rest of the app.

The dashboard could copy such a file from /etc/ood/config/apps/bc_app_name/local.sh
Also would be for the desktop configs to be able to have one they all use, or a per desktop local.sh.

The idea is that this would load maybe after or before the before.sh - sourced into the environment so it affects the rest of the application.

This requires changes to both dashboard and ood_core

┆Issue is synchronized with this Asana task by Unito

➤ Eric Franz commented:

Desktop apps are the odd-ball - how do you provide a local.sh for all the desktops to use? Here is a proposal: you have /var/www/ood/apps/sys/bc_desktop with /etc/ood/config/apps/bc_desktop/owens.yml then the load order would be:
  1. source /var/www/ood/apps/sys/bc_desktop/template/local.sh
  2. source /etc/ood/config/apps/bc_desktop/local.sh
  3. source /etc/ood/config/apps/bc_desktop/owens.local.sh

ood_core batch connect doesn't know about the files in /etc/ but we could update the batch connect script to source local.sh file if it exists, the same way before.sh is sourced. We could source this after before.sh.

then the dashboard app could be responsible for cat-ing the local.sh files together during the copy so something like:

cat /var/www/ood/apps/sys/bc_desktop/template/local.sh /etc/ood/config/apps/bc_desktop/local.sh /etc/ood/config/apps/bc_desktop/owens.local.sh > WORKDIR/local.shor whatever the Ruby equivalent is.