This repo contains development environment for convenient development to Janus Gateway core (don't mess with Janus Conference plugin).
Janus Gateway is being maintained by Meetecho and sometimes we send pull requests in C for them. For that purpose we have a fork however we must not include our development environment (dockerfiles, configs, etc.) in those PRs so we store it here in a separate repo and the fork repo is mounted as a git submodule.
Say, you need to make changes in the Janus Gateway codebase.
- Clone this repo and
cd
to it:
git clone git@github.com:netology-group/janus-gateway-dev.git
cd janus-gateway-dev
-
Copy
docker/janus.plugin.conference.environment.sample
asjanus.plugin.conference.environment
and fill in actual values. -
Add Meetecho's repo as upstream to the submodule:
cd janus-gateway
git remote add upstream https://github.com/meetecho/janus-gateway.git
- Fetch the latest changes from the upstream, merge them to the fork's master branch and push to start from the latest version:
git fetch upstream
git merge upstream/master
git push origin master
- Create a new branch:
git checkout -b my-feature
-
Make your changes in the C codebase.
-
cd
to the repo's root and rundocker-compose
to build and start Janus Gateway with your changes + Janus Conference plugin along with VerneMQ broker + MQTT Gateway plugin:
cd ..
export COMPOSE_FILE=docker/docker-compose.yml
docker-compose up -d
docker-compose exec janus /opt/janus/bin/janus
-
If everything compiled and started properly test your feature and basic Janus Conference scenarios manually. WARNING: Janus Conference plugin may be outdated in this repo. You may need to update the version in
docker/develop.dockerfile
. -
Commit and push your changes into the fork repository:
cd janus-gateway
git add .
git commit -m "Add some awesome stuff"
git push origin my-feature
-
Open the fork repo on GitHub and create a pull request to the Meetecho's repo.
-
If you can't wait for the PR to be merged you can temporarily switch to the fork repo in Janus Conference. For that change Dockerfile and develop.dockerfile by changing
https://github.com/meetecho/janus-gateway
tohttps://github.com/netology-group/janus-gateway
and settingJANUS_GATEWAY_COMMIT
to your branch's head. -
When Lorenzo from Meetecho merges the PR you should update
JANUS_GATEWAY_COMMIT
to the latest SHA1 from Meetecho's repo master branch and switch back to that repo if you have switched to the fork in the previous step. Build and test it again before pushing/deploying because other commits might been made in Janus Gateway that could break some things.
This repo has debug configuration for VSCode in .vscode/launch.json
.
- Run Janus under gdbserver:
gdbserver :2000 /opt/janus/bin/janus
. - Set breakpoints in the C code in janus-gateway directory.
- In VSCode choose Debug -> Start Debugging.