Developer Guide
This article is suitable for all those who want to develop the Cockpit Dogu. It describes all the necessary procedures from setting up the IDE to building the dogu. Here we distinguish between changes to the dogu and the cockpit.
Requirements
-
It is necessary to install the following programs:
- git - see link
- Node.js - see link - required version: 12.14.0
- npm - see link - required version: ^6.13.4
- yarn -
npm install --global yarn - Ruby - see link
- SQLite - see link
- docker-compose - see link
- Bower -
npm install --global bower - Gulp -
npm install --global gulp --force/ you may need to start a new shell afterwards
Setting up the development environment
-
Clone the repository:
git clone https://github.com/cloudogu/cockpit.git
Development on the cockpit dogu
Prerequisites
- A running CES multinode cluster
kubectxset to the cluster as the active context
Build the Cockpit Dogu
make buildNow the dogu should be built, updated, and started automatically.
Development on the cockpit webapp
Prerequisites
For local development, the dependencies of the webapp must be installed:
cd app- change into the webapp directoryyarn install- installs the dependencies for the serverbower install- installs the dependencies for the frontenddocker-compose up- starts a PostgreSQL container
Start local development server
The command gulp serve starts a local development server.
The command should automatically open the client in your browser when it completes.
Execute webapp tests
The unit tests are executed with the following commands:
cd app
yarn install
yarn testSome failing tests generate output on the error console. This can be ignored as long as the tests complete successfully.
Set up local cockpit with remotely running EcoSystem CAS
Run in EcoSystem
First, the CAS development mode must be enabled by running kubectl edit -n ecosystem configmap global-config and setting the value stage to development.
Run locally
Set the necessary information in the file app/server/config/environment/development.js:
casEnabled: true,
fqdn: 'http://[HOST-IP]:[PORT]',
casUrl: 'https://[CAS-SERVICE-IP]/cas',
https: falseSet the environment in startup.sh to development:
NODE_ENV=development node server/Troubleshooting (local setup):
- If you have problems with the certificates, you can change the following entries in
express.js
service_url: 'http://'+config.fqdn+'/cockpit',
proxyCallback_url: 'http://'+config.fqdn+'/cockpit/api/v1/pgtCallback',About welcome dashboards
Welcome dashboards only affect users who have never used cockpit before. Even after an account is deleted, the dashboard created once remains associated with that account in the database. The welcome dashboard can be overwritten with values from the configuration key welcomeDashboard when the container starts.
The following empty dashboard is suitable for testing, since the dogu image already includes a standard welcome dashboard in /resources/welcome.json.
{"title":"Admin-Info Box","structure":"4-8","rows":[{"columns":[{"styleClass":"col-md-4","widgets":[],"cid":"1638872597834-3"},{"styleClass":"col-md-8","widgets":[],"cid":"1638872597834-4"}]}],"dashboardId":1,"titleTemplateUrl":"app/dashboard/partials/custom-dashboard-title.html","modal":{},"pinned":false,"write Access":true,"writeAccess":true}This dashboard can be imported, for example, with kubectl edit -n ecosystem configmap cockpit-config.
data:
config.yaml: |
welcomeDashboard: [...]