|
468 | 468 | "text": [ |
469 | 469 | "usage: plash_deploy [-h] [--path PATH] [--name NAME] [--force_data]\n", |
470 | 470 | "\n", |
471 | | - "Deploys app to production. By d" |
472 | | - ] |
473 | | - }, |
474 | | - { |
475 | | - "name": "stdout", |
476 | | - "output_type": "stream", |
477 | | - "text": [ |
478 | | - "efault, this command erases all files in your app which are not in data/. Then uploads\n", |
479 | | - "all files and" |
480 | | - ] |
481 | | - }, |
482 | | - { |
483 | | - "name": "stdout", |
484 | | - "output_type": "stream", |
485 | | - "text": [ |
486 | | - " folders, except paths starting with `.` and except the local data/ directory. If `--force_data` is " |
487 | | - ] |
488 | | - }, |
489 | | - { |
490 | | - "name": "stdout", |
491 | | - "output_type": "stream", |
492 | | - "text": [ |
493 | | - "used,\n", |
494 | | - "then it erases all files in production. Then it uploads all files and folders, including `data" |
| 471 | + "options:\n", |
| 472 | + " -h, --help show t" |
495 | 473 | ] |
496 | 474 | }, |
497 | 475 | { |
498 | 476 | "name": "stdout", |
499 | 477 | "output_type": "stream", |
500 | 478 | "text": [ |
501 | | - "/`, except paths starting\n", |
502 | | - "with `.`.\n", |
503 | | - "\n", |
504 | | - "options:\n", |
505 | | - " -h, --help show this help message and exit\n", |
506 | | - " --pa" |
| 479 | + "his help message and exit\n", |
| 480 | + " --path PATH Path to project (default: .)\n", |
| 481 | + " --name NAME Overrides the" |
507 | 482 | ] |
508 | 483 | }, |
509 | 484 | { |
510 | 485 | "name": "stdout", |
511 | 486 | "output_type": "stream", |
512 | 487 | "text": [ |
513 | | - "th PATH Path to project (default: .)\n", |
514 | | - " --name NAME Overrides the .plash file in project root if " |
| 488 | + " .plash file in project root if provided\n", |
| 489 | + " --force_data Overwrite data/ directory during deployment" |
515 | 490 | ] |
516 | 491 | }, |
517 | 492 | { |
518 | 493 | "name": "stdout", |
519 | 494 | "output_type": "stream", |
520 | 495 | "text": [ |
521 | | - "provided\n", |
522 | | - " --force_data Overwrite data/ directory during deployment (default: False)\n" |
| 496 | + " (default: False)\n" |
523 | 497 | ] |
524 | 498 | } |
525 | 499 | ], |
|
538 | 512 | "#| export\n", |
539 | 513 | "@call_parse\n", |
540 | 514 | "def view(\n", |
541 | | - " path:Path=Path('.'), # Path to project directory\n", |
| 515 | + " path:Path='.', # Path to project directory\n", |
542 | 516 | " name:str=None, # Overrides the .plash file in project root if provided\n", |
543 | 517 | "):\n", |
544 | 518 | " \"Open your app in the browser\"\n", |
|
605 | 579 | "source": [ |
606 | 580 | "#| export\n", |
607 | 581 | "def delete(\n", |
608 | | - " path:Path=Path('.'), # Path to project\n", |
| 582 | + " path:Path='.', # Path to project\n", |
609 | 583 | " name:str=None): # Overrides the .plash file in project root if provided\n", |
610 | 584 | " 'Delete your deployed app'\n", |
611 | 585 | " name = _prep(path, name)\n", |
|
691 | 665 | "source": [ |
692 | 666 | "#| export\n", |
693 | 667 | "def start(\n", |
694 | | - " path:Path=Path('.'), # Path to project\n", |
| 668 | + " path:Path='.', # Path to project\n", |
695 | 669 | " name:str=None): # Overrides the .plash file in project root if provided\n", |
696 | 670 | " 'Start your deployed app'\n", |
697 | 671 | " name = _prep(path, name)\n", |
|
727 | 701 | "text": [ |
728 | 702 | "usage: plash_start [-h] [--path PATH] [--name NAME]\n", |
729 | 703 | "\n", |
730 | | - "Start your deployed app\n", |
731 | | - "\n", |
732 | 704 | "options:\n", |
733 | | - " -h, --help " |
| 705 | + " -h, --help show this help message " |
| 706 | + ] |
| 707 | + }, |
| 708 | + { |
| 709 | + "name": "stdout", |
| 710 | + "output_type": "stream", |
| 711 | + "text": [ |
| 712 | + "and exit\n", |
| 713 | + " --path PATH Path to project (default: .)\n", |
| 714 | + " --name NAME Overrides the .plash file in pro" |
734 | 715 | ] |
735 | 716 | }, |
736 | 717 | { |
737 | 718 | "name": "stdout", |
738 | 719 | "output_type": "stream", |
739 | 720 | "text": [ |
740 | | - " show this help message and exit\n", |
741 | | - " --path PATH (default: .)\n", |
742 | | - " --name NAME\n" |
| 721 | + "ject root if provided\n" |
743 | 722 | ] |
744 | 723 | } |
745 | 724 | ], |
|
757 | 736 | "source": [ |
758 | 737 | "#| export\n", |
759 | 738 | "def stop(\n", |
760 | | - " path:Path=Path('.'), # Path to project\n", |
| 739 | + " path:Path='.', # Path to project\n", |
761 | 740 | " name:str=None): # Overrides the .plash file in project root if provided\n", |
762 | 741 | " 'Stop your deployed app'\n", |
763 | 742 | " name = _prep(path, name)\n", |
|
793 | 772 | "text": [ |
794 | 773 | "usage: plash_stop [-h] [--path PATH] [--name NAME]\n", |
795 | 774 | "\n", |
796 | | - "Stop your deployed app\n", |
797 | | - "\n", |
798 | 775 | "options:\n", |
799 | | - " -h, --help " |
| 776 | + " -h, --help show this help message a" |
800 | 777 | ] |
801 | 778 | }, |
802 | 779 | { |
803 | 780 | "name": "stdout", |
804 | 781 | "output_type": "stream", |
805 | 782 | "text": [ |
806 | | - "show this help message and exit\n", |
807 | | - " --path PATH (default: .)\n", |
808 | | - " --name NAME\n" |
| 783 | + "nd exit\n", |
| 784 | + " --path PATH Path to project (default: .)\n", |
| 785 | + " --name NAME Overrides the .plash file in proj" |
| 786 | + ] |
| 787 | + }, |
| 788 | + { |
| 789 | + "name": "stdout", |
| 790 | + "output_type": "stream", |
| 791 | + "text": [ |
| 792 | + "ect root if provided\n" |
809 | 793 | ] |
810 | 794 | } |
811 | 795 | ], |
|
834 | 818 | "source": [ |
835 | 819 | "#| export\n", |
836 | 820 | "def logs(\n", |
837 | | - " path:Path=Path('.'), # Path to project\n", |
| 821 | + " path:Path='.', # Path to project\n", |
838 | 822 | " name:str=None, # Overrides the .plash file in project root if provided\n", |
839 | 823 | " mode:log_modes='build'): # Choose between build or app logs\n", |
840 | 824 | " 'Get logs for your deployed app'\n", |
|
882 | 866 | "text": [ |
883 | 867 | "usage: plash_logs [-h] [--path PATH] [--name NAME] [--mode {build,app}] [--tail]\n", |
884 | 868 | "\n", |
885 | | - "Prints the logs fo" |
886 | | - ] |
887 | | - }, |
888 | | - { |
889 | | - "name": "stdout", |
890 | | - "output_type": "stream", |
891 | | - "text": [ |
892 | | - "r your deployed app\n", |
893 | | - "\n", |
894 | 869 | "options:\n", |
895 | | - " -h, --help show this help message and exit\n", |
896 | | - " --path PATH " |
| 870 | + " -h, --h" |
897 | 871 | ] |
898 | 872 | }, |
899 | 873 | { |
900 | 874 | "name": "stdout", |
901 | 875 | "output_type": "stream", |
902 | 876 | "text": [ |
903 | | - " Path to project (default: .)\n", |
904 | | - " --name NAME Overrides the .plash file in project root i" |
| 877 | + "elp show this help message and exit\n", |
| 878 | + " --path PATH Path to project (default: .)\n", |
| 879 | + " --" |
905 | 880 | ] |
906 | 881 | }, |
907 | 882 | { |
908 | 883 | "name": "stdout", |
909 | 884 | "output_type": "stream", |
910 | 885 | "text": [ |
911 | | - "f provided\n", |
912 | | - " --mode {build,app} Choose between build or app logs (default: build)\n", |
913 | | - " --tail " |
| 886 | + "name NAME Overrides the .plash file in project root if provided\n", |
| 887 | + " --mode {build,app} Choose" |
914 | 888 | ] |
915 | 889 | }, |
916 | 890 | { |
917 | 891 | "name": "stdout", |
918 | 892 | "output_type": "stream", |
919 | 893 | "text": [ |
920 | | - " Tail the logs (default: False)\n" |
| 894 | + " between build or app logs (default: build)\n", |
| 895 | + " --tail Tail the logs (default: False)\n" |
921 | 896 | ] |
922 | 897 | } |
923 | 898 | ], |
|
985 | 960 | "source": [ |
986 | 961 | "#| export\n", |
987 | 962 | "def download(\n", |
988 | | - " path:Path=Path('.'), # Path to project\n", |
| 963 | + " path:Path='.', # Path to project\n", |
989 | 964 | " name:str=None, # Overrides the .plash file in project root if provided\n", |
990 | 965 | " save_path:Path=\"./download/\"): # Save path (optional)\n", |
991 | 966 | " \"Download deployed app to save_path.\"\n", |
|
1027 | 1002 | "text": [ |
1028 | 1003 | "usage: plash_download [-h] [--path PATH] [--name NAME] [--save_path SAVE_PATH]\n", |
1029 | 1004 | "\n", |
1030 | | - "Download your deploy" |
| 1005 | + "options:\n", |
| 1006 | + " -h, --hel" |
1031 | 1007 | ] |
1032 | 1008 | }, |
1033 | 1009 | { |
1034 | 1010 | "name": "stdout", |
1035 | 1011 | "output_type": "stream", |
1036 | 1012 | "text": [ |
1037 | | - "ed app\n", |
1038 | | - "\n", |
1039 | | - "options:\n", |
1040 | | - " -h, --help show this help message and exit\n", |
1041 | | - " --path PATH P" |
| 1013 | + "p show this help message and exit\n", |
| 1014 | + " --path PATH Path to project (default: .)\n" |
1042 | 1015 | ] |
1043 | 1016 | }, |
1044 | 1017 | { |
1045 | 1018 | "name": "stdout", |
1046 | 1019 | "output_type": "stream", |
1047 | 1020 | "text": [ |
1048 | | - "ath to project (default: .)\n", |
1049 | | - " --name NAME Overrides the .plash file in project root if pr" |
| 1021 | + " --name NAME Overrides the .plash file in project root if provided\n", |
| 1022 | + " --save_path SAVE_PA" |
1050 | 1023 | ] |
1051 | 1024 | }, |
1052 | 1025 | { |
1053 | 1026 | "name": "stdout", |
1054 | 1027 | "output_type": "stream", |
1055 | 1028 | "text": [ |
1056 | | - "ovided\n", |
1057 | | - " --save_path SAVE_PATH Save path (optional) (default: download)\n" |
| 1029 | + "TH Save path (optional) (default: ./download/)\n" |
1058 | 1030 | ] |
1059 | 1031 | } |
1060 | 1032 | ], |
|
1071 | 1043 | "outputs": [], |
1072 | 1044 | "source": [ |
1073 | 1045 | "#| export\n", |
1074 | | - "def apps():\n", |
| 1046 | + "def app_list():\n", |
1075 | 1047 | " \"List your deployed apps\"\n", |
1076 | 1048 | " r = _mk_auth_req(_endpoint(rt=\"/user_apps\"))\n", |
1077 | 1049 | " if not r: raise PlashError('Failed to retrieve')\n", |
1078 | 1050 | " return r.json()\n", |
1079 | 1051 | "\n", |
1080 | 1052 | "@call_parse\n", |
1081 | | - "def _apps(verbose:bool=False): # Whether to show running status as well as name: 1=running, 0=stopped\n", |
| 1053 | + "def _app_list(verbose:bool=False): # Whether to show running status as well as name: 1=running, 0=stopped\n", |
1082 | 1054 | " try: res = apps()\n", |
1083 | 1055 | " except PlashError as e: return str(e)\n", |
1084 | 1056 | " if not res: print(\"You don't have any deployed Plash apps.\")\n", |
1085 | 1057 | " for a in res: print(f\"{a['running']} {a['name']}\" if verbose else a['name'])\n", |
1086 | | - "_apps.__doc__ = apps.__doc__" |
| 1058 | + "_app_list.__doc__ = app_list.__doc__" |
1087 | 1059 | ] |
1088 | 1060 | }, |
1089 | 1061 | { |
|
1106 | 1078 | "text": [ |
1107 | 1079 | "usage: plash_apps [-h] [--verbose]\n", |
1108 | 1080 | "\n", |
1109 | | - "List your deployed apps (verbose shows status table: 1=running, " |
| 1081 | + "options:\n", |
| 1082 | + " -h, --help show this help message and exit\n", |
| 1083 | + " --verbo" |
1110 | 1084 | ] |
1111 | 1085 | }, |
1112 | 1086 | { |
1113 | 1087 | "name": "stdout", |
1114 | 1088 | "output_type": "stream", |
1115 | 1089 | "text": [ |
1116 | | - "0=stopped)\n", |
1117 | | - "\n", |
1118 | | - "options:\n", |
1119 | | - " -h, --help show this help message and exit\n", |
1120 | | - " --verbose (default: False)\n" |
| 1090 | + "se Whether to show running status as well as name: 1=running, 0=stopped (default: False)\n" |
1121 | 1091 | ] |
1122 | 1092 | } |
1123 | 1093 | ], |
|
1126 | 1096 | "plash_apps --help" |
1127 | 1097 | ] |
1128 | 1098 | }, |
| 1099 | + { |
| 1100 | + "cell_type": "code", |
| 1101 | + "execution_count": null, |
| 1102 | + "id": "6ff07c8d", |
| 1103 | + "metadata": {}, |
| 1104 | + "outputs": [], |
| 1105 | + "source": [ |
| 1106 | + "#| export\n", |
| 1107 | + "def plash_tool_info():\n", |
| 1108 | + " from dialoghelper import add_msg\n", |
| 1109 | + " add_msg('Plash tools: &`[login, deploy, delete, start, stop, logs, download, app_list]`')" |
| 1110 | + ] |
| 1111 | + }, |
1129 | 1112 | { |
1130 | 1113 | "cell_type": "markdown", |
1131 | 1114 | "id": "3748636e", |
|
0 commit comments