As describe in my other post: https://intellij-support.jetbrains.com/hc/en-us/requests/2074883
I would like to create an plugin that checks the git branch of the project directory. Based on the current branch, I want to update the default target deployment.
See the attached screenshot (file name: "Screen Shot 2019-04-24 at 5.54.09 PM.png", right now root@localhost:22372 is my default deployment target, i'm on branch "dev22372".
If I switch to branch "dev22400" (git checkout dev22400), It would be great if Pycharm could switch the default deployment target to "root@localhost:22400", same of every other branch (dev22100, dev2296, etc...).
Any leads or pointer on how to do this with a plugin? (I've never wrote an intellij plugin before).
The plugin could be very simple and very dumb, something like:
In a loop:
- Get current dir git branch
- Check if deployment target is matches the current branch. Branch name in format devXXXX, where XXXX is the localhost port for the deployment target.
---- Update current branch if needed: "git checkout devXXXX" && upload to root@localhost:XXXX
- Sleep 5
Is it doable?