进入 git CI 终端并列出目录。

huangapple go评论61阅读模式
英文:

Enter to git CI termial and list the directories

问题

我是你的中文翻译助手,以下是翻译好的内容:

我对git ci/cd还不熟悉。我已经创建了一个gitlab-ci.yml文件。该文件下载一个tar文件,并尝试将这些文件移动到另一个目录以进行一些测试。

因此,我想检查文件和目录是否被创建。有没有办法进入git终端或其他方式,进入一个路径并列出所有文件?

谢谢。

英文:

I am new to git ci/cd. I have created a gitlab-ci.yml file. This file downloads a tar file and tries to move those files to one more directory to perform some test.

So I want to check whether files and directories are getting created. Is there any way to enter to git terminal or something and go to a path and list all the files?

Thank you

答案1

得分: 1

是的。由于yml文件与命令一起使用,您可以这样做。

test_job:
  stage: test
  script:
    - cd <目标目录> #导航到您想要的路径
    - dir #列出所有文件

从这里开始,您可以使用一些基本的cmd逻辑创建一个测试,以检查文件的数量与实际数量是否匹配。

这是一个包含所有cmd命令的好资源:https://ss64.com/nt/。

英文:

Yes. Since the yml file works with commands, you can do something as such.

test_job:
  stage: test
  script:
    - cd &lt;the target directory&gt; #navigates to the path you want
    - dir #lists all files

From here, you could create a test to check the count of files vs the actual count with some basic cmd logic.

Here is a good resource with all the cmd commands https://ss64.com/nt/.

huangapple
  • 本文由 发表于 2023年7月27日 14:57:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76777187.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定