2017-10-17 63 views
0

我想澄清可以添加到我的项目库中.s2i/bin目录中的可能脚本。Openshift 3 - 覆盖.s2i/bin文件 - 汇编并运行脚本

文档说,当您添加这些文件时,他们将覆盖项目生成时的默认文件同名。例如,如果我将自己的“汇编”文件放在.s2i/bin目录中,那么默认的汇编文件还会运行还是完全被我的脚本替换?如果我想要默认文件的某些行为?我是否必须将默认的“组装”内容复制到我的文件中,这样两者都会被执行?

回答

0

你需要从你自己的地方调出原始的“汇编”脚本。与此类似

#!/bin/bash -e 
# The assemble script builds the application artifacts from a source and 
# places them into appropriate directories inside the image. 

# Execute the default S2I script 
source ${STI_SCRIPTS_PATH}/assemble 

# You can write S2I scripts in any programming language, as long as the 
# scripts are executable inside the builder image. 
+0

请注意''STI_SCRIPTS_PATH''不是保证设置的环境变量。一些S2I的建设者可能会因历史原因而设置,但其他人可能不会。所以你需要从图像中找出位置。对于许多语言构建者而言,它是'/ usr/libexec/s2i'',而其他语言则是'/ usr/local/s2i''。 –

+0

有关添加V2风格动作挂钩机制的示例,该机制允许在构建和部署的不同阶段使用单独的挂钩脚本,请参阅https://github.com/getwarped/action-hooks或者,如果使用Python,请参阅https:// pypi.python.org/pypi/powershift-image –

+0

感谢你们俩。 –