snapctl 0.47.2__py3-none-any.whl → 0.48.0__py3-none-any.whl

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/commands/byogs.py CHANGED
@@ -49,6 +49,9 @@ class ByoGs:
49
49
  self.path: Union[str, None] = path
50
50
  self.resources_path: Union[str, None] = resources_path
51
51
  self.docker_filename: str = docker_filename
52
+ self.docker_path_filename: Union[str, None] = ByoGs._make_dockerfile_path(
53
+ path, resources_path, docker_filename
54
+ )
52
55
  self.skip_build: bool = skip_build
53
56
  self.snapend_id: Union[str, None] = snapend_id
54
57
  self.fleet_names: Union[str, None] = fleet_names
@@ -63,6 +66,22 @@ class ByoGs:
63
66
  self.validate_input()
64
67
 
65
68
  # Protected methods
69
+ @staticmethod
70
+ def _make_dockerfile_path(path: str, resources_path: str, docker_filename: str) -> Union[str, None]:
71
+ """
72
+ Check for the existence of a Dockerfile in the given `path` and `resources_path`.
73
+ Returns the path where the Dockerfile is found, or an empty string if not found.
74
+ """
75
+ # Check the primary path
76
+ if path and os.path.isfile(os.path.join(path, docker_filename)):
77
+ return os.path.join(path, docker_filename)
78
+
79
+ # Check the resources path
80
+ if resources_path and os.path.isfile(os.path.join(resources_path, docker_filename)):
81
+ return os.path.join(resources_path, docker_filename)
82
+
83
+ # Return empty string if not found in either location
84
+ return None
66
85
 
67
86
  @staticmethod
68
87
  def _get_token_values(token: str) -> Union[None, List]:
@@ -185,17 +204,11 @@ class ByoGs:
185
204
  build_platform = ByoGs.DEFAULT_BUILD_PLATFORM
186
205
  if len(self.token_parts) == 4:
187
206
  build_platform = self.token_parts[3]
188
- # Build your snap
189
- if self.resources_path:
190
- base_path = self.resources_path
191
- else:
192
- base_path = self.path
193
- docker_file_path = os.path.join(base_path, self.docker_filename)
194
207
 
195
208
  # Warning check for architecture specific commands
196
209
  info(f'Building on system architecture {sys_platform.machine()}')
197
210
  check_response = check_dockerfile_architecture(
198
- docker_file_path, sys_platform.machine())
211
+ self.docker_path_filename, sys_platform.machine())
199
212
  if check_response['error']:
200
213
  warning(check_response['message'])
201
214
  # Build the image
@@ -203,7 +216,7 @@ class ByoGs:
203
216
  response = subprocess.run([
204
217
  # f"docker build --no-cache -t {tag} {path}"
205
218
  'docker', 'build', '--platform', build_platform, '-t', self.tag,
206
- '-f', docker_file_path, self.path
219
+ '-f', self.docker_path_filename, self.path
207
220
  ], shell=True, check=False)
208
221
  # stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
209
222
  else:
@@ -211,7 +224,7 @@ class ByoGs:
211
224
  # f"docker build --no-cache -t {tag} {path}"
212
225
  "docker build --platform " +
213
226
  f"{build_platform} -t {self.tag} " +
214
- f"-f {docker_file_path} {self.path}"
227
+ f"-f {self.docker_path_filename} {self.path}"
215
228
  ], shell=True, check=False)
216
229
  # stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
217
230
  if not response.returncode:
@@ -366,37 +379,25 @@ class ByoGs:
366
379
  code=SNAPCTL_INPUT_ERROR
367
380
  )
368
381
  if self.subcommand in ['build', 'publish']:
382
+ # Check path
369
383
  if not self.skip_build and not self.path:
370
384
  snapctl_error(
371
385
  message="Missing required parameter: path",
372
386
  code=SNAPCTL_INPUT_ERROR)
373
- # Check path
374
- if self.resources_path:
375
- docker_file_path = f"{self.resources_path}/{self.docker_filename}"
376
- else:
377
- docker_file_path = f"{self.path}/{self.docker_filename}"
378
-
379
- if not self.skip_build and not os.path.isfile(docker_file_path):
387
+ # Check docker file path
388
+ if not self.skip_build and not self.docker_path_filename:
380
389
  snapctl_error(
381
- message="Unable to find " +
382
- f"{self.docker_filename} at path {docker_file_path}",
383
- code=SNAPCTL_INPUT_ERROR)
390
+ f"Unable to find {self.docker_path_filename}", SNAPCTL_INPUT_ERROR)
384
391
  elif self.subcommand == 'sync':
