Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e0bd92f6d | ||
|
|
7e7b99b60f |
No files matched your search
@@ -14,7 +14,7 @@ steps:
|
|||||||
depends_on: image-build
|
depends_on: image-build
|
||||||
key: upload-ready-pipeline
|
key: upload-ready-pipeline
|
||||||
commands:
|
commands:
|
||||||
- buildkite-agent pipeline upload .buildkite/test-ready.yml
|
- python3 .buildkite/scripts/upload_pipeline.py --upload --all .buildkite/test-ready.yml
|
||||||
agents:
|
agents:
|
||||||
queue: "cpu_queue_premerge"
|
queue: "cpu_queue_premerge"
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ steps:
|
|||||||
depends_on: image-build
|
depends_on: image-build
|
||||||
key: upload-merge-pipeline
|
key: upload-merge-pipeline
|
||||||
commands:
|
commands:
|
||||||
- buildkite-agent pipeline upload .buildkite/test-merge.yml
|
- python3 .buildkite/scripts/upload_pipeline.py --upload --all .buildkite/test-merge.yml
|
||||||
agents:
|
agents:
|
||||||
queue: "cpu_queue_premerge"
|
queue: "cpu_queue_premerge"
|
||||||
|
|
||||||
@@ -33,6 +33,6 @@ steps:
|
|||||||
key: upload-nightly-pipeline
|
key: upload-nightly-pipeline
|
||||||
if: build.env("NIGHTLY") == "1"
|
if: build.env("NIGHTLY") == "1"
|
||||||
commands:
|
commands:
|
||||||
- buildkite-agent pipeline upload .buildkite/test-nightly.yml
|
- python3 .buildkite/scripts/upload_pipeline.py --upload --all .buildkite/test-nightly.yml
|
||||||
agents:
|
agents:
|
||||||
queue: "cpu_queue_premerge"
|
queue: "cpu_queue_premerge"
|
||||||
@@ -13,13 +13,16 @@ Test pipeline mode (e.g. test-merge.yml):
|
|||||||
recognize this uploader-only key).
|
recognize this uploader-only key).
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
python3 upload_pipeline.py [--upload] <pipeline.yml>
|
python3 upload_pipeline.py [--upload] [--all] <pipeline.yml>
|
||||||
|
|
||||||
# Bootstrap (replaces upload_pipeline_with_skip_ci.sh):
|
# Bootstrap (replaces upload_pipeline_with_skip_ci.sh):
|
||||||
python3 upload_pipeline.py --upload .buildkite/pipeline.yml
|
python3 upload_pipeline.py --upload .buildkite/pipeline.yml
|
||||||
|
|
||||||
# Test pipeline (replaces upload_test_pipeline_with_diff_skip.py):
|
# Test pipeline (replaces upload_test_pipeline_with_diff_skip.py):
|
||||||
python3 upload_pipeline.py --upload .buildkite/test-merge.yml
|
python3 upload_pipeline.py --upload .buildkite/test-merge.yml
|
||||||
|
|
||||||
|
# Full suite (rebase pipeline): keep all steps, still strip the uploader-only key:
|
||||||
|
python3 upload_pipeline.py --upload --all .buildkite/test-merge.yml
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
@@ -437,11 +440,17 @@ def resolve_pipeline_path(arg: str) -> Path:
|
|||||||
return ROOT / path
|
return ROOT / path
|
||||||
|
|
||||||
|
|
||||||
def render_pipeline(path: Path) -> str:
|
def render_pipeline(path: Path, *, force_all: bool = False) -> str:
|
||||||
text = path.read_text(encoding="utf-8")
|
text = path.read_text(encoding="utf-8")
|
||||||
diff_range = resolve_diff_range()
|
diff_range = resolve_diff_range()
|
||||||
changed_files = resolve_changed_files()
|
changed_files = resolve_changed_files()
|
||||||
|
|
||||||
|
# ``--all`` forces the keep-all-steps path (no diff-aware skipping) while still
|
||||||
|
# stripping ``source_file_dependencies``. Used by the rebase pipeline so main builds
|
||||||
|
# run the full e2e suite (see .buildkite/rebase-pipeline.yaml).
|
||||||
|
if force_all:
|
||||||
|
changed_files = None
|
||||||
|
|
||||||
if BOOTSTRAP_MARKER in text:
|
if BOOTSTRAP_MARKER in text:
|
||||||
rendered = render_bootstrap_pipeline(
|
rendered = render_bootstrap_pipeline(
|
||||||
text,
|
text,
|
||||||
@@ -480,6 +489,11 @@ def main() -> int:
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Pipe rendered YAML to buildkite-agent pipeline upload",
|
help="Pipe rendered YAML to buildkite-agent pipeline upload",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--all",
|
||||||
|
action="store_true",
|
||||||
|
help="Keep all steps (disable diff-aware skipping); still strips source_file_dependencies",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
path = resolve_pipeline_path(args.pipeline)
|
path = resolve_pipeline_path(args.pipeline)
|
||||||
@@ -487,7 +501,7 @@ def main() -> int:
|
|||||||
_log(f"missing pipeline file: {path}")
|
_log(f"missing pipeline file: {path}")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
rendered = render_pipeline(path)
|
rendered = render_pipeline(path, force_all=args.all)
|
||||||
if args.upload:
|
if args.upload:
|
||||||
upload_to_buildkite(rendered)
|
upload_to_buildkite(rendered)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in new issue
Block a user