Skip to content

Instantly share code, notes, and snippets.

@felipefernandes
Created May 11, 2018 23:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipefernandes/d7ed8f99ec59253b4f89f89ca1916f07 to your computer and use it in GitHub Desktop.
Save felipefernandes/d7ed8f99ec59253b4f89f89ca1916f07 to your computer and use it in GitHub Desktop.
Deployment Python Script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
server_user = "user"
server_host = "localhost.domain"
server_path = "/var/www/html/website/"
# Build RSync Command line
args = ["rsync", "-avzH", "--exclude", ".git/ sources/", "-e", "ssh", "."]
args.append("%s@%s:%s"%(server_user, server_host, server_path))
# run rsync
subprocess.call(args)
print "executing: " + ' '.join(args)
@felipefernandes
Copy link
Author

On the bitbucket-pipelines, It's returning the following error:

python deploy.py
rsync: Failed to exec ssh: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [sender=3.1.1]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at io.c(226) [sender=3.1.1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment