codebots.bots.deploybot.DeployBot#
- class codebots.bots.deploybot.DeployBot(project=None, config_file=None)[source]#
Bot to help with the deployment of code on a server. It uses a sshBot in the background.
- Parameters:
- projectstr
project name. It is used to find the configuration file associated to it.
- config_filejson
path to a json file containing the required info. You can use the command line to create one or manually configure a json file following this template:
{ "local_repo_path" : "_______", "server_repo_path" : "_______", "server_addres" : "_______", }
Warning
You need to have an sshbot settings configured to grant access to the server.
You must have :code:git>=2.25 on the server side.
Examples
bot = DeployBot('my_project') bot.deploy_to_server()
- Attributes:
- local_repo_pathstr
path to the local clone of the repository
- server_repo_pathstr
path to the server bare repository.
- server_addresstr
complete server address (username@host).
- server_complete_pathstr
complete path to the server repository (username@host:pat/to/server/repository)
- local_repoobj
gitpython Repo object pointing to the local repository.
Methods
deploy_to_server
([remote_name, local_name, ...])Deploy the changes to the server.