Wrap vars in script call to avoid insecure call detection
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
def call(Map args = [:]) {
|
||||
script {
|
||||
if (!args.imageName || !args.dockerfile || !args.context) {
|
||||
error "dockerBuild requires imageName, dockerfile, and context arguments"
|
||||
}
|
||||
|
||||
def imageName = args.imageName
|
||||
def dockerfile = args.dockerfile
|
||||
def context = args.context
|
||||
|
||||
echo "Building Docker image: ${imageName}"
|
||||
sh """
|
||||
docker build -t ${imageName} -f ${dockerfile} ${context}
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user