Wait for docker pull in CI (#2023)
CI can fail if `docker pull ...` takes longer than expected. This PR adds a `--pull-only` option to `./start`, then waits for it to complete in CI.
This commit is contained in:
parent
509840c37b
commit
a43cab8375
|
@ -51,11 +51,14 @@ jobs:
|
|||
with:
|
||||
files: docs/**/*.{md,mdx,ipynb}
|
||||
separator: "\n"
|
||||
- name: Pull preview image
|
||||
if: steps.changed-docs-files.outputs.any_changed == 'true'
|
||||
run: ./start --pull-only
|
||||
- name: Start local Docker preview
|
||||
if: steps.changed-docs-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
./start --apis &
|
||||
sleep 20
|
||||
sleep 1
|
||||
- name: Check that pages render
|
||||
if: steps.changed-docs-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
|
|
4
start
4
start
|
@ -27,6 +27,10 @@ def skip_apis() -> tuple[str]:
|
|||
return ("-v", "/home/node/app/docs/api")
|
||||
|
||||
def main() -> None:
|
||||
if "--pull-only" in sys.argv:
|
||||
subprocess.run(["docker", "pull", IMAGE], check=True)
|
||||
sys.exit(0)
|
||||
|
||||
print(
|
||||
"Warning: this may be using an outdated version of the app. Run "
|
||||
+ f"`docker pull {IMAGE}` to check for updates.",
|
||||
|
|
Loading…
Reference in New Issue