Skip to content

Commit 5ec4e13

Browse files
oktalzGopher Bot
authored andcommitted
CLEANUP/MINOR: ci: use temporary directory for additional tools
tmp is shared across projects, so we can easily reuse same binary
1 parent 21bddcc commit 5ec4e13

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

.aspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ allowed:
7070
- CIDR
7171
- auth
7272
- userlist
73+
- tmp

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ lint:
3636

3737
.PHONY: check-commit
3838
check-commit:
39-
cd bin;CHECK_COMMIT=${CHECK_COMMIT} sh check-commit.sh
40-
bin/check-commit
39+
CHECK_COMMIT=${CHECK_COMMIT} sh bin/check-commit.sh
40+
/tmp/check-commit/v${CHECK_COMMIT}/check-commit
4141

4242
.PHONY: yaml-lint
4343
yaml-lint:

bin/check-commit.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#!/bin/sh
2-
V=$(./check-commit tag)
2+
BIN_DIR="/tmp/check-commit/v$CHECK_COMMIT"
33

4-
if echo "$V" | grep -q "v$CHECK_COMMIT"; then
5-
echo "$V"
6-
else
7-
echo "go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT"
8-
GOBIN=$(pwd) go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT
4+
if [ -x "$BIN_DIR/check-commit" ]; then
5+
V=$("$BIN_DIR/check-commit" tag)
6+
if echo "$V" | grep -q "v$CHECK_COMMIT"; then
7+
echo "$V"
8+
exit 0
9+
fi
910
fi
11+
12+
mkdir -p "$BIN_DIR"
13+
echo "go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT"
14+
GOBIN="$BIN_DIR" go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT

0 commit comments

Comments
 (0)