chore(deploy): publish by default and pin production images
This commit is contained in:
@ -40,12 +40,14 @@ else:
|
||||
return result, calls
|
||||
|
||||
def test_publication_contract(self):
|
||||
for args, builds, pushes in [([], 4, 0), (['--push'], 4, 4),
|
||||
(['--dry-run', '--push'], 0, 0)]:
|
||||
for args, builds, pushes in [([], 4, 4), (['--push'], 4, 4),
|
||||
(['--dry-run'], 0, 0), (['--dry-run', '--push'], 0, 0)]:
|
||||
with self.subTest(args=args):
|
||||
result, calls = self.invoke(args)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
docker = [c for c in calls if c[0] == 'docker']
|
||||
if '--dry-run' in args:
|
||||
self.assertEqual(result.stdout.count('docker push '), 4)
|
||||
self.assertEqual([c[1] for c in docker], ['build'] * builds + ['push'] * pushes)
|
||||
for i, name in enumerate(['backend', 'frontend', 'scraper', 'laya']):
|
||||
self.assertIn(PREFIX + name + ':' + SHA, result.stdout)
|
||||
@ -61,7 +63,7 @@ else:
|
||||
|
||||
def test_failures_stop_publication(self):
|
||||
for failure, count in [('build', 1), ('push', 5)]:
|
||||
result, calls = self.invoke(['--push', '--tag', 'v2'], fail=failure)
|
||||
result, calls = self.invoke(['--tag', 'v2'], fail=failure)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
docker = [c for c in calls if c[0] == 'docker']
|
||||
self.assertEqual(len(docker), count)
|
||||
|
||||
Reference in New Issue
Block a user