mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-11-23 05:31:30 +00:00
Add config to build impacted frontends
This commit is contained in:
parent
5d5970f797
commit
dc18624323
@ -50,6 +50,24 @@ presubmits:
|
|||||||
command:
|
command:
|
||||||
- hack/non_manual_build.sh
|
- hack/non_manual_build.sh
|
||||||
|
|
||||||
|
- name: pull-peridot-build-impacted-frontend
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
always_run: true
|
||||||
|
decorate: true
|
||||||
|
spec:
|
||||||
|
tolerations:
|
||||||
|
- key: peridot.rockylinux.org/workflow-tolerates-arch
|
||||||
|
operator: Equal
|
||||||
|
value: amd64
|
||||||
|
effect: NoSchedule
|
||||||
|
nodeSelector:
|
||||||
|
peridot.rockylinux.org/workflow-tolerates-arch: amd64
|
||||||
|
containers:
|
||||||
|
- image: quay.io/peridot/ci:v0.3.16
|
||||||
|
command:
|
||||||
|
- hack/frontend_build.sh
|
||||||
|
|
||||||
- name: pull-peridot-gofmt-check
|
- name: pull-peridot-gofmt-check
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
16
hack/build_impacted_frontend.sh
Executable file
16
hack/build_impacted_frontend.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
|
source hack/bazel_setup.sh
|
||||||
|
|
||||||
|
starting_query="attr(tags, 'resf_frontend_bundle',"
|
||||||
|
|
||||||
|
for t in `cat impacted_targets`; do
|
||||||
|
starting_query="$starting_query $t union"
|
||||||
|
done
|
||||||
|
|
||||||
|
starting_query=${starting_query%" union"}
|
||||||
|
starting_query="$starting_query)"
|
||||||
|
|
||||||
|
$BAZEL_B $($BAZEL_QR "$starting_query")
|
26
hack/frontend_build.sh
Normal file
26
hack/frontend_build.sh
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
|
source hack/bazel_setup.sh
|
||||||
|
|
||||||
|
bazel_bin="$(which bazel)"
|
||||||
|
workspace_dir="$(pwd)"
|
||||||
|
|
||||||
|
$BAZEL_B //:bazel-diff
|
||||||
|
|
||||||
|
# Generate starting hashes
|
||||||
|
git checkout "$PULL_BASE_SHA" --quiet
|
||||||
|
bazel-bin/bazel-diff generate-hashes -w "$workspace_dir" -b "$bazel_bin" starting_hashes_json
|
||||||
|
|
||||||
|
# Generate ending hashes
|
||||||
|
git checkout "$PULL_PULL_SHA" --quiet
|
||||||
|
bazel-bin/bazel-diff generate-hashes -w "$workspace_dir" -b "$bazel_bin" ending_hashes_json
|
||||||
|
|
||||||
|
# Get impacted targets
|
||||||
|
bazel-bin/bazel-diff get-impacted-targets -sh starting_hashes_json -fh ending_hashes_json impacted_targets
|
||||||
|
|
||||||
|
# Build impacted targets
|
||||||
|
hack/build_impacted_frontend.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user