azure-devops - 如何停止 PublishPipelineArtifact 忽略 .git 目录
问题描述
我一直在为使用 maven 构建的 java 应用程序开发 Azure Devops CICD 管道。几个月前,当我不得不停车时,这是可行的。现在它失败了,因为当我在第一阶段结束时发布工件时不包含 .git 目录。
如果启用系统诊断,我可以在输出中看到这一点
2021-08-24T21:12:12.9417903Z Information, Processing .artifactignore file surfaced 30 files. Total files under source directory: 474
2021-08-24T21:12:12.9418814Z Verbose, Ignoring the following files/folders:
2021-08-24T21:12:12.9419773Z Verbose, /home/vsts/work/1/s/.git/FETCH_HEAD
...
这是任务
# copy downloaded git repository including build in target directory , for use in next stage
- publish:
artifact: repository
我没有 .artifactignore 文件。
有没有办法阻止这种情况发生?
解决方案
据此_
steps:
- publish: $(System.DefaultWorkingDirectory)/bin/WebApp
artifact: WebApp
要发布的文件或文件夹的路径是必需的。它可以是 $(System.DefaultWorkingDirectory) 的绝对路径或相对路径。
请添加发布步骤的路径。
推荐阅读
- javascript - 从动态添加的组件中调用宿主或父组件的方法的正确方法是什么?
- html - 如何在中心“div”和“a”元素对齐
- ubuntu-18.04 - ROS 节点正在运行但某些连接断开
- javascript - TypeScript 客户端使用
- java - 如何使 KeyListener 起作用?
- c - C 中在 if 条件下带有括号的问题
- c++ - CRAN 是否需要为包中的每个 .R 和 .cpp 函数提供单独的文件?
- sql-server - 我希望将表 2 中的一些数据和一些常量插入表 1
- python - UnboundLocalError:赋值前引用的局部变量——添加为全局变量?
- c++ - 如何停止/中断当前循环(序列)以运行新数据(序列)?