Development - CERIT-SC/funnel-gdi GitHub Wiki
For local development you will probably need the following tools installed on your computer:
git
– for version control.- Go Development Tools – for compiling/linting the code, and running tests.
make
– for running scripts from theMakefile
(in the root of the repo).node
(LTS),yarn
– for developing the frontend dashboard.- Docker Engine, Docker Compose – for testing.
- Code Editor (e.g. Visual Studio Code) – for editing the source code written in GO and JavaScript.
Fetching the Source Code
If you have GitHub account and SSH-key configured:
git clone [email protected]:CERIT-SC/funnel-gdi.git
git checkout master-gdi
Otherwise:
git clone https://github.com/CERIT-SC/funnel-gdi.git
git checkout master-gdi
Building from the Source Code
Build steps are declared in the Makefile
. Most common commands to remember:
-
Build the binary (
./funnel
):make build
-
Run unit tests:
make test
-
Code linting checks:
make lint
-
If you change ProtoBuf files (
*.proto
):make proto build
-
If you change web dashboard files (
webdash/build/
):make webdash build
Running
Typically a custom configuration file is used while developing specific
features. (Please refer to the Configuration guide for details about possible
parameters). So assuming you have such a file with name my-config.yaml
, you
can run the locally built Funnel software as follows:
./funnel server run -f my-config.yaml
On the other terminal window, you can send commands to the running instance. For example, to list the task:
./funnel task list
Note that by default the client-commands expect the service to be running at
http://localhost:8000/ but you can point to another instance using the -S
parameter:
./funnel task list -S "https://tes.example.org"
If you have BASIC authentication enabled, you might also want to specify the username and password for the client commands through environment variables:
export FUNNEL_SERVER_USER="user1"
export FUNNEL_SERVER_PASSWORD="user1-pass"
or JWT Access Token:
export FUNNEL_SERVER_TOKEN="..."