所以在我的仓库中,我有3个单独的脚本。脚本A,脚本B和脚本C。每个脚本位于相应的文件夹A,B,C中。 我要配置.travis.yml文件,以便仅在文件夹A发生更改时才运行脚本A。或者在文件夹A和B发生更改时才运行脚本A和B。>
那么我可以在文件夹上设置任何travis挂钩吗?
编辑:
下面是我的脚本:
language: node_js
node_js: 8.12.0
group: bluezone
services:
- docker
build_artifacts_service:
before_install:
- chmod +x services/artifacts-
service/unit_tests/deployment/controller_test.js
- chmod +x services/artifacts-
service/unit_tests/driver/controller_test.js
- cd services/artifacts-service/
install:
- npm install
script:
- npm test
after_success:
- bash builddocker.sh
only:
changes:
- services/artifacts-service/
build_some_other_service:
before_install:
- echo "I was executed"
only:
changes:
- images/endor/
它不了解.travis.yml文件,并开始安装ruby
它在Travis配置中显示
{
"language": "ruby",
"os": "linux",
"group": "stable",
"dist": "precise"
}
答案 0 :(得分:0)
您可以使这些脚本中的每个脚本作为不同的目标运行,并为其具有唯一更改块:
build_a:
script:
- ./script_a
only:
changes:
- ./script_a
- ./folder_a