snapctl 0.39.1__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 +33 -3
- snapctl/commands/byosnap.py +31 -3
- snapctl/config/constants.py +1 -1
- {snapctl-0.39.1.dist-info → snapctl-0.39.3.dist-info}/METADATA +1 -1
- {snapctl-0.39.1.dist-info → snapctl-0.39.3.dist-info}/RECORD +8 -8
- {snapctl-0.39.1.dist-info → snapctl-0.39.3.dist-info}/LICENSE +0 -0
- {snapctl-0.39.1.dist-info → snapctl-0.39.3.dist-info}/WHEEL +0 -0
- {snapctl-0.39.1.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
|
|
@@ -310,7 +339,6 @@ class ByoGs:
|
|
|
310
339
|
3. Build your snap
|
|
311
340
|
"""
|
|
312
341
|
self._check_dependencies()
|
|
313
|
-
self._docker_login()
|
|
314
342
|
self._docker_build()
|
|
315
343
|
|
|
316
344
|
def push(self) -> None:
|
|
@@ -322,8 +350,9 @@ class ByoGs:
|
|
|
322
350
|
4. Push your snap
|
|
323
351
|
"""
|
|
324
352
|
self._check_dependencies()
|
|
325
|
-
self._docker_login()
|
|
326
353
|
self._docker_tag()
|
|
354
|
+
self._clean_slate()
|
|
355
|
+
self._docker_login()
|
|
327
356
|
self._docker_push()
|
|
328
357
|
|
|
329
358
|
# Upper echelon commands
|
|
@@ -338,11 +367,12 @@ class ByoGs:
|
|
|
338
367
|
6. Upload swagger.json
|
|
339
368
|
"""
|
|
340
369
|
self._check_dependencies()
|
|
341
|
-
self._docker_login()
|
|
342
370
|
if not self.skip_build:
|
|
343
371
|
self._docker_build()
|
|
344
372
|
else:
|
|
345
373
|
info('--skip-build set. Skipping the build step.')
|
|
346
374
|
self._docker_tag()
|
|
375
|
+
self._clean_slate()
|
|
376
|
+
self._docker_login()
|
|
347
377
|
self._docker_push()
|
|
348
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
|
|
@@ -497,7 +524,6 @@ class ByoSnap:
|
|
|
497
524
|
3. Build your snap
|
|
498
525
|
"""
|
|
499
526
|
self._check_dependencies()
|
|
500
|
-
self._docker_login()
|
|
501
527
|
self._docker_build()
|
|
502
528
|
|
|
503
529
|
def push(self) -> bool:
|
|
@@ -509,8 +535,9 @@ class ByoSnap:
|
|
|
509
535
|
4. Push your snap
|
|
510
536
|
"""
|
|
511
537
|
self._check_dependencies()
|
|
512
|
-
self._docker_login()
|
|
513
538
|
self._docker_tag()
|
|
539
|
+
self._clean_slate()
|
|
540
|
+
self._docker_login()
|
|
514
541
|
self._docker_push()
|
|
515
542
|
|
|
516
543
|
# Upper echelon commands
|
|
@@ -658,12 +685,13 @@ class ByoSnap:
|
|
|
658
685
|
6. Upload swagger.json
|
|
659
686
|
"""
|
|
660
687
|
self._check_dependencies()
|
|
661
|
-
self._docker_login()
|
|
662
688
|
if not self.skip_build:
|
|
663
689
|
self._docker_build()
|
|
664
690
|
else:
|
|
665
691
|
info('--skip-build set. Skipping the build step.')
|
|
666
692
|
self._docker_tag()
|
|
693
|
+
self._clean_slate()
|
|
694
|
+
self._docker_login()
|
|
667
695
|
self._docker_push()
|
|
668
696
|
if self.path is not None or self.resources_path is not None:
|
|
669
697
|
self.upload_docs()
|
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
|