Skip to content

Commit

Permalink
hack: avoid updating generated proto version
Browse files Browse the repository at this point in the history
This can be done as a separate change when needed.
Also should analyze if this would affect the gogo
incompatibility issues with newer proto.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
  • Loading branch information
tonistiigi committed Jun 8, 2021
1 parent 5908e1c commit d9f6a9b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
19 changes: 19 additions & 0 deletions hack/shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -e

function clean() {
docker rmi $(cat $iidfile)
}

iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
DOCKER_BUILDKIT=1 docker build --iidfile $iidfile --target dev-env .


#DOCKER_BUILDKIT=1 docker build --iidfile $iidfile -f ./hack/dockerfiles/test.buildkit.Dockerfile --target dev-env .
trap clean EXIT
SSH=
if [ -n "$MOUNT_SSH_AUTH_SOCK" ]; then
SSH="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK"
fi
docker run $SSH -it --privileged -v /tmp --net=host -e BUILDKIT_REGISTRY_MIRROR_DIR=/root/.cache/registry --rm $(cat $iidfile)
5 changes: 3 additions & 2 deletions hack/update-generated-files
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
set -eu

gogo_version=$(awk '$1 == "github.com/gogo/protobuf" { print $2 }' go.mod)
protobuf_version=$(awk '$3 == "github.com/golang/protobuf" { print $4 }' go.mod)
# protobuf_version=$(awk '$3 == "github.com/golang/protobuf" { print $4 }' go.mod)
output=$(mktemp -d -t buildctl-output.XXXXXXXXXX)

buildxCmd build \
--target "update" \
--build-arg "GOGO_VERSION=$gogo_version" \
--build-arg "PROTOBUF_VERSION=$protobuf_version" \
--output "type=local,dest=$output" \
--file "./hack/dockerfiles/generated-files.Dockerfile" \
.

# --build-arg "PROTOBUF_VERSION=$protobuf_version" \

cp -R "$output/generated-files/" .
rm -rf $output

0 comments on commit d9f6a9b

Please sign in to comment.