Skip to content

External Tool to use in IDE (say Pycharm) to Copy Current Test File/Folder to Kubernetes container. Also you can run the pytest command on Container directly from IDE.

Notifications You must be signed in to change notification settings

nilotpalnandi/Kubectl_Tools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubectl_Tools

External Tool to use in IDE (say Pycharm) to Copy Current Test File/Folder to Kubernetes container. Also you can run:

  • pytest command on Container directly from IDE.
  • Run system-test using /ansible/system_test.yml file
  • Run any ansible-plybook on container (Eg. ansible-playbook se-setup.yml)

How to setup Kubectl Tools in IDE

Refer Pycharm's Create/Edit/Copy Tool Dialog!

Steps to Create External Tools:

  • Clone this Repository in your local machine.
  • In Pycharm IDE, Go to Preferences (⌘,)
  • Go to External Tools under Tools Section
  • Click on + icon to create a new Tool
  • In Name field give any name (Say Kubectl CP)
  • In Program field select full path of the kube_tool*.py python file as below:
    • For Kubectl Copy & Run select kube_tools.py
    • For Kubectl Copy Only select kube_tools_copy.py
    • For Kubectl Run Only select kube_tools_run_test.py
  • In Arguments field enter Two Arguments $FilePath$ and $ModuleName$
  • In Working Directory field enter $ProjectFileDir$ or Kubectl_Tools Project Dir (Optional)
  • Click OK and Apply then you are ready to go!

Sceenshot External Tools

How to Run KubeTools from IDE

  • Select the file or folder you want to copy or run tests on container.
  • Right Click, Go to External Tools and Select your Kubectl Tool
  • That's all! Keep an eye on the Console/Run Tab :)

Notes:

  • When you are running the tool for the first time or when you want to change the Pod Name, Go to ktoolrc.ini file at $ProjectFileDir$ and add/change the value for podname field.
  • This is one time task per Pod Name change.
  • Delete the ktoolrc.ini file from your $ProjectFileDir$, if you make any code changes in this repository as all the constants are picked up by the ini file.
  • Add ktoolrc.ini to your projects .gitignore file if required.

About

External Tool to use in IDE (say Pycharm) to Copy Current Test File/Folder to Kubernetes container. Also you can run the pytest command on Container directly from IDE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%