背景:目前有多个模块:puppet-sftp,puppet-git,puppet-packer和puppet-otto使用相同的.travis。 YML。
目标:创建common .travis.yml而不是一遍又一遍地复制
方法:
结果:
The command "ls" exited with 0.
$ npm ansible-common-test/test
Usage: npm <command>
where <command> is one of:
add-user, adduser, apihelp, author, bin, bugs, c, cache,
completion, config, ddp, dedupe, deprecate, docs, edit,
explore, faq, find, find-dupes, get, help, help-search,
home, i, info, init, install, isntall, issues, la, link,
list, ll, ln, login, ls, outdated, owner, pack, prefix,
prune, publish, r, rb, rebuild, remove, repo, restart, rm,
root, run-script, s, se, search, set, show, shrinkwrap,
star, stars, start, stop, submodule, t, tag, test, tst, un,
uninstall, unlink, unpublish, unstar, up, update, v,
version, view, whoami
ATTEMPT2
$ sh ansible-common-test/test.sh
ansible-common-test/test.sh: 4: ansible-common-test/test.sh: ---: not found
ansible-common-test/test.sh: 5: ansible-common-test/test.sh: sudo:: not found
ansible-common-test/test.sh: 7: ansible-common-test/test.sh: env:: not found
ansible-common-test/test.sh: 8: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 9: ansible-common-test/test.sh: version:: not found
ansible-common-test/test.sh: 10: ansible-common-test/test.sh: init:: not found
ansible-common-test/test.sh: 11: ansible-common-test/test.sh: run_opts:: not found
ansible-common-test/test.sh: 13: ansible-common-test/test.sh: services:: not found
ansible-common-test/test.sh: 14: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 16: ansible-common-test/test.sh: before_install:: not found
ansible-common-test/test.sh: 18: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 20: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 22: ansible-common-test/test.sh: script:: not found
ansible-common-test/test.sh: 23: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 25: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 31: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 34: ansible-common-test/test.sh: -: not found
ansible-common-test/test.sh: 38: ansible-common-test/test.sh: Syntax error: newline unexpected
讨论:
来自.travis.yml的重复代码被移动到一个公共仓库,既不能运行.sh也不能运行yml。无论尝试什么,似乎都无法从通用仓库运行travis代码以避免代码重复。
期望如下: