kum*_*mar 5 bitbucket bitbucket-pipelines
我是 bitbuckt 管道的新手。对于我bitbucket-pipelines.yml在管道中添加的节点项目,我有一个构建容器并将其推送到 ECR 的步骤以及另一个部署步骤。
现在,每次我对 bitbucket-pipelines.yml 进行更改时,它都会构建一个新映像并将其推送到 ECR 并进行部署。
\n当我对 bitbucket-pipelines.yml 进行更改时,我不知道要触发什么管道。我只希望在对应用程序进行更改时触发管道。我是否设置了错误的项目?
\n我的项目结构。
\n.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 bitbucket-pipelines.yml\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Dockerfile\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index.js\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 node_modules\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package-lock.json\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 README.md\nRun Code Online (Sandbox Code Playgroud)\n
Mr-*_*IDE 13
有几种可能的选择:
[skip ci]到您的 git 提交消息bitbucket-pipelines.yml每当您单独更改 时,请在 Git 提交消息中的某处添加“[skip ci]” (不带引号)。当您推送到 Bitbucket 远程时,这将阻止管道运行。
来源和更多信息:
优点:
缺点:
"[skip ci]"。这很容易忘记,或者新的团队成员可能不知道它。编写一个 Git Hook 脚本,该脚本将自动将“[skip ci]”文本插入到 Git 提交消息中。该脚本必须执行以下操作:
git diff --name-only HEAD~0 HEAD~1bitbucket-pipelines.yml是唯一更改的文件,请修改提交以插入"[skip ci]"到提交消息中。有关 Git Hook 的更多信息:
优点:
缺点:
bitbucket-pipelines.yml文件更改在构建脚本中添加一个部分yml来检查在最新提交中更改了哪个文件。
yml 中的脚本必须执行以下操作:
git diff --name-only HEAD~0 HEAD~1bitbucket-pipelines.yml是唯一的文件发生了更改,请立即中止 CI 构建,并发出一条exit 0语句。优点:
缺点:
changesets用an定义 aincludePaths仅当修改的文件之一与 中的表达式匹配时才执行步骤includePaths。
pipelines:
default:
- step:
name: build-frontend-artifact
condition:
changesets:
includePaths:
# only xml files directly under resources directory
- "src/main/resources/*.xml"
# any changes in frontend directory
- "src/site/**"
script:
- echo "Building frontend artifact"
Run Code Online (Sandbox Code Playgroud)
来源和更多信息:
| 归档时间: |
|
| 查看次数: |
8020 次 |
| 最近记录: |