From 4beb5c119b858a0e8f34d384b24b350c67ee54f0 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 28 Nov 2023 08:57:52 -0800 Subject: [PATCH] [chore] missed the build script (#29538) Signed-off-by: Alex Boten --- internal/buildscripts/update-dep | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 internal/buildscripts/update-dep diff --git a/internal/buildscripts/update-dep b/internal/buildscripts/update-dep new file mode 100755 index 000000000000..e79df74741ff --- /dev/null +++ b/internal/buildscripts/update-dep @@ -0,0 +1,30 @@ +#!/bin/bash -x + +# Updates MODULE inside go.mod if it is already present to version VERSION. + +source `git rev-parse --show-toplevel`/internal/buildscripts/modules + +set -e + +if grep -q "$MODULE " go.mod; then + go get "$MODULE"@"$VERSION" +fi + +# If MODULE is "go.opentelemetry.io/collector" need to update additional $modules as well +if [ "$MODULE" == "go.opentelemetry.io/collector" ]; then + for mod in ${beta_modules[@]}; do + if grep -q "$mod " go.mod; then + go get -d "$mod"@"$VERSION" + fi + done + for mod in ${rc_modules[@]}; do + if grep -q "$mod " go.mod; then + go get -d "$mod"@"$RC_VERSION" + fi + done + for mod in ${stable_modules[@]}; do + if grep -q "$mod " go.mod; then + go get -d "$mod"@"$STABLE_VERSION" + fi + done +fi