作为run步骤的一部分,我们正在尝试复制Concourse CI package.yml文件中的多个jar文件:
run:
path:
args:
- -exc
- |
...
cp project/target/*.jar build-output/.但是Concourse向源文件添加了单引号,所以它正在查找一个名为'project/target/*.jar'的文件,当然它找不到它。
+ cp 'project/target/*.jar' build-output/.
cp: can't stat 'project/target/*.jar'; no such file or directory 我甚至尝试用双引号将jar文件名括起来,希望它可以防止Concourse更改它,但这并没有什么不同。
我们希望使用file globbing,这样我们就可以通用地使用它,这样我们就不需要提前知道文件名了。我们有没有办法让这件事起作用?
发布于 2018-11-21 04:44:58
很奇怪。尝试指定shell:
run:
path: sh <== missing `sh` or the shell you have available in the image
args:
- -exc
- |
...
cp project/target/*.jar build-output/ <== no `.`嗯,实际上可能引号有误导性,project/target下面什么都没有:-)试试
run:
path: sh <== missing `sh` or the shell you have available in the image
args:
- -exc
- |
...
# is anything here ?
ls -1 project/target
cp project/target/*.jar build-output/ <== no `.`发布于 2018-12-13 11:33:31
set -x模式引用了所有参数;这并不意味着它实际上引用了参数。我想你是在转移注意力,但我很高兴你让它起作用了。
https://stackoverflow.com/questions/53400714
复制相似问题