392
+ # Check path
385
393
  if not self.skip_build and not self.path:
386
394
  snapctl_error(
387
395
  message="Missing required parameter: path",
388
396
  code=SNAPCTL_INPUT_ERROR)
389
- # Check path
390
- if self.resources_path:
391
- docker_file_path = f"{self.resources_path}/{self.docker_filename}"
392
- else:
393
- docker_file_path = f"{self.path}/{self.docker_filename}"
394
-
395
- if not self.skip_build and not os.path.isfile(docker_file_path):
397
+ # Check docker file path
398
+ if not self.skip_build and not self.docker_path_filename:
396
399
  snapctl_error(
397
- message="Unable to find " +
398
- f"{self.docker_filename} at path {docker_file_path}",
399
- code=SNAPCTL_INPUT_ERROR)
400
+ f"Unable to find {self.docker_path_filename}", SNAPCTL_INPUT_ERROR)
400
401
  if not self.snapend_id:
401
402
  snapctl_error(
402
403
  message="Missing required parameter: snapend_id",
@@ -29,7 +29,7 @@ from snapctl.config.constants import HTTP_ERROR_SERVICE_VERSION_EXISTS, \
29
29
  SNAPCTL_BYOSNAP_UPDATE_VERSION_ERROR, SNAPCTL_BYOSNAP_UPDATE_VERSION_SERVICE_IN_USE_ERROR, \
30
30
  SNAPCTL_BYOSNAP_UPDATE_VERSION_TAG_ERROR, SNAPCTL_BYOSNAP_NOT_FOUND, \
31
31
  HTTP_ERROR_RESOURCE_NOT_FOUND, SNAPCTL_BYOSNAP_PUBLISH_ERROR, \
32
- SNAPCTL_BYOSNAP_GENERATE_PROFILE_ERROR, SNAPCTL_CONFIGURATION_INCORRECT
32
+ SNAPCTL_BYOSNAP_GENERATE_PROFILE_ERROR, SNAPCTL_CONFIGURATION_INCORRECT, SNAPCTL_BYOSNAP_SWAGGER_ERROR
33
33
  from snapctl.utils.echo import info, warning, success
34
34
  from snapctl.utils.helper import get_composite_token, snapctl_error, snapctl_success, \
35
35
  check_dockerfile_architecture, check_use_containerd_snapshotter
@@ -84,9 +84,14 @@ class ByoSnap:
84
84
  self.api_key: Union[str, None] = api_key
85
85
  self.byosnap_id: str = byosnap_id
86
86
  self.tag: Union[str, None] = tag
87
+ # Remote tag is overridden in publish and sync
88
+ self.remote_tag: Union[str, None] = tag
87
89
  self.path: Union[str, None] = path
88
90
  self.resources_path: Union[str, None] = resources_path
89
91
  self.docker_filename: str = docker_filename
92
+ self.docker_path_filename: Union[str, None] = ByoSnap._make_dockerfile_path(
93
+ path, resources_path, docker_filename
94
+ )
90
95
  self.profile_filename: Union[str, None] = profile_filename
91
96
  self.version: Union[str, None] = version
92
97
  self.name: Union[str, None] = name
@@ -110,9 +115,26 @@ class ByoSnap:
110
115
  self.readiness_path: Union[str, None] = None
111
116
  self.readiness_delay: Union[str, None] = None
112
117
  # Setup and Validate the input
113
- self.setup_and_validate_input()
118
+ self.validate_input()
114
119
 
115
120
  # Protected methods
121
+ @staticmethod
122
+ def _make_dockerfile_path(path: str, resources_path: str, docker_filename: str) -> Union[str, None]:
123
+ """
124
+ Check for the existence of a Dockerfile in the given `path` and `resources_path`.
125
+ Returns the path where the Dockerfile is found, or an empty string if not found.
126
+ """
127
+ # Check the primary path
128
+ if path and os.path.isfile(os.path.join(path, docker_filename)):
129
+ return os.path.join(path, docker_filename)
130
+
131
+ # Check the resources path
132
+ if resources_path and os.path.isfile(os.path.join(resources_path, docker_filename)):
133
+ return os.path.join(resources_path, docker_filename)
134
+
135
+ # Return empty string if not found in either location
136
+ return None
137
+
116
138
  @staticmethod
117
139
  def _get_token_values(token: str) -> Union[None, List]:
118
140
  """
@@ -692,33 +714,26 @@ class ByoSnap:
692
714
  progress.add_task(
693
715
  description='Building your snap...', total=None)
694
716
  try:
695
- # Build your snap
696
- if self.resources_path:
697
- base_path = self.resources_path
698
- else:
699
- base_path = self.path
700
- docker_file_path = os.path.join(base_path, self.docker_filename)
701
-
702
717
  # Warning check for architecture specific commands
703
718
  info(f'Building on system architecture {sys_platform.machine()}')
704
719
  check_response = check_dockerfile_architecture(
705
- docker_file_path, sys_platform.machine())
720
+ self.docker_path_filename, sys_platform.machine())
706
721
  if check_response['error']:
707
722
  warning(check_response['message'])
708
723
  # Build the image
709
724
  if platform == "win32":
710
725
  response = subprocess.run([
711
- # f"docker build --no-cache -t {tag} {path}"
712
- 'docker', 'build', '--platform', build_platform, '-t', self.tag,
713
- '-f', docker_file_path, self.path
726
+ # f"docker build --no-cache -t {remote_tag} {path}"
727
+ 'docker', 'build', '--platform', build_platform, '-t', self.remote_tag,
728
+ '-f', self.docker_path_filename, self.path
714
729
  ], shell=True, check=False)
715
730
  # stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
716
731
  else:
717
732
  response = subprocess.run([
718
- # f"docker build --no-cache -t {tag} {path}"
733
+ # f"docker build --no-cache -t {remote_tag} {path}"
719
734
  "docker build --platform " +
720
- f"{build_platform} -t {self.tag} " +
721
- f"-f {docker_file_path} {self.path}"
735
+ f"{build_platform} -t {self.remote_tag} " +
736
+ f"-f {self.docker_path_filename} {self.path}"
722
737
  ], shell=True, check=False)
723
738
  # stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
724
739
  if not response.returncode:
@@ -737,7 +752,7 @@ class ByoSnap:
737
752
  def _docker_tag(self) -> None:
738
753
  # Get the data
739
754
  ecr_repo_url = self.token_parts[0]
740
- image_tag = f'{self.byosnap_id}.{self.tag}'
755
+ image_tag = f'{self.byosnap_id}.{self.remote_tag}'
741
756
  full_ecr_repo_url = f'{ecr_repo_url}:{image_tag}'
742
757
  progress = Progress(
743
758
  SpinnerColumn(),
@@ -840,7 +855,7 @@ class ByoSnap:
840
855
  # Public methods
841
856
 
842
857
  # Validate
843
- def setup_and_validate_input(self) -> None:
858
+ def validate_input(self) -> None:
844
859
  """
845
860
  Validator
846
861
  """
@@ -895,20 +910,16 @@ class ByoSnap:
895
910
  f"{ByoSnap.TAG_CHARACTER_LIMIT} characters",
896
911
  SNAPCTL_INPUT_ERROR
897
912
  )
913
+ if ':' in self.tag:
914
+ snapctl_error("Tag should not contain `:` ",
915
+ SNAPCTL_INPUT_ERROR)
898
916
  if not self.skip_build and not self.path:
899
917
  snapctl_error("Missing required parameter: path",
900
918
  SNAPCTL_INPUT_ERROR)
901
- # Check path
902
- if self.resources_path:
903
- docker_file_path = \
904
- f"{self.resources_path}/{self.docker_filename}"
905
- else:
906
- docker_file_path = f"{self.path}/{self.docker_filename}"
907
- if not self.skip_build and not os.path.isfile(docker_file_path):
919
+ # Check docker file path
920
+ if not self.skip_build and not self.docker_path_filename:
908
921
  snapctl_error(
909
- "Unable to find " +
910
- f"{self.docker_filename} at path {docker_file_path}",
911
- SNAPCTL_INPUT_ERROR)
922
+ f"Unable to find {self.docker_path_filename}", SNAPCTL_INPUT_ERROR)
912
923
  elif self.subcommand == 'upload-docs':
913
924
  # Setup
914
925
  self._setup_token_and_token_parts(
@@ -1008,17 +1019,10 @@ class ByoSnap:
1008
1019
  snapctl_error(
1009
1020
  message="Missing required parameter: path",
1010
1021
  code=SNAPCTL_INPUT_ERROR)
1011
- # Check path
1012
- if self.resources_path:
1013
- docker_file_path = \
1014
- f"{self.resources_path}/{self.docker_filename}"
1015
- else:
1016
- docker_file_path = f"{self.path}/{self.docker_filename}"
1017
- if not self.skip_build and not os.path.isfile(docker_file_path):
1022
+ # Check docker file path
1023
+ if not self.skip_build and not self.docker_path_filename:
1018
1024
  snapctl_error(
1019
- message="Unable to find " +
1020
- f"{self.docker_filename} at path {docker_file_path}",
1021
- code=SNAPCTL_INPUT_ERROR)
1025
+ f"Unable to find {self.docker_path_filename}", SNAPCTL_INPUT_ERROR)
1022
1026
  if not self.snapend_id:
1023
1027
  snapctl_error(
1024
1028
  message="Missing required parameter: snapend-id",
@@ -1036,20 +1040,10 @@ class ByoSnap:
1036
1040
  code=SNAPCTL_INPUT_ERROR)
1037
1041
  if not self.skip_build and not self.path:
1038
1042
  snapctl_error(
1039
- message="Missing required parameter: path",
1040
- code=SNAPCTL_INPUT_ERROR)
1041
- # Check path
1042
- if self.resources_path:
1043
- docker_file_path = \
1044
- f"{self.resources_path}/{self.docker_filename}"
1045
- else:
1046
- docker_file_path = f"{self.path}/{self.docker_filename}"
1047
- if not self.skip_build and not os.path.isfile(docker_file_path):
1043
+ message="Missing required parameter: path", code=SNAPCTL_INPUT_ERROR)
1044
+ if not self.skip_build and not self.docker_path_filename:
1048
1045
  snapctl_error(
1049
- message="Unable to find " +
1050
- f"{self.docker_filename} at path {docker_file_path}",
1051
- code=SNAPCTL_INPUT_ERROR)
1052
-
1046
+ f"Unable to find {self.docker_path_filename}", SNAPCTL_INPUT_ERROR)
1053
1047
  # Run the overrides
1054
1048
  elif self.subcommand == 'generate-profile':
1055
1049
  # Setup
@@ -1129,11 +1123,11 @@ class ByoSnap:
1129
1123
 
1130
1124
  swagger_file = os.path.join(base_dir, 'swagger.json')
1131
1125
  readme_file = os.path.join(base_dir, 'README.md')
1132
-
1133
1126
  # Upload swagger.json
1134
1127
  if os.path.isfile(swagger_file):
1135
1128
  try:
1136
1129
  with open(swagger_file, "rb") as attachment_file:
1130
+ info(f'Uploading swagger.json at {swagger_file}')
1137
1131
  url = (
1138
1132
  f"{self.base_url}/v1/snapser-api/byosnaps/"
1139
1133
  f"{self.byosnap_id}/docs/{self.tag}/openapispec"
@@ -1147,7 +1141,18 @@ class ByoSnap:
1147
1141
  snapctl_success(
1148
1142
  message='Uploaded swagger.json', progress=None, no_exit=True)
1149
1143
  else:
1150
- info('Unable to upload your swagger.json')
1144
+ static_message = 'Snapser enforces a strict schema for the swagger.json ' + \
1145
+ 'file. It needs to be a valid OpenAPI 3.0 spec. In addition, ever API ' + \
1146
+ 'needs an operationId. a summary and a non-empty description. This allows ' + \
1147
+ 'Snapser to generate your SDK and power the API explorer. If you do not ' + \
1148
+ 'wish to leverage this feature, just remove the swagger.json file.'
1149
+ warning(static_message)
1150
+ response_json = test_res.json()
1151
+ if 'details' in response_json:
1152
+ error_msg = f"Swagger upload error: {response_json['details']}"
1153
+ else:
1154
+ error_msg = 'Swagger upload error: In-compatible swagger.json file.'
1155
+ warning(error_msg)
1151
1156
  except RequestException as e:
1152
1157
  info(
1153
1158
  'Exception: Unable to find swagger.json at ' +
@@ -1506,9 +1511,11 @@ class ByoSnap:
1506
1511
  msg=f'BYOSnap {self.name} present. ' +
1507
1512
  'Lets proceed',
1508
1513
  )
1509
- # Make the tag same as version
1510
- self.tag = self.version
1511
1514
  # Setup the token and token parts
1515
+ # Make the remote tag same as version if user is not passing the tag
1516
+ if self.tag is None:
1517
+ self.tag = self.version
1518
+ self.remote_tag = self.version
1512
1519
  self._setup_token_and_token_parts(
1513
1520
  self.base_url, self.api_key, self.byosnap_id)
1514
1521
  # Now publish the image
@@ -1527,7 +1534,11 @@ class ByoSnap:
1527
1534
  Sync the snap
1528
1535
  '''
1529
1536
  try:
1530
- self.tag = f'{self.version}-{int(time.time())}'
1537
+ # Make the remote tag same as version if user is not passing the tag
1538
+ if self.tag is None:
1539
+ time_string = str(int(time.time()))
1540
+ self.tag = f'{self.version}-{time_string}'
1541
+ self.remote_tag = f'{self.version}-{time_string}'
1531
1542
  self.publish_image(no_exit=True)
1532
1543
  self.update_version(no_exit=True)
1533
1544
  byosnap_list: str = f"{self.byosnap_id}:{self.version}"
@@ -3,7 +3,7 @@ Constants used by snapctl
3
3
  """
4
4
  COMPANY_NAME = 'Snapser'
5
5
  VERSION_PREFIX = 'beta-'
6
- VERSION = '0.47.2'
6
+ VERSION = '0.48.0'
7
7
  CONFIG_FILE_MAC = '~/.snapser/config'
8
8
  CONFIG_FILE_WIN = '%homepath%\\.snapser\\config'
9
9
 
@@ -73,6 +73,7 @@ SNAPCTL_BYOSNAP_UPDATE_VERSION_INVALID_VERSION_ERROR = 48
73
73
  SNAPCTL_BYOSNAP_PUBLISH_ERROR = 49
74
74
  # Starting with new error codes for BYOSNAP post
75
75
  SNAPCTL_BYOSNAP_GENERATE_PROFILE_ERROR = 86
76
+ SNAPCTL_BYOSNAP_SWAGGER_ERROR = 87
76
77
 
77
78
  # Game Errors - 50 - 60
78
79
  SNAPCTL_GAME_NOT_FOUND = SNAPCTL_RESOURCE_NOT_FOUND
@@ -0,0 +1,19 @@
1
+ ## beta-0.48.0
2
+ ##### April 11, 2025
3
+
4
+ ### Features
5
+ 1. Dockerfile can now be present either at the root or the resources path. Snapctl will automatically look for the Dockerfile in both locations.
6
+ 2. Snapctl now throws a better warning when the swagger for the BYOSnap is not compatible with what the Snapser backed expects. You will get a warning message:
7
+ ```bash
8
+ Warning Snapser enforces a strict schema for the swagger.json file. It needs to be a valid OpenAPI 3.0 spec. In addition, ever API needs an operationId. a summary and
9
+ a non-empty description. This allows Snapser to generate your SDK and power the API explorer. If you do not wish to leverage this feature, just remove the
10
+ swagger.json file.
11
+ ```
12
+ 3. You can now use the `--skip-build` flag with the snapctl sync command. This allows you to skip the build step when syncing your Snapend resources.
13
+ ```bash
14
+ byosnap sync --snapend-id $snapendId --byosnap-id $byosnapId --version $version --path $path --skip-build
15
+ ```
16
+
17
+ ### Fixes
18
+ 1. Snapctl was failing if the user passed in a tag with a `:` in it. This has been fixed. It now checks for the presence of a `:` in the tag and throws an error in the input validation step.
19
+ 2. The byosnap generate command was failing. This has been fixed.
snapctl/main.py CHANGED
@@ -386,15 +386,15 @@ def byosnap(
386
386
  help="(req: create) Language of your snap - " +
387
387
  ", ".join(ByoSnap.LANGUAGES) + "."
388
388
  ),
389
- # publish-image and publish-version
389
+ # publish-image, publish-version, publish, sync
390
390
  tag: str = typer.Option(
391
391
  None, "--tag", help=(
392
- "(req: publish-image, publish-version, upload-docs) Tag for your snap"
392
+ "(req: publish-image, publish-version, upload-docs) (optional: publish, sync) Tag for your snap"
393
393
  )
394
394
  ),
395
395
  # overrides
396
396
  skip_build: bool = typer.Option(
397
- False, "--skip-build", help="(optional: publish-image, sync) Skip the build step. You have to pass the image tag you used during the build step."
397
+ False, "--skip-build", help="(optional: publish-image, publish, sync) Skip the build step. You have to pass the image tag you used during the build step."
398
398
  ),
399
399
  docker_filename: str = typer.Option(
400
400
  "Dockerfile", help="(optional override: publish, sync) Dockerfile name to use"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: snapctl
3
- Version: 0.47.2
3
+ Version: 0.48.0
4
4
  Summary: Snapser CLI Tool
5
5
  Author: Ajinkya Apte
6
6
  Author-email: aj@snapser.com
@@ -24,58 +24,23 @@ Snapser has developed a CLI tool called **snapctl** that can be used on MaxOSX,
24
24
  Snapctl will be the best way for game studios to integrate Snapser into their build pipelines.
25
25
 
26
26
  ## What's new in the latest version?
27
- ### Breaking Changes
28
- - **BYOSnap**:
29
- - BYOSnap commands like `publish`, `sync` and `upload-docs` now take BYOSnap ID as a
30
- non-positional argument. You now have to pass the BYOSnap Id using `--byosnap-id`.
31
- ```bash
32
- # Previously
33
- snapctl byosnap publish byosnap-jinks-flask --version "v0.0.1" --path $path
34
-
35
- # New
36
- snapctl byosnap publish --byosnap-id byosnap-jinks-flask --version "v0.0.1" --path $path
37
- ```
38
- - BYOSnap input parameter `--byosnap-profile-file` has been renamed to `--profile-filename`
39
-
40
- - **Generate**: The ability to generate a base BYOSnap profile using the `generate` command has
41
- been deprecated. Instead its moved under `byosnap` commands for consistency.
42
-
43
- - **Snapend**:
44
- - The manifest path variable has been changed for Snapend commands like `apply` and `clone`
45
- from `--manifest-path` to `--manifest-path-filename`, for consistency with our new
46
- variable naming nomenclature.
47
- - The Snapend download command has new variable names like `format` and `type`. This is to add
48
- more consistency and clarity to the command.
49
- ```bash
50
- # Previously
51
- # snapctl snapend download --snapend-id gx5x6bc0 --category sdk --type unity --sdk-access-type external --sdk-auth-type user --out-path .
52
-
53
- # New
54
- snapctl snapend download --snapend-id gx5x6bc0 --category sdk --format unity --type user --out-path .
55
- ```
56
-
57
- - Input param `--docker` for BYOGS and BYOSnap commands has been changed to `--docker_filename`
58
-
59
- ### New Commands
60
- - **BYOSnap Generate Profile**: You can now use a new command to generate a base BYOSnap profile.
61
- ```bash
62
- snapctl byosnap generate-profile --out-path $outputPath --profile-filename $profileName
63
- ```
64
- - **BYOSnap Validate Profile**: After you hand edit the base BYOSnap profile, you can use this
65
- command to validate your BYOSnap profile before using it in other commands like `publish` and `sync`
66
- ```bash
67
- snapctl byosnap validate-profile --path $path --profile-filename $profileName
68
- # or
69
- snapctl byosnap validate-profile --resources-path $resources_path --profile-filename $profileName
70
- ```
71
- - **Release Notes**: You can now view release notes for a specific version of Snapctl using the
72
- `release-notes` command.
73
- ```bash
74
- snapctl release-notes releases
75
- snapctl release-notes show
76
- # or
77
- snapctl release-notes show --version $version
78
- ```
27
+ ### Features
28
+ 1. Dockerfile can now be present either at the root or the resources path. Snapctl will automatically look for the Dockerfile in both locations.
29
+ 2. Snapctl now throws a better warning when the swagger for the BYOSnap is not compatible with what the Snapser backed expects. You will get a warning message:
30
+ ```bash
31
+ Warning Snapser enforces a strict schema for the swagger.json file. It needs to be a valid OpenAPI 3.0 spec. In addition, ever API needs an operationId. a summary and
32
+ a non-empty description. This allows Snapser to generate your SDK and power the API explorer. If you do not wish to leverage this feature, just remove the
33
+ swagger.json file.
34
+ ```
35
+ 3. You can now use the `--skip-build` flag with the snapctl sync command. This allows you to skip the build step when syncing your Snapend resources.
36
+ ```bash
37
+ byosnap sync --snapend-id $snapendId --byosnap-id $byosnapId --version $version --path $path --skip-build
38
+ ```
39
+
40
+ ### Fixes
41
+ 1. Snapctl was failing if the user passed in a tag with a `:` in it. This has been fixed. It now checks for the presence of a `:` in the tag and throws an error in the input validation step.
42
+ 2. The byosnap generate command was failing. This has been fixed.
43
+
79
44
 
80
45
  ## Requirements
81
46
  ### Python 3.X and Pip
@@ -310,7 +275,7 @@ can deploy it.
310
275
  - This command needs a BYOSnap profile. BYOSnap profile, holds information about
311
276
  your BYOSnap like, name, description, etc and hardware requirements like CPU, Memory. We
312
277
  recommend you store this file at the root of your BYOSnap and also add it to version control.
313
- You can generate it using `snapctl generate profile --category byosnap --out-path $outputPath`.
278
+ You can generate it using `snapctl byosnap generate-profile --out-path $outputPath --profile-filename $profileName`.
314
279
 
315
280
  ```bash
316
281
  # Help for the byosnap command
@@ -462,7 +427,7 @@ Publish a new version for your Snap. Only after your Snap version is published,
462
427
  to use your snap in your Snapend. This command should be run after `push` or `publish-image` commands.
463
428
 
464
429
  IMPORTANT: You need to have $byosnapProfile to run this command. BYOSnap profile is a JSON configuration
465
- of your BYOSnap for the development, staging and production environments. You can generate a base version of this file using the `snapctl generate profile --category byosnap --out-path <output_path>` command.
430
+ of your BYOSnap for the development, staging and production environments. You can generate a base version of this file using the `snapctl byosnap generate-profile --out-path $outputPath --profile-filename $profileName` command.
466
431
 
467
432
  ```bash
468
433
  # Help for the byosnap command
@@ -472,7 +437,7 @@ snapctl byosnap publish-version --help
472
437
  # $byosnap_id = Snap ID for your snap
473
438
  # $image_tag = An image tag for your snap
474
439
  # $version = Semantic version for your snap Eg: v0.0.1
475
- # $byosnap_profile_path = Path to the snapser-byosnap-profile.json BYOSnap profile to configure dev, stage and prod settings for this snap. You can generate a base version of this file using the `snapctl generate profile --category byosnap --out-path <output_path>` command
440
+ # $byosnap_profile_path = Path to the snapser-byosnap-profile.json BYOSnap profile to configure dev, stage and prod settings for this snap. You can generate a base version of this file using the `snapctl byosnap generate-profile --out-path $outputPath --profile-filename $profileName` command
476
441
  # Example:
477
442
  # snapctl byosnap publish-version --byosnap-id byosnap-jinks-flask --tag my-first-image --version v0.0.1 --path /Users/DevName/Development/SnapserEngine/jinks_flask
478
443
  snapctl byosnap publish-version --byosnap-id $byosnap_id --tag $image_tag --version $version --path $byosnap_profile_path
@@ -1,14 +1,14 @@
1
1
  snapctl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  snapctl/__main__.py,sha256=43jKoTk8b85hk_MT6499N3ruHdEfM8WBImd_-3VzjI8,116
3
3
  snapctl/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- snapctl/commands/byogs.py,sha256=Cq0-dwMmDCe_oynAANRGlS9gVBzq2rRU4y04jKhz870,19321
5
- snapctl/commands/byosnap.py,sha256=Ktu6jYm6Ipn73R9hxwGxj9TqzdOLE_lpYUSyiRm7kF0,74977
4
+ snapctl/commands/byogs.py,sha256=WumLZRriCVF0SSnMn8TUL--iWhh3Yub3yQ-jz30faI0,19486
5
+ snapctl/commands/byosnap.py,sha256=xfUlIMUkiIRi6uYbtGvVR6vM_buO-6KH_i1ay3sELJY,76333
6
6
  snapctl/commands/game.py,sha256=nCXtEXAJkvOw26c_OBGr7Pz4hwu-5FXHyBR2kkXhLCM,5247
7
7
  snapctl/commands/generate.py,sha256=9-NlZVQllBT2LZT_t9S3ztwtHzTbM-C8_x0f6z70U3g,5606
8
8
  snapctl/commands/release_notes.py,sha256=K1OdX94pL-pKL2Depbs-AkVcPpKn_CX2cOsZiRZP5kc,2134
9
9
  snapctl/commands/snapend.py,sha256=ZQSI_QfxsmqCkz2kBkFSMN94ZkSgXlzwZBJXEs5nOoM,38483
10
10
  snapctl/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- snapctl/config/constants.py,sha256=MzgSQcrHozcUxRDveqJFB_pL7DlXLxSR6JbNRVVUiMU,3465
11
+ snapctl/config/constants.py,sha256=9qNitkpp08oNuEuPmHdQPpZ_P97R0CtIfiJVkNk2RQY,3500
12
12
  snapctl/config/endpoints.py,sha256=9kllA79xn9G_aBLp1rohURZi93pwYzTEWZ8ObtZ6crw,338
13
13
  snapctl/config/hashes.py,sha256=2Dyb3lbNRNKzc80XUH8S4yNJtRVGRCMK7-GwzyT4WQ0,5149
14
14
  snapctl/data/profiles/snapser-byosnap-profile.json,sha256=c7oIzMJewVQaoLaXCBPXlH-k5cL9DCz6q4IixsWWD9c,2404
@@ -19,14 +19,15 @@ snapctl/data/releases/beta-0.46.4.mdx,sha256=3-ojdCyvax27sdd8nKmcP0zfCWEzi_edPbS
19
19
  snapctl/data/releases/beta-0.47.0.mdx,sha256=p-bp0NUVcSKELHXtHJaq884_O4yTZDTCUbWtwLxRUS8,724
20
20
  snapctl/data/releases/beta-0.47.1.mdx,sha256=YqQ7ncHDW9pCbQNnQic1o_xQt3DinOFEo3YW0hJVUAk,645
21
21
  snapctl/data/releases/beta-0.47.2.mdx,sha256=9FQuJj6ntu0gG5Mf-d8lgCRqmzkuFyESqI_Gf5jLNmo,135
22
- snapctl/main.py,sha256=aBPwQOlrRS-hVofifRRidraxoLHdlbCcKksdqbQ_rcA,22638
22
+ snapctl/data/releases/beta-0.48.0.mdx,sha256=b9Dz-a2FAaZx2BnFTyle7PgJ2RuNv6Zj1KsT2TfaNH8,1244
23
+ snapctl/main.py,sha256=xjJSSdAGWiYYYC20OumSMxYQODTEAHbRRfyBstFiiAI,22685
23
24
  snapctl/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
25
  snapctl/types/definitions.py,sha256=EQzLeiXkJ8ISRlCqHMviNVsWWpmhWjpKaOBLdlvOTmY,644
25
26
  snapctl/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
27
  snapctl/utils/echo.py,sha256=V0qgjqqGXRiueMkq31enmNmdqciC8S90qGRcK8UupXA,1090
27
28
  snapctl/utils/helper.py,sha256=co6HhAE-Fo4TMxjSNZUfjK40vAwD3n8qU_JQcNjSlmU,6584
28
- snapctl-0.47.2.dist-info/LICENSE,sha256=6AcXm54KFSpmUI1ji9NIBd4Xl-DtjTqiyjBzfVb_CEk,2804
29
- snapctl-0.47.2.dist-info/METADATA,sha256=m8LzBjlZupu0hMe4wpknE1Xs-10sPMp5oi0Eu6KiPOs,34927
30
- snapctl-0.47.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
31
- snapctl-0.47.2.dist-info/entry_points.txt,sha256=tkKW9MzmFdRs6Bgkv29G78i9WEBK4WIOWunPfe3t2Wg,44
32
- snapctl-0.47.2.dist-info/RECORD,,
29
+ snapctl-0.48.0.dist-info/LICENSE,sha256=6AcXm54KFSpmUI1ji9NIBd4Xl-DtjTqiyjBzfVb_CEk,2804
30
+ snapctl-0.48.0.dist-info/METADATA,sha256=elOdGRY3YjNJkIcwTfFk0aG2suCGriS1S5vFUltcgwY,33843
31
+ snapctl-0.48.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
+ snapctl-0.48.0.dist-info/entry_points.txt,sha256=tkKW9MzmFdRs6Bgkv29G78i9WEBK4WIOWunPfe3t2Wg,44
33
+ snapctl-0.48.0.dist-info/RECORD,,