Skip to content

Commit

Permalink
ci(deps): don't add filename to deps.lock hash (#6032)
Browse files Browse the repository at this point in the history
The filename was causing issues depending on where the sub folder is

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit 15cc640)

# Conflicts:
#	mk/dependencies/deps.lock
#	tools/dev/install-dev-tools.sh
  • Loading branch information
lahabana authored and mergify[bot] committed Feb 14, 2023
1 parent 139e91b commit e3ea71c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions mk/dependencies/deps.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e8edb47c61d38a1607607a23d4db45a1a6b5f494
21 changes: 21 additions & 0 deletions tools/dev/install-dev-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -e

CI_TOOLS_BIN_DIR="$1"
CI_TOOLS_DIR="$2"
TOOLS_DEPS_DIRS="$3"
TOOLS_DEPS_LOCK_FILE="$4"
GOOS="$5"
GOARCH="$6"

mkdir -p "$CI_TOOLS_BIN_DIR" "$CI_TOOLS_DIR"/protos
# TOOLS_DEPS_DIRS has space separated directories
IFS=" " read -ra TOOLS_DEPS_DIRS <<< "${TOOLS_DEPS_DIRS[@]}"

# Also compute a hash to use for caching
FILES=$(find "${TOOLS_DEPS_DIRS[@]}" -name '*.sh' | sort)
for i in ${FILES}; do OS="$GOOS" ARCH="$GOARCH" "$i" "${CI_TOOLS_DIR}"; done
for i in ${FILES}; do cat "${i}"; done | git hash-object --stdin > "$TOOLS_DEPS_LOCK_FILE"

echo "All non code dependencies installed, if you use these tools outside of make add $CI_TOOLS_BIN_DIR to your PATH"

0 comments on commit e3ea71c

Please sign in to comment.