kopia lustrzana https://github.com/simonw/datasette
Use service-specific image ID for Cloud Run deploys, refs #2036
rodzic
1ad92a1d87
commit
bd39cb4805
|
@ -173,7 +173,7 @@ def publish_subcommand(publish):
|
||||||
print(fp.read())
|
print(fp.read())
|
||||||
print("\n====================\n")
|
print("\n====================\n")
|
||||||
|
|
||||||
image_id = f"gcr.io/{project}/{name}"
|
image_id = f"gcr.io/{project}/datasette-{service}"
|
||||||
check_call(
|
check_call(
|
||||||
"gcloud builds submit --tag {}{}".format(
|
"gcloud builds submit --tag {}{}".format(
|
||||||
image_id, " --timeout {}".format(timeout) if timeout else ""
|
image_id, " --timeout {}".format(timeout) if timeout else ""
|
||||||
|
|
|
@ -57,7 +57,7 @@ def test_publish_cloudrun_prompts_for_service(
|
||||||
"Service name: input-service"
|
"Service name: input-service"
|
||||||
) == result.output.strip()
|
) == result.output.strip()
|
||||||
assert 0 == result.exit_code
|
assert 0 == result.exit_code
|
||||||
tag = "gcr.io/myproject/datasette"
|
tag = "gcr.io/myproject/datasette-input-service"
|
||||||
mock_call.assert_has_calls(
|
mock_call.assert_has_calls(
|
||||||
[
|
[
|
||||||
mock.call(f"gcloud builds submit --tag {tag}", shell=True),
|
mock.call(f"gcloud builds submit --tag {tag}", shell=True),
|
||||||
|
@ -86,7 +86,7 @@ def test_publish_cloudrun(mock_call, mock_output, mock_which, tmp_path_factory):
|
||||||
cli.cli, ["publish", "cloudrun", "test.db", "--service", "test"]
|
cli.cli, ["publish", "cloudrun", "test.db", "--service", "test"]
|
||||||
)
|
)
|
||||||
assert 0 == result.exit_code
|
assert 0 == result.exit_code
|
||||||
tag = f"gcr.io/{mock_output.return_value}/datasette"
|
tag = f"gcr.io/{mock_output.return_value}/datasette-test"
|
||||||
mock_call.assert_has_calls(
|
mock_call.assert_has_calls(
|
||||||
[
|
[
|
||||||
mock.call(f"gcloud builds submit --tag {tag}", shell=True),
|
mock.call(f"gcloud builds submit --tag {tag}", shell=True),
|
||||||
|
@ -167,7 +167,7 @@ def test_publish_cloudrun_memory_cpu(
|
||||||
assert 2 == result.exit_code
|
assert 2 == result.exit_code
|
||||||
return
|
return
|
||||||
assert 0 == result.exit_code
|
assert 0 == result.exit_code
|
||||||
tag = f"gcr.io/{mock_output.return_value}/datasette"
|
tag = f"gcr.io/{mock_output.return_value}/datasette-test"
|
||||||
expected_call = (
|
expected_call = (
|
||||||
"gcloud run deploy --allow-unauthenticated --platform=managed"
|
"gcloud run deploy --allow-unauthenticated --platform=managed"
|
||||||
" --image {} test".format(tag)
|
" --image {} test".format(tag)
|
||||||
|
|
Ładowanie…
Reference in New Issue