docker-lint: use go 1.19 compatible golangci-lint version

- use same user in docker container
- use GOPATH in source dir to prevent downloading all dependencies on each run
- add make clean
This commit is contained in:
André Roth
2024-08-02 18:35:04 +02:00
parent 0a6e8e3c9e
commit 40eb4b4751
4 changed files with 28 additions and 5 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# cleanup
rm -rf /app/tmp
rm -rf /tmp/aptly*
usermod -u `stat -c %u /app` aptly >/dev/null
chown -R `stat -c %u /app` /var/lib/aptly
# use same /home/runner dir as in github workflow
chown -R `stat -c %u /app` /home/runner
cmd=$@
if [ -z "$cmd" ]; then
cmd="bash"
fi
su aptly -c "cd /app; GOPATH=/app/.go go install github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_LINT_VERSION; PATH=\$PATH:/app/.go/bin golangci-lint run"