snapctl 0.39.2__py3-none-any.whl → 0.39.3__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 +31 -0
- snapctl/commands/byosnap.py +29 -0
- snapctl/config/constants.py +1 -1
- {snapctl-0.39.2.dist-info → snapctl-0.39.3.dist-info}/METADATA +1 -1
- {snapctl-0.39.2.dist-info → snapctl-0.39.3.dist-info}/RECORD +8 -8
- {snapctl-0.39.2.dist-info → snapctl-0.39.3.dist-info}/LICENSE +0 -0
- {snapctl-0.39.2.dist-info → snapctl-0.39.3.dist-info}/WHEEL +0 -0
- {snapctl-0.39.2.dist-info → snapctl-0.39.3.dist-info}/entry_points.txt +0 -0
snapctl/commands/byogs.py
CHANGED
|
@@ -251,6 +251,35 @@ class ByoGs:
|
|
|
251
251
|
snapctl_error('BYOGS upload failure. Duplicate image error.',
|
|
252
252
|
SNAPCTL_BYOGS_PUBLISH_DUPLICATE_TAG_ERROR, progress)
|
|
253
253
|
|
|
254
|
+
def _clean_slate(self) -> None:
|
|
255
|
+
progress = Progress(
|
|
256
|
+
SpinnerColumn(),
|
|
257
|
+
TextColumn("[progress.description]{task.description}"),
|
|
258
|
+
transient=True,
|
|
259
|
+
)
|
|
260
|
+
progress.start()
|
|
261
|
+
progress.add_task(
|
|
262
|
+
description='Cleaning cache and initializing...', total=None)
|
|
263
|
+
try:
|
|
264
|
+
# Specific ECR repository URL to check against
|
|
265
|
+
ecr_repo_url = self.token_parts[0]
|
|
266
|
+
if platform == "win32":
|
|
267
|
+
# Perform the Docker logout
|
|
268
|
+
logout_response = subprocess.run(
|
|
269
|
+
['docker', 'logout', ecr_repo_url],
|
|
270
|
+
shell=True, check=False)
|
|
271
|
+
else:
|
|
272
|
+
# Perform the Docker logout
|
|
273
|
+
logout_response = subprocess.run([
|
|
274
|
+
f"docker logout {ecr_repo_url}"
|
|
275
|
+
], shell=True, check=False)
|
|
276
|
+
if not logout_response.returncode:
|
|
277
|
+
return snapctl_success('Cleanup complete', progress, no_exit=True)
|
|
278
|
+
except subprocess.CalledProcessError:
|
|
279
|
+
warning('Unable to initialize with a clean slate.')
|
|
280
|
+
finally:
|
|
281
|
+
progress.stop()
|
|
282
|
+
|
|
254
283
|
# Public methods
|
|
255
284
|
|
|
256
285
|
# Validator
|
|
@@ -322,6 +351,7 @@ class ByoGs:
|
|
|
322
351
|
"""
|
|
323
352
|
self._check_dependencies()
|
|
324
353
|
self._docker_tag()
|
|
354
|
+
self._clean_slate()
|
|
325
355
|
self._docker_login()
|
|
326
356
|
self._docker_push()
|
|
327
357
|
|
|
@@ -342,6 +372,7 @@ class ByoGs:
|
|
|
342
372
|
else:
|
|
343
373
|
info('--skip-build set. Skipping the build step.')
|
|
344
374
|
self._docker_tag()
|
|
375
|
+
self._clean_slate()
|
|
345
376
|
self._docker_login()
|
|
346
377
|
self._docker_push()
|
|
347
378
|
snapctl_success('BYOGS publish successful')
|
snapctl/commands/byosnap.py
CHANGED
|
@@ -354,6 +354,33 @@ class ByoSnap:
|
|
|
354
354
|
SNAPCTL_INPUT_ERROR
|
|
355
355
|
)
|
|
356
356
|
|
|
357
|
+
def _clean_slate(self) -> None:
|
|
358
|
+
progress = Progress(
|
|
359
|
+
SpinnerColumn(),
|
|
360
|
+
TextColumn("[progress.description]{task.description}"),
|
|
361
|
+
transient=True,
|
|
362
|
+
)
|
|
363
|
+
progress.start()
|
|
364
|
+
progress.add_task(
|
|
365
|
+
description='Cleaning cache and initializing...', total=None)
|
|
366
|
+
try:
|
|
367
|
+
# Specific ECR repository URL to check against
|
|
368
|
+
ecr_domain = self.token_parts[0].split('/')[0]
|
|
369
|
+
# Perform the Docker logout
|
|
370
|
+
if platform == "win32":
|
|
371
|
+
logout_response = subprocess.run(['docker', 'logout', ecr_domain],
|
|
372
|
+
shell=True, check=False)
|
|
373
|
+
else:
|
|
374
|
+
logout_response = subprocess.run([
|
|
375
|
+
f"docker logout {ecr_domain}"
|
|
376
|
+
], shell=True, check=False)
|
|
377
|
+
if not logout_response.returncode:
|
|
378
|
+
return snapctl_success('Cleanup complete.', progress, no_exit=True)
|
|
379
|
+
except subprocess.CalledProcessError:
|
|
380
|
+
warning('Unable to initialize with a clean slate.')
|
|
381
|
+
finally:
|
|
382
|
+
progress.stop()
|
|
383
|
+
|
|
357
384
|
# Public methods
|
|
358
385
|
|
|
359
386
|
# Validator
|
|
@@ -509,6 +536,7 @@ class ByoSnap:
|
|
|
509
536
|
"""
|
|
510
537
|
self._check_dependencies()
|
|
511
538
|
self._docker_tag()
|
|
539
|
+
self._clean_slate()
|
|
512
540
|
self._docker_login()
|
|
513
541
|
self._docker_push()
|
|
514
542
|
|
|
@@ -662,6 +690,7 @@ class ByoSnap:
|
|
|
662
690
|
else:
|
|
663
691
|
info('--skip-build set. Skipping the build step.')
|
|
664
692
|
self._docker_tag()
|
|
693
|
+
self._clean_slate()
|
|
665
694
|
self._docker_login()
|
|
666
695
|
self._docker_push()
|
|
667
696
|
if self.path is not None or self.resources_path is not None:
|
snapctl/config/constants.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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=
|
|
5
|
-
snapctl/commands/byosnap.py,sha256=
|
|
4
|
+
snapctl/commands/byogs.py,sha256=spEQvIIrKXhkUvR1OqKlr7r0MK3FEl7raw1qcKjbAjg,15196
|
|
5
|
+
snapctl/commands/byosnap.py,sha256=tCPRbF6EsHjB4Jv9f8dwCUIcd8vdwhYJv-3FmpJ1u1U,33061
|
|
6
6
|
snapctl/commands/game.py,sha256=icAPD8derxtgXHZQvziHd1O8fwD5Kw7HFMA8yXOUSRQ,4344
|
|
7
7
|
snapctl/commands/generate.py,sha256=7z4nyqDuAieFmIg-XVIri2xkXPpDJd0E3uKYIfQtBqE,7891
|
|
8
8
|
snapctl/commands/snapend.py,sha256=aYKeBZNwDMGWPsYl4qOCkVsrotkE2vzUobfg8AkRetw,30741
|
|
9
9
|
snapctl/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
snapctl/config/constants.py,sha256=
|
|
10
|
+
snapctl/config/constants.py,sha256=fX-SVFpra8uNay0Qj63t8PHEy6KtA5u6Y8SEDMMehTA,2735
|
|
11
11
|
snapctl/config/endpoints.py,sha256=VAeOmx3k3ukB-9XuGI65KtCJwFK-KFgzor-UWE8JU0g,297
|
|
12
12
|
snapctl/config/hashes.py,sha256=7jkMYfMAcgdque5PN10-B3QqwoXvtsuJKJr9dKZUvJ8,4139
|
|
13
13
|
snapctl/main.py,sha256=XEpJSIkp3_ymemykN0Xevyu2B8xSDZuLgZU4RmEjUEg,20094
|
|
@@ -16,8 +16,8 @@ snapctl/types/definitions.py,sha256=EQzLeiXkJ8ISRlCqHMviNVsWWpmhWjpKaOBLdlvOTmY,
|
|
|
16
16
|
snapctl/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
snapctl/utils/echo.py,sha256=V0qgjqqGXRiueMkq31enmNmdqciC8S90qGRcK8UupXA,1090
|
|
18
18
|
snapctl/utils/helper.py,sha256=XSn0x46mED86kQU1UlmuvJY9GsXO3Ncoba18Lb6FE8k,5522
|
|
19
|
-
snapctl-0.39.
|
|
20
|
-
snapctl-0.39.
|
|
21
|
-
snapctl-0.39.
|
|
22
|
-
snapctl-0.39.
|
|
23
|
-
snapctl-0.39.
|
|
19
|
+
snapctl-0.39.3.dist-info/LICENSE,sha256=6AcXm54KFSpmUI1ji9NIBd4Xl-DtjTqiyjBzfVb_CEk,2804
|
|
20
|
+
snapctl-0.39.3.dist-info/METADATA,sha256=YUr408Kn3_92rmL5JvX7WPQAp-u-OJT3b6h04nSAUoI,22833
|
|
21
|
+
snapctl-0.39.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
22
|
+
snapctl-0.39.3.dist-info/entry_points.txt,sha256=tkKW9MzmFdRs6Bgkv29G78i9WEBK4WIOWunPfe3t2Wg,44
|
|
23
|
+
snapctl-0.39.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|