我正在为一个基于node.js的应用程序构建一个Docker镜像,其中一些依赖项需要一个私有NPM注册表的NPM令牌,但是在构建映像时,包含该令牌的变量为null,例如
docker build -t 3273e0bfe8dd329a96070382c1c554454ca91f96 --build-args NPM_TOKEN=null -f Dockerfile
Run Code Online (Sandbox Code Playgroud)
简化的管道是:
pipeline {
environment {
NPM_TOKEN = credentials('npm-token')
}
agent {
dockerfile {
additionalBuildArgs "--build-args NPM_TOKEN=${env.NPM_TOKEN}"
}
}
stages {
stage('Lint') {
steps {
sh 'npm run lint'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
有没有办法在该部分使用env变量或目前不支持?
我是Grails的新手,我正在使用Grails 2.0.1.我想为域类的对象中的更改添加持久性事件侦听器,因此我尝试了用户指南中给出的Bootstrap.groovy中的代码:
def init = {
applicationContext.addApplicationListener(new FooBarListener())
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息:
错误context.GrailsContextLoader - 执行bootstraps时出错:没有这样的属性:类的applicationContext:BootStrap
如何从BootStrap类中获取applicacionContext属性?或者文档是否过时,是否有新的/更好的方法来添加域更改侦听器?
提前致谢.