Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion codegen/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ pushd "$THIS_DIR/.." >/dev/null

docker build -t p4runtime-ci -f codegen/Dockerfile .

# Read the Go version from the Dockerfile so this script and the CI image
# can't drift out of sync with each other.
GO_VERSION="$(sed -n 's/^ARG GO_VERSION=//p' codegen/Dockerfile)"
if [ -z "$GO_VERSION" ]; then
echo "Could not determine GO_VERSION from codegen/Dockerfile" >&2
exit 1
fi

tmpdir="$(mktemp -d /tmp/p4rt.XXXXXX)"

docker run --rm \
Expand All @@ -47,7 +55,7 @@ docker run --rm -u "$(id -u):$(id -g)" \
-e "GOPATH=/tmp/gopath" \
-v "$(pwd):/p4runtime" \
-w /p4runtime \
golang:1.20 bash -c "go mod tidy"
"golang:${GO_VERSION}" bash -c "go mod tidy"

rm -rf "$tmpdir"

Expand Down
Loading