Initial commit.
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2024-05-04 13:18:37 +05:00
commit 8b945c8f90
16 changed files with 273 additions and 0 deletions

17
scripts/helpers/arch.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# shellcheck disable=SC2034
# Line above disables shellcheck linters:
# * SC2043 - unused variable (this file sourced elsewhere).
base_arch=$(uname -m)
arch=""
if [ "$base_arch" = "x86_64" ]; then
arch=amd64
elif [ "$base_arch" = "aarch64" ]; then
arch=arm64
else
echo "unknown arch"
exit 1
fi

4
scripts/workers/debian.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
apt update && apt upgrade -y
apt install -y build-essential curl file git make

7
scripts/workers/dlv.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
dlv_version=1.22.1
set -xe
CGO_ENABLED=0 GOBIN=/usr/local/bin/ go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@v"$dlv_version"

View File

@@ -0,0 +1,10 @@
#!/bin/bash
go_junit_report_version=2.1.0
cd /tmp
git clone https://github.com/jstemmer/go-junit-report.git
cd go-junit-report || exit 1
git checkout "v${go_junit_report_version}"
go build -o /usr/local/bin/go-junit-report .
rm -rf /tmp/go-junit-report

12
scripts/workers/gofumpt.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
gofumpt_version="0.6.0"
set -xe
cd /tmp
git clone https://github.com/mvdan/gofumpt.git
cd gofumpt || exit 1
git checkout "v${gofumpt_version}"
go build -o /usr/local/bin/gofumpt .
rm -rf /tmp/gofumpt

22
scripts/workers/golang.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# shellcheck disable=SC2154
# Line above disables shellcheck linters:
# * SC2154 - variable referenced but not assigned (false positive, assigned when sourced arch.sh).
set -xe
go_version=1.22.2
# shellcheck disable=SC2086,SC2046,SC2164
cd $(dirname ${BASH_SOURCE[0]})
script_path=$(pwd)
# shellcheck disable=SC1091
source "${script_path}/../helpers/arch.sh"
curl "https://dl.google.com/go/go${go_version}.linux-${arch}.tar.gz" -o "/tmp/go-${arch}.tar.gz"
file "/tmp/go-${arch}.tar.gz"
tar -xf "/tmp/go-${arch}.tar.gz" -C /usr/local/
rm "/tmp/go-${arch}.tar.gz"
ln -s /usr/local/go/bin/* /usr/local/bin

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# shellcheck disable=SC2154
# Line above disables shellcheck linters:
# * SC2154 - variable referenced but not assigned (false positive, assigned when sourced arch.sh).
golangci_lint_version=1.57.2
# shellcheck disable=SC2086,SC2046,SC2164
cd "$(dirname ${BASH_SOURCE[0]})"
script_path=$(pwd)
# shellcheck disable=SC1091
source "${script_path}/../helpers/arch.sh"
curl -L "https://github.com/golangci/golangci-lint/releases/download/v${golangci_lint_version}/golangci-lint-${golangci_lint_version}-linux-${arch}.tar.gz" -o "/tmp/golangci-lint-${arch}.tar.gz"
file "/tmp/golangci-lint-${arch}.tar.gz"
tar -xf "/tmp/golangci-lint-${arch}.tar.gz" -C /tmp
mv "/tmp/golangci-lint-${golangci_lint_version}-linux-${arch}/golangci-lint" /usr/local/bin
rm -rf "/tmp/golangci-lint-${arch}.tar.gz" "/tmp/golangci-lint-${golangci_lint_version}-linux-${arch}/"

14
scripts/workers/mockery.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
mockery_v2_version=2.42.2
cd /tmp || exit 1
# mockery v2 we download from releases page
arch=$(uname -m)
download_url="https://github.com/vektra/mockery/releases/download/v${mockery_v2_version}/mockery_${mockery_v2_version}_Linux_${arch}.tar.gz"
curl -L ${download_url} -o "/tmp/mockery_${arch}.tar.gz"
mkdir /tmp/mockery_v2
tar xf "/tmp/mockery_${arch}.tar.gz" -C /tmp/mockery_v2
mv /tmp/mockery_v2/mockery /usr/local/bin/mockery_v2
rm -rf "/tmp/mockery_$(uname -m).tar.gz" /tmp/mockery*

21
scripts/workers/taskfile.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# shellcheck disable=SC2154
# Line above disables shellcheck linters:
# * SC2154 - variable referenced but not assigned (false positive, assigned when sourced arch.sh).
taskfile_version=3.36.0
# shellcheck disable=SC2086,SC2046,SC2164
cd "$(dirname ${BASH_SOURCE[0]})"
script_path=$(pwd)
# shellcheck disable=SC1091
source "${script_path}/../helpers/arch.sh"
curl -L "https://github.com/go-task/task/releases/download/v${taskfile_version}/task_linux_${arch}.tar.gz" -o "/tmp/taskfile-${arch}.tar.gz"
file "/tmp/taskfile-${arch}.tar.gz"
tar -xf "/tmp/taskfile-${arch}.tar.gz" -C /tmp
mv "/tmp/task" /usr/local/bin
rm -rf "/tmp/*"
ls -la /usr/local/bin