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.
 
 
 
 
 
 

38 line
761 B

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