Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck committed Feb 24, 2024
1 parent a467193 commit c7cfbe7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tools/src/test/proto/test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -ue

THIS_DIR="$(realpath "$(dirname "$0")")"
REPO_ROOT="$(realpath "${THIS_DIR}/../../../..")"
THIS_PATH="$(realpath "$(dirname "$0")")"
ROOT_PATH="$(realpath "${THIS_PATH}/../../../..")"

# paths relative to $REPO_ROOT
# paths relative to $ROOT_PATH
SCHEMA_DIR='schema'

REMOTE="https://github.com/${GITHUB_REPOSITORY:-CycloneDX/specification}.git"
Expand All @@ -20,8 +20,8 @@ function schema-lint () {
fi

docker run --rm \
--volume "${REPO_ROOT}/${SCHEMA_DIR}:/workspace/${SCHEMA_DIR}:ro" \
--volume "${THIS_DIR}/buf_lint.yaml:/workspace/buf.yaml:ro" \
--volume "${ROOT_PATH}/${SCHEMA_DIR}:/workspace/${SCHEMA_DIR}:ro" \
--volume "${THIS_PATH}/buf_lint.yaml:/workspace/buf.yaml:ro" \
--workdir '/workspace' \
bufbuild/buf:1.29.0 \
lint --path "$SCHEMA_DIR" \
Expand All @@ -44,9 +44,9 @@ function schema-breaking-version () {
echo ">> compare new:${1} -VS- old:${2}" >&2
# stick with the original paths, so the reporting makes sense...
docker run --rm \
--volume "${REPO_ROOT}/${SCHEMA_DIR}/bom-${1}.proto:/workspace/${SCHEMA_DIR}/bom-${1}.proto:ro" \
--volume "${REPO_ROOT}/${SCHEMA_DIR}/bom-${2}.proto:/workspace/${SCHEMA_DIR}_old/bom-${1}.proto:ro" \
--volume "${THIS_DIR}/buf_breaking-version.yaml:/workspace/buf.yaml:ro" \
--volume "${ROOT_PATH}/${SCHEMA_DIR}/bom-${1}.proto:/workspace/${SCHEMA_DIR}/bom-${1}.proto:ro" \
--volume "${ROOT_PATH}/${SCHEMA_DIR}/bom-${2}.proto:/workspace/${SCHEMA_DIR}_old/bom-${1}.proto:ro" \
--volume "${THIS_PATH}/buf_breaking-version.yaml:/workspace/buf.yaml:ro" \
--workdir '/workspace' \
bufbuild/buf:1.29.0 \
breaking "$SCHEMA_DIR" --against "${SCHEMA_DIR}_old" \
Expand All @@ -70,8 +70,8 @@ function schema-breaking-remote () {
fi

docker run --rm \
--volume "${REPO_ROOT}/${SCHEMA_DIR}:/workspace/${SCHEMA_DIR}:ro" \
--volume "${THIS_DIR}/buf_breaking-remote.yaml:/workspace/buf.yaml:ro" \
--volume "${ROOT_PATH}/${SCHEMA_DIR}:/workspace/${SCHEMA_DIR}:ro" \
--volume "${THIS_PATH}/buf_breaking-remote.yaml:/workspace/buf.yaml:ro" \
--workdir '/workspace' \
bufbuild/buf:1.29.0 \
breaking "$SCHEMA_DIR" --against "${REMOTE}#subdir=${SCHEMA_DIR}" \
Expand Down

0 comments on commit c7cfbe7

Please sign in to comment.