personal-cloud-client 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- personal_cloud_client-0.0.1/.devcontainer/devcontainer.json +22 -0
- personal_cloud_client-0.0.1/PKG-INFO +6 -0
- personal_cloud_client-0.0.1/README.md +8 -0
- personal_cloud_client-0.0.1/personal_cloud_client/__init__.py +0 -0
- personal_cloud_client-0.0.1/personal_cloud_client/cli.py +34 -0
- personal_cloud_client-0.0.1/pyproject.toml +13 -0
- personal_cloud_client-0.0.1/setup.py +15 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
|
2
|
+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
|
3
|
+
{
|
|
4
|
+
"name": "Python 3",
|
|
5
|
+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
|
6
|
+
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye"
|
|
7
|
+
|
|
8
|
+
// Features to add to the dev container. More info: https://containers.dev/features.
|
|
9
|
+
// "features": {},
|
|
10
|
+
|
|
11
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
12
|
+
// "forwardPorts": [],
|
|
13
|
+
|
|
14
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
|
15
|
+
// "postCreateCommand": "pip3 install --user -r requirements.txt",
|
|
16
|
+
|
|
17
|
+
// Configure tool-specific properties.
|
|
18
|
+
// "customizations": {},
|
|
19
|
+
|
|
20
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
|
21
|
+
// "remoteUser": "root"
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# meuclient
|
|
2
|
+
|
|
3
|
+
Client para envio de imagens Docker para servidor de deploy caseiro.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Example
|
|
7
|
+
|
|
8
|
+
`cloud_client --host https://personal-cloud.softdevelopments.com.br --token 51593ad1b80663d245017a6fad0dea9431906092 deploy --name kanban_frontend --image kanban.tar.gz`
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import requests
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def deploy_app(args):
|
|
6
|
+
with open(args.image, "rb") as f:
|
|
7
|
+
headers = {"Access-Token": args.token}
|
|
8
|
+
|
|
9
|
+
response = requests.post(
|
|
10
|
+
f"{args.host}/app/deploy",
|
|
11
|
+
files={"image": f},
|
|
12
|
+
data={ "name": args.name },
|
|
13
|
+
headers=headers
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
print(f"[{response.status_code}] {response.text}")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def main():
|
|
20
|
+
parser = argparse.ArgumentParser(description="Personal Cloud Client")
|
|
21
|
+
parser.add_argument("--host", default="http://localhost:3000", help="Server URL")
|
|
22
|
+
parser.add_argument("--token", required=True, help="Auth token")
|
|
23
|
+
|
|
24
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
25
|
+
|
|
26
|
+
# Command: deploy
|
|
27
|
+
deploy_parser = subparsers.add_parser("deploy", help="Deploy the application's docker image")
|
|
28
|
+
deploy_parser.add_argument("--name", required=True, help="App name")
|
|
29
|
+
deploy_parser.add_argument("--image", required=True, help="App image path")
|
|
30
|
+
deploy_parser.set_defaults(func=deploy_app)
|
|
31
|
+
|
|
32
|
+
# Execute command
|
|
33
|
+
args = parser.parse_args()
|
|
34
|
+
args.func(args)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling >= 1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "personal_cloud_client"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Lee Jun", email="leejun.nakao@gmail.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "The client to handle the cloud server"
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="personal_cloud_client",
|
|
5
|
+
version="0.1",
|
|
6
|
+
packages=find_packages(),
|
|
7
|
+
install_requires=[
|
|
8
|
+
"requests",
|
|
9
|
+
],
|
|
10
|
+
entry_points={
|
|
11
|
+
"console_scripts": [
|
|
12
|
+
"cloud_client=personal_cloud_client.cli:main"
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
)
|