How can I automate remote deployment in python?

1.5k Views Asked by At

I want to automate the remote deployment which currently I am doing manually.

The process includes

  1. Make the tar ball from certain folders
  2. SFTP to the remote server
  3. Rename the old folders
  4. Untar the new tar file
  5. Restart apache

The remote system is on the intranet and has no access to the outside internet

I want to know how can I transfer the file from my python script and then when the transfer is complete then log into ssh and do stuff. I am confused about how can I achieve that. On localhost and I can do all that but how can I do that on a remote host?

1

There are 1 best solutions below

0
On

For simple&dirty work you can use fabric (This by no means say that you cannot use fabric to build serious product)

For heavy configuration routines, you'd better pick a CMS (e.g., ansible)