-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathupdate_deps.sh
executable file
·35 lines (27 loc) · 1.08 KB
/
update_deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# Copyright (c) 2022 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the COPYING file.
# This script is run periodically by Jenkins to post a review to
# update all of our dependencies and proto files.
set -eax
if [[ "$USER" != jenkins ]]; then
echo >&2 "warning: This script is mostly for Jenkins' benefit."
echo >&2 " It updates dependencies and posts a review to Gerrit."
echo >&2 " Hit enter to proceed anyway, Ctrl-C to cancel."
test -t 0 && read -rs # Read enter if stdin is a terminal
fi
set -xe
if ! test -x .git/hooks/commit-msg; then
scp -o BatchMode=yes -p -P 29418 gerrit.corp.arista.io:hooks/commit-msg .git/hooks/
fi
cd "$(dirname "$0")"
go version
# by default go mod tidy will tidy so that go sum includes checksums needed by one
# version lower than the go version in go.mod
go get -u ./... && go mod tidy -go=1.22.0
git add go.mod go.sum
./refresh_protos.sh
git commit -m "update dependencies and protos
Jenkins-Job-Name: $JOB_NAME
Jenkins-Build-Number: $BUILD_NUMBER"