summaryrefslogtreecommitdiff
path: root/run-ci
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-02-08 23:28:37 +0300
committerEd Tanous <ed@tanous.net>2022-02-15 02:23:11 +0300
commit01caf624211197a993dbbd186149293f7053f9d8 (patch)
tree46262531eac12fd1836924e1647039868c199e73 /run-ci
parent0a4304cf40247771c63dc6be9b36d120a29fcb6d (diff)
downloadbmcweb-01caf624211197a993dbbd186149293f7053f9d8.tar.xz
Regenerate generated code as part of the build
There are a number of cases where people don't realize that the schemas are owned by Redfish, and that some of the generated files (registries, indexes) are in fact generated, and shouldn't be modified by hand. This commit forces a regeneration of all those files within Jenkins, each time we do a local build, then does a git diff to compare if the upstream schema files and generated files are different than what is checked in, it will print the diff immediately in the Jenkins build. This should hopefully give much faster feedback to users that their change needs to modify the right files. As part of this commit, we also need to take the version string out of clang-format. CI/the system should own the clang-format version. Related commit: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-build-scripts/+/51041] Tested: Ran script, build passed. Removed the schema fixes from patch series, saw build failed. Did the same with running the openbmc-build-scripts unit test script. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I17eb0e106be267e8dbba7053b0b07ec617893c86
Diffstat (limited to 'run-ci')
-rwxr-xr-xrun-ci9
1 files changed, 9 insertions, 0 deletions
diff --git a/run-ci b/run-ci
new file mode 100755
index 0000000000..85779d50c7
--- /dev/null
+++ b/run-ci
@@ -0,0 +1,9 @@
+#!/bin/bash
+# generate the generatable files in CI to make sure they haven't changed
+set -e
+
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+
+"$SCRIPT_DIR/scripts/parse_registries.py"
+"$SCRIPT_DIR/scripts/update_schemas.py"
+git --no-pager -C "$SCRIPT_DIR" diff --exit-code