如何更改Gitlab变量的CHMOD?

发布于 2025-01-31 08:49:20 字数 627 浏览 5 评论 0原文

我的部署阶段失败了,只有那条线

chmod og= $STAGE_ID_RSA

得到了错误,

chmod og= $STAGE_ID_RSA
BusyBox v1.34.1 (2022-04-04 10:19:27 UTC) multi-call binary.
Usage: chmod [-Rcvf] MODE[,MODE]... FILE...
MODE is octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst]
    -R  Recurse
    -c  List changed files
    -v  Verbose
    -f  Hide errors
ERROR: Job failed: exit code 1

我读了 gitlab ci/cd Pipeline错误 但是我在gitlab服务器上没有.ssh(位于其他服务器上)。 如何更改文件内容权限?

My deploy stage failed,just that line

chmod og= $STAGE_ID_RSA

Got error

chmod og= $STAGE_ID_RSA
BusyBox v1.34.1 (2022-04-04 10:19:27 UTC) multi-call binary.
Usage: chmod [-Rcvf] MODE[,MODE]... FILE...
MODE is octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst]
    -R  Recurse
    -c  List changed files
    -v  Verbose
    -f  Hide errors
ERROR: Job failed: exit code 1

I read this
Gitlab CI/CD pipeline error
but I do not have .ssh on Gitlab server(located on other server).
How to change file content permission?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情仇皆在手 2025-02-07 08:49:20

检查是否将“ stage_id_rsa”保存为Gitlab的变量配置页面上的“文件”非“变量”。

check if "STAGE_ID_RSA" is saved as "file" not "variable" on the gitlab's variable configuration page.

残疾 2025-02-07 08:49:20

对我来说,问题只是将变量仅设为受保护,这意味着它们仅在受保护的分支中可见。管道的选定分支未设置为受保护,因此ID_RSA密钥的变量(绝对必须作为文件设置)无法获得相同的结果。

来解决问题

  • 我确实通过将变量设置为键入文件
  • ,从变量中删除受保护的标志
  • 将当前分支设置为受保护的分支

For me the problem was simply setting the variables as protected only, which means they are only visible for protected branches. The selected branch for the pipeline was not set to protected and so the variable for the ID_RSA key (which definitely has to get set as a file) was not available leading to the same result.

I did solve the problem by

  • setting the variable to type file
  • remove the protected flag from the variable
    or
  • set the current branch as protected branch
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文