【发布时间】:2019-01-17 14:01:52
【问题描述】:
我一直在努力使用 Jenkins 和 symfony 3.4 构建自动化构建。
如何在 Jenkins 中正确设置 symfony 可以找到的环境变量。
这是我的管道。
node {
def app
stage('composer install') {
sh 'export $(cat env/env_vars | xargs)'
sh 'composer install --optimize-autoloader'
}
stage('yarn install') {
sh 'yarn install'
}
stage ('build assets') {
sh 'yarn encore production'
}
stage('Clone repository') {
// clone
}
stage('Build image') {
// build here
}
stage('Push image') {
// push here
}
}
然后在我运行我的构建之后。
我总是收到这条消息
....
Creating the "app/config/parameters.yml" file
Some parameters are missing. Please provide them.
database_host ('%env(DATABASE_HOST)%'): Script Incenteev\ParameterHandler
\ScriptHandler::buildParameters handling the symfony-scripts event terminated with an exception
[Symfony\Component\Console\Exception\RuntimeException]
Aborted
....
我已经使用了一些 jenkins 插件,例如 EnvInjector 和类似的东西。但是symfony还是找不到我的环境变量。
【问题讨论】:
标签: symfony jenkins continuous-integration environment-variables