gitlab-runner mips64le 龙芯

首先 拉下来gitlab-runner的代码 go编写的工程
git clone https://gitlab.com/gitlab-org/gitlab-runner.git
官方没没有对mips进行支持的 改下源码 Makefile.build.mk 这个文件,注意龙芯要用mips64le,mips64是跑不起来的
⋊> ~/D/gitlab-runner on main ⨯ git diff Makefile.build.mk
diff --git a/Makefile.build.mk b/Makefile.build.mk
index b32d672d4..3c3fcb2ef 100644
--- a/Makefile.build.mk
+++ b/Makefile.build.mk
@@ -53,6 +53,11 @@ runner-bin-linux: OS := 'linux'
 runner-bin-linux:
        $(MAKE) runner-bin BUILD_PLATFORMS="-os=$(OS) $(BUILD_ARCHS)"

+runner-bin-mips: OS := 'linux'
+runner-bin-mips: ARCH := 'mips64le'
+runner-bin-mips:
+       $(MAKE) runner-bin BUILD_PLATFORMS="-osarch=$(OS)/$(ARCH)"
+
 runner-and-helper-bin-host: runner-bin-host helper-bin-host helper-dockerarchive-host

 runner-and-helper-bin-linux: runner-bin-linux helper-dockerarchive
接着咱们要安装golang gox用于交叉编译 mac上比较方便直接brew装就是
brew install go
brew install gox
然后就可以编译了
make runner-bin-mips

⋊> ~/D/gitlab-runner on main ⨯ ls out/binaries/gitlab-runner-linux-mips64le
out/binaries/gitlab-runner-linux-mips64le*
然后注册下,就可以跑起来了