update deploy option
This commit is contained in:
parent
18f5f3d36e
commit
5822e770da
@ -195,6 +195,7 @@ If you wanna configure the deployement of your website by rsync::
|
|||||||
|
|
||||||
settings:
|
settings:
|
||||||
deploy:
|
deploy:
|
||||||
|
ssh: true (optional need for ssh)
|
||||||
username: beudbeud (optional need for ssh)
|
username: beudbeud (optional need for ssh)
|
||||||
hostname: beudibox.fr (optional need for ssh)
|
hostname: beudibox.fr (optional need for ssh)
|
||||||
dest: /var/www/surleschemins/build/
|
dest: /var/www/surleschemins/build/
|
||||||
|
@ -545,17 +545,19 @@ def main():
|
|||||||
error(os.system("which rsync > /dev/null") == 0, "I can't locate the rsync, "
|
error(os.system("which rsync > /dev/null") == 0, "I can't locate the rsync, "
|
||||||
"please install the 'rsync' package.\n")
|
"please install the 'rsync' package.\n")
|
||||||
error(Path("build").exists(), "Please build the website before launch deployment")
|
error(Path("build").exists(), "Please build the website before launch deployment")
|
||||||
r_username = settings["settings"]["deploy"]["username"]
|
|
||||||
r_hostname = settings["settings"]["deploy"]["hostname"]
|
|
||||||
r_dest = settings["settings"]["deploy"]["dest"]
|
r_dest = settings["settings"]["deploy"]["dest"]
|
||||||
if settings["settings"]["deploy"]["others"]:
|
if settings["settings"]["deploy"]["others"]:
|
||||||
r_others = settings["settings"]["deploy"]["others"]
|
r_others = settings["settings"]["deploy"]["others"]
|
||||||
else:
|
else:
|
||||||
r_others = ''
|
r_others = ''
|
||||||
r_cmd = "rsync -avz --progress %s build/* %s@%s:%s" % (r_others, r_username, r_hostname, r_dest)
|
if settings["settings"]["deploy"]["ssh"]:
|
||||||
print r_cmd
|
r_username = settings["settings"]["deploy"]["username"]
|
||||||
|
r_hostname = settings["settings"]["deploy"]["hostname"]
|
||||||
|
r_cmd = "rsync -avz --progress %s build/* %s@%s:%s" % (r_others, r_username, r_hostname, r_dest)
|
||||||
|
else:
|
||||||
|
r_cmd = "rsync -avz --progress %s build/* %s" % (r_others, r_dest)
|
||||||
error(os.system(r_cmd) == 0, "deployment failed")
|
error(os.system(r_cmd) == 0, "deployment failed")
|
||||||
#proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, preexec_fn=os.setsid)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
Path("build").makedirs_p()
|
Path("build").makedirs_p()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user