snapctl 0.41.2__tar.gz → 0.42.0__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.
Potentially problematic release.
This version of snapctl might be problematic. Click here for more details.
- {snapctl-0.41.2 → snapctl-0.42.0}/PKG-INFO +18 -9
- {snapctl-0.41.2 → snapctl-0.42.0}/README.md +17 -8
- {snapctl-0.41.2 → snapctl-0.42.0}/pyproject.toml +1 -1
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/commands/byogs.py +10 -6
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/config/constants.py +1 -1
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/config/endpoints.py +5 -3
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/main.py +5 -5
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/utils/helper.py +1 -1
- {snapctl-0.41.2 → snapctl-0.42.0}/LICENSE +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/__init__.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/__main__.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/commands/__init__.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/commands/byosnap.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/commands/game.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/commands/generate.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/commands/snapend.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/config/__init__.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/config/hashes.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/types/__init__.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/types/definitions.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/utils/__init__.py +0 -0
- {snapctl-0.41.2 → snapctl-0.42.0}/snapctl/utils/echo.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: snapctl
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.42.0
|
|
4
4
|
Summary: Snapser CLI Tool
|
|
5
5
|
Author: Ajinkya Apte
|
|
6
6
|
Author-email: aj@snapser.com
|
|
@@ -22,11 +22,19 @@ Description-Content-Type: text/markdown
|
|
|
22
22
|
Snapser has developed a CLI tool called **snapctl** that can be used on MaxOSX, Linux and Windows machines.
|
|
23
23
|
Snapctl will be the best way for game studios to integrate Snapser into their build pipelines.
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
### Python 3.X and Pip
|
|
27
26
|
The Snapser CLI tool depends on Python 3.X and Pip. MacOS comes pre installed with Python. But
|
|
28
27
|
please make sure you are running Python 3.X. On Windows, you can download Python 3.X from the
|
|
29
|
-
Windows store.
|
|
28
|
+
Windows store.
|
|
29
|
+
|
|
30
|
+
### Docker
|
|
31
|
+
Some of the commands also need docker. You can download the latest version of Docker from the
|
|
32
|
+
[Docker website](https://www.docker.com/products/docker-desktop).
|
|
33
|
+
|
|
34
|
+
**IMPORTANT**: Open up Docker desktop and settings. Make sure this setting is disabled
|
|
35
|
+
**Use containerd for pulling and storing images**. This is because Snapser uses Docker
|
|
36
|
+
to build and push images to the Snapser registry. Having this setting enabled will
|
|
37
|
+
cause issues with the Snapser CLI tool.
|
|
30
38
|
|
|
31
39
|
## Installation
|
|
32
40
|
|
|
@@ -132,10 +140,11 @@ SNAPSER_API_KEY=$your_api_key" | Out-File -encoding utf8 ~\.snapser\config
|
|
|
132
140
|
## Verify Snapctl installation
|
|
133
141
|
|
|
134
142
|
```
|
|
135
|
-
snapctl
|
|
143
|
+
snapctl validate
|
|
136
144
|
```
|
|
137
145
|
|
|
138
|
-
|
|
146
|
+
Output will tell you if the Snapctl was able successfully validate your setup with the remote Snapser server
|
|
147
|
+
or not.
|
|
139
148
|
|
|
140
149
|
## Advanced Setup
|
|
141
150
|
|
|
@@ -419,10 +428,10 @@ snapctl byogs sync --help
|
|
|
419
428
|
# $skip-build = true/false. Default is false. Pass this flag as true to skip the build and head straight to tag and push. Build step needs to run and tagged using the --tag you pass to the publish-image command for this to work.
|
|
420
429
|
# $image_tag = An image tag for your snap. Note snapctl adds a timestamp, allowing you to use the same command.
|
|
421
430
|
# $snapend_id = Snapend Id
|
|
422
|
-
# $
|
|
431
|
+
# $fleet_names = Comma separated fleet names
|
|
423
432
|
# Example:
|
|
424
|
-
snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-
|
|
425
|
-
snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-
|
|
433
|
+
snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-names "my-fleet,my-second-fleet"
|
|
434
|
+
snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-names $fleet_names
|
|
426
435
|
```
|
|
427
436
|
|
|
428
437
|
### Game
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
Snapser has developed a CLI tool called **snapctl** that can be used on MaxOSX, Linux and Windows machines.
|
|
4
4
|
Snapctl will be the best way for game studios to integrate Snapser into their build pipelines.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
### Python 3.X and Pip
|
|
8
7
|
The Snapser CLI tool depends on Python 3.X and Pip. MacOS comes pre installed with Python. But
|
|
9
8
|
please make sure you are running Python 3.X. On Windows, you can download Python 3.X from the
|
|
10
|
-
Windows store.
|
|
9
|
+
Windows store.
|
|
10
|
+
|
|
11
|
+
### Docker
|
|
12
|
+
Some of the commands also need docker. You can download the latest version of Docker from the
|
|
13
|
+
[Docker website](https://www.docker.com/products/docker-desktop).
|
|
14
|
+
|
|
15
|
+
**IMPORTANT**: Open up Docker desktop and settings. Make sure this setting is disabled
|
|
16
|
+
**Use containerd for pulling and storing images**. This is because Snapser uses Docker
|
|
17
|
+
to build and push images to the Snapser registry. Having this setting enabled will
|
|
18
|
+
cause issues with the Snapser CLI tool.
|
|
11
19
|
|
|
12
20
|
## Installation
|
|
13
21
|
|
|
@@ -113,10 +121,11 @@ SNAPSER_API_KEY=$your_api_key" | Out-File -encoding utf8 ~\.snapser\config
|
|
|
113
121
|
## Verify Snapctl installation
|
|
114
122
|
|
|
115
123
|
```
|
|
116
|
-
snapctl
|
|
124
|
+
snapctl validate
|
|
117
125
|
```
|
|
118
126
|
|
|
119
|
-
|
|
127
|
+
Output will tell you if the Snapctl was able successfully validate your setup with the remote Snapser server
|
|
128
|
+
or not.
|
|
120
129
|
|
|
121
130
|
## Advanced Setup
|
|
122
131
|
|
|
@@ -400,10 +409,10 @@ snapctl byogs sync --help
|
|
|
400
409
|
# $skip-build = true/false. Default is false. Pass this flag as true to skip the build and head straight to tag and push. Build step needs to run and tagged using the --tag you pass to the publish-image command for this to work.
|
|
401
410
|
# $image_tag = An image tag for your snap. Note snapctl adds a timestamp, allowing you to use the same command.
|
|
402
411
|
# $snapend_id = Snapend Id
|
|
403
|
-
# $
|
|
412
|
+
# $fleet_names = Comma separated fleet names
|
|
404
413
|
# Example:
|
|
405
|
-
snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-
|
|
406
|
-
snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-
|
|
414
|
+
snapctl byogs sync --path /Users/DevName/Development/SnapserEngine/game_server --tag my-first-image --snapend-id "jxmmfryo" --fleet-names "my-fleet,my-second-fleet"
|
|
415
|
+
snapctl byosnap sync --path $code_root_path --tag $image_tag --snapend-id $snapend_id --fleet-names $fleet_names
|
|
407
416
|
```
|
|
408
417
|
|
|
409
418
|
### Game
|
|
@@ -38,7 +38,7 @@ class ByoGs:
|
|
|
38
38
|
tag: Union[str, None] = None, path: Union[str, None] = None,
|
|
39
39
|
resources_path: Union[str, None] = None, dockerfile: Union[str, None] = None,
|
|
40
40
|
skip_build: bool = False, snapend_id: Union[str, None] = None,
|
|
41
|
-
|
|
41
|
+
fleet_names: Union[str, None] = None, blocking: bool = False
|
|
42
42
|
) -> None:
|
|
43
43
|
self.subcommand: str = subcommand
|
|
44
44
|
self.base_url: str = base_url
|
|
@@ -58,7 +58,7 @@ class ByoGs:
|
|
|
58
58
|
self.dockerfile: str = dockerfile
|
|
59
59
|
self.skip_build: bool = skip_build
|
|
60
60
|
self.snapend_id: Union[str, None] = snapend_id
|
|
61
|
-
self.
|
|
61
|
+
self.fleet_names: Union[str, None] = fleet_names
|
|
62
62
|
self.blocking: bool = blocking
|
|
63
63
|
# Validate input
|
|
64
64
|
self.validate_input()
|
|
@@ -383,9 +383,9 @@ class ByoGs:
|
|
|
383
383
|
snapctl_error(
|
|
384
384
|
message="Missing required parameter: snapend_id",
|
|
385
385
|
code=SNAPCTL_INPUT_ERROR)
|
|
386
|
-
if not self.
|
|
386
|
+
if not self.fleet_names:
|
|
387
387
|
snapctl_error(
|
|
388
|
-
message="Missing required parameter:
|
|
388
|
+
message="Missing required parameter: fleet_names",
|
|
389
389
|
code=SNAPCTL_INPUT_ERROR)
|
|
390
390
|
|
|
391
391
|
# CRUD methods
|
|
@@ -448,10 +448,14 @@ class ByoGs:
|
|
|
448
448
|
"""
|
|
449
449
|
self.tag = f'{self.tag}-{int(time.time())}'
|
|
450
450
|
self.publish(no_exit=True)
|
|
451
|
-
|
|
451
|
+
fleet_list: List[str] = self.fleet_names.split(',')
|
|
452
|
+
byogs_list: List[str] = []
|
|
453
|
+
for fleet in fleet_list:
|
|
454
|
+
byogs_list.append(f"{fleet.strip()}:{self.tag}")
|
|
452
455
|
snapend = Snapend(
|
|
453
456
|
subcommand='update', base_url=self.base_url, api_key=self.api_key,
|
|
454
|
-
snapend_id=self.snapend_id, byogs=
|
|
457
|
+
snapend_id=self.snapend_id, byogs=", ".join(map(str, byogs_list)),
|
|
458
|
+
blocking=self.blocking
|
|
455
459
|
)
|
|
456
460
|
snapend.update(no_exit=True)
|
|
457
461
|
return snapctl_success(message='BYOGs sync successful')
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'''
|
|
2
2
|
This file contains the endpoints for the Snapser API.
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
'''
|
|
4
|
+
from typing import Dict
|
|
5
|
+
|
|
6
|
+
END_POINTS: Dict[str, str] = {
|
|
5
7
|
'DEV': 'https://gateway.dev.snapser.io/snapser',
|
|
6
8
|
'DEV_TWO': 'https://gateway.dev.snapser.io/devtwo',
|
|
7
9
|
'PLAYTEST': 'https://gateway.dev.snapser.io/playtest',
|
|
@@ -266,11 +266,11 @@ def byogs(
|
|
|
266
266
|
),
|
|
267
267
|
snapend_id: str = typer.Option(
|
|
268
268
|
None, "--snapend-id",
|
|
269
|
-
help=("(req: sync) Snapend Id.
|
|
269
|
+
help=("(req: sync) Snapend Id.")
|
|
270
270
|
),
|
|
271
|
-
|
|
272
|
-
None, "--fleet-
|
|
273
|
-
help=("(req: sync)
|
|
271
|
+
fleet_names: str = typer.Option(
|
|
272
|
+
None, "--fleet-names",
|
|
273
|
+
help=("(req: sync) Comma separated fleet names.")
|
|
274
274
|
),
|
|
275
275
|
blocking: bool = typer.Option(
|
|
276
276
|
False, "--blocking",
|
|
@@ -301,7 +301,7 @@ def byogs(
|
|
|
301
301
|
dockerfile=docker_file,
|
|
302
302
|
skip_build=skip_build,
|
|
303
303
|
snapend_id=snapend_id,
|
|
304
|
-
|
|
304
|
+
fleet_names=fleet_names,
|
|
305
305
|
blocking=blocking
|
|
306
306
|
)
|
|
307
307
|
getattr(byogs_obj, subcommand.replace('-', '_'))()
|
|
@@ -20,7 +20,7 @@ def validate_api_key(base_url: str, api_key: Union[str, None]) -> bool:
|
|
|
20
20
|
try:
|
|
21
21
|
url = f"{base_url}/v1/snapser-api/validate"
|
|
22
22
|
res = requests.get(
|
|
23
|
-
url,
|
|
23
|
+
url, json={'api_key': api_key},
|
|
24
24
|
timeout=SERVER_CALL_TIMEOUT
|
|
25
25
|
)
|
|
26
26
|
if res.ok:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|