如何解决使用 Github App 时 Google Cloud Build 不会忽略文件
我将 Google Cloud Build 与 Kaniko 结合使用(用于 docker 层缓存)。
我想在运行 kaniko 之前添加第一步,并意识到当 Github 应用程序发送触发器时没有考虑我的 .gcloudignore
。当我自己调用命令 gcloud builds submit
时,它会起作用。
.gcloudignore
# If you would like to upload your .git directory,.gitignore file or
# files from your .gitignore file,remove the corresponding line below:
.git
.gitignore
.gcloudignore
.dockerignore
#!include:.gitignore
#!include:.dockerignore
cloudbuild.yaml
steps:
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- |
docker -v && ls -lah
- name: 'gcr.io/kaniko-project/executor:latest'
id: 'image-base'
args:
- --build-arg=git_hash=$SHORT_SHA
当使用 CLI 时它运行良好,ls 只显示应该存在的内容。
但是当 gcb 收到一个 github 触发器时,ls -lah
会打印出很多应该被 include:.dockerignore
我不明白,这让我发疯? 有人可以帮我吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。