You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

37 lines
741 B

  1. import argparse
  2. import subprocess
  3. def deploy(*, dry_run):
  4. cmd = [
  5. "rsync",
  6. "--itemize-changes",
  7. "--recursive",
  8. "build/html/",
  9. "dedi3:/srv/nginx/html/python",
  10. ]
  11. if dry_run:
  12. cmd.append("--dry-run")
  13. print(*cmd)
  14. subprocess.run(cmd, check=True)
  15. cmd = [
  16. "scp",
  17. "build/latex/programmationenpython.pdf",
  18. "dedi3:/srv/nginx/html/python/cours-python.pdf",
  19. ]
  20. print(*cmd)
  21. if not dry_run:
  22. subprocess.run(cmd, check=True)
  23. def main():
  24. parser = argparse.ArgumentParser()
  25. parser.add_argument("--dry-run", action="store_true")
  26. args = parser.parse_args()
  27. deploy(dry_run=args.dry_run)
  28. if __name__ == "__main__":
  29. main()