如何查看服务器上安装了哪个版本的GitLab ?

我是关于GitLab更新日志中指定的版本: https://gitlab.com/gitlab-org/gitlab-foss/blob/master/CHANGELOG.md

例如:“6.5.0”,“6.4.3”等。

Сan这只能通过终端吗? 有没有办法远程(用浏览器而不是终端)做到这一点?


当前回答

以下信息可以从CI管道中获得(GitLab >= 11.4):

Variable Value
CI_SERVER_VERSION_MAJOR The major version of the GitLab instance.
CI_SERVER_VERSION_MINOR The minor version of the GitLab instance.
CI_SERVER_VERSION_PATCH The patch version of the GitLab instance.
CI_SERVER_VERSION The full version of the GitLab instance.

其他回答

如果你使用的是自托管版本的GitLab,那么你可以考虑运行这个命令。

grep gitlab /opt/gitlab/version-manifest.txt

您有两个选择(登录后)。

使用API url https://gitlab.example.com/api/v4/version(你可以使用私有令牌从命令行使用它),它返回{"version":"10.1.0","revision":"5a695c4"} 在浏览器https://gitlab.example.com/help中使用HELP url,您将看到GitLab的版本,即GitLab社区版10.1.0 5a695c4

最简单的方法是粘贴以下命令:

cat /opt/gitlab/version-manifest.txt | head -n 1

这样就安装好了版本。:)

它可以使用REST检索,参见版本API:

curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/version

有关身份验证,请参阅个人访问令牌文档。

cat /opt/gitlab/version-manifest.txt |grep gitlab-ce|awk '{print $2}'