Developer Guide
This article is suitable for all those who want to develop on the Cockpit Dogu. It describes all the necessary procedures from setting up the IDE to creating 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
- Ruby - see link
- SQLite - see link
- docker-compose - see link
- bower -
npm install --global bower
- yarn -
npm install --global yarn
- 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 Vagrant machine for the CES
Cockpit Dogu build
The build process of the Dogus is always executed in the Vagrant machine.
- change to the root directory of the portainer dogu (in vagrant)
-
build the dogu
cesapp build .
Now 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
- install the dependencies for the serverbower install
- installs the dependencies for the frontenddocker-compose up
- starts a PostgresSQL container
Start local development server
The gulp serve
command will start a local development server.
The command should automatically open the client in your browser when it completes.
Build webapp
Use the grunt build
command to build the webapp.
Run webapp tests
The yarn test
command will run the unit tests with karma.
Setup local cockpit with remote running EcoSystem CAS
Running in EcoSystem
First, the CAS development mode must be enabled by running the command etcdctl set /config/_global/stage development
within the EcoSystem.
After that, the CAS must be restarted.
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: false
Set 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',