Skip to content

Commit

Permalink
Makefile: update etcd to latest version, add checksums.
Browse files Browse the repository at this point in the history
Signed-off-by: Sepehrdad Sh <26747519+sepehrdaddev@users.noreply.github.com>
  • Loading branch information
sepehrdaddev committed Dec 8, 2023
1 parent 7bf5777 commit d5a0e2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
SOURCES = $(shell find . -name '*.go' -and -not -path "./_test_plugins" -and -not -path "./_test_plugins_fail" )
PACKAGES = $(shell go list ./...)
CURRENT_VERSION = $(shell git describe --tags --always --dirty)
VERSION ?= $(CURRENT_VERSION)
COMMIT_HASH = $(shell git rev-parse --short HEAD)
LIMIT_FDS = $(shell ulimit -n)
TEST_ETCD_VERSION ?= v2.3.8
SOURCES = $(shell find . -name '*.go' -and -not -path "./_test_plugins" -and -not -path "./_test_plugins_fail" )
PACKAGES = $(shell go list ./...)
CURRENT_VERSION = $(shell git describe --tags --always --dirty)
VERSION ?= $(CURRENT_VERSION)
COMMIT_HASH = $(shell git rev-parse --short HEAD)
LIMIT_FDS = $(shell ulimit -n)
TEST_ETCD_VERSION ?= v2.3.8
TEST_ETCD_CHECKSUM ?= 4fb304f384dd4d6e491e405fed8375a09ea1c6c2596b93f97cb31844202e620df160f87f18611e84f17675e7b7245e40d1aa23571ecdb507cb094ba04d378171
TEST_PLUGINS = _test_plugins/filter_noop.so \
_test_plugins/predicate_match_none.so \
_test_plugins/dataclient_noop.so \
Expand Down Expand Up @@ -114,7 +115,7 @@ clean: ## clean temporary files and directories
.PHONY: deps
deps: ## install dependencies to run everything
go env
./etcd/install.sh $(TEST_ETCD_VERSION)
./etcd/install.sh $(TEST_ETCD_VERSION) $(TEST_ETCD_CHECKSUM)
@go install honnef.co/go/tools/cmd/staticcheck@latest
@go install github.com/securego/gosec/v2/cmd/gosec@latest
@go install golang.org/x/vuln/cmd/govulncheck@latest
Expand Down
12 changes: 10 additions & 2 deletions etcd/install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#! /bin/bash
set -eo pipefail

ETCD_VERSION=master
if [ $# -gt 0 ]; then
ETCD_VERSION=v3.5.11
if [ $# -gt 0 ]; then
ETCD_VERSION="$1"
fi

ETCD_CHECKSUM=4fb304f384dd4d6e491e405fed8375a09ea1c6c2596b93f97cb31844202e620df160f87f18611e84f17675e7b7245e40d1aa23571ecdb507cb094ba04d378171
if [ $# -gt 1 ]; then
ETCD_CHECKSUM="$2"
fi

LOCAL_GOBIN=
if [ -n "${GOBIN}" ]; then
LOCAL_GOBIN="$GOBIN"
Expand All @@ -17,6 +22,9 @@ mkdir -p .bin
wget \
"https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz" \
-O ./.bin/etcd.tar.gz

echo "${ETCD_CHECKSUM} ./.bin/etcd.tar.gz" | sha512sum -c

tar -xzf .bin/etcd.tar.gz --strip-components=1 \
-C ./.bin "etcd-${ETCD_VERSION}-linux-amd64/etcd"

Expand Down

0 comments on commit d5a0e2f

Please sign in to comment.