如何通过 Bitbucket 管道使用托管运行器更改目录

发布于 2025-01-19 14:54:17 字数 501 浏览 0 评论 0原文

我有一个简单的管道,我只想在托管跑步者的服务器上导航到特定文件夹。

我的跑步者在线,我在SSH键部分中添加了主机,我的步骤是:

  - step:
      name: 'Write log to server'
      services:
        - docker
      runs-on:
        - self.hosted
        - linux
      script:
        - export HOST_PROJECT_PATH=/home/project/myproject
        - ls -a
        - cd $HOST_PROJECT_PATH // folder not found but exists

ls -A显示我的Bitbucket存储库的内容,我无法cd到现有目录(目录存在于服务器上)。

我可以使用管道&跑步者?我需要使用其他服务吗?找不到任何示例或文档。

I have a simple pipeline where I just want to navigate to a specific folder on the server hosting the runner.

My runner is online, I added the host in the SSH Keys section, and my step is:

  - step:
      name: 'Write log to server'
      services:
        - docker
      runs-on:
        - self.hosted
        - linux
      script:
        - export HOST_PROJECT_PATH=/home/project/myproject
        - ls -a
        - cd $HOST_PROJECT_PATH // folder not found but exists

The ls -a shows the content of my Bitbucket repository, and I can't cd to an existing directory (directory exists on the server).

Can I do it using pipeline & runner ? Do I need to use an other service ? Can't find any example or documentation.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文