#Is there a way to tell dagger to ignore
1 messages · Page 1 of 1 (latest)
@scenic cloak @fair hazel and some of us were discussing how to make this a better experience yesterday.
Doesn't just --my-arg "" do what you need?
hmm I didn't try ""... if you are familiar with Jenkins, I directly used the input parameter like --my-arg $params.myArg and kept the parameter field blank. That effectively becomes --my-arg . If I wanted to add "" I'm afraid I'd have to add a condition.
@dim pagoda ah, okay, I was also going to ask if you're just using // +optional or also using // +default at all in your cases.
Do you use declarative pipelines or scripted pipelines?
declarative, I tried both ways. having just // +optional and with // +default
What about --my-arg "$params.myArg"? Doesn't that work?
Good to do it like that anyway to prevent values from variables having spaces inside.
I was wondering if something like this would be needed.
pipeline {
agent any
stages {
stage('Example Stage') {
steps {
sh dagger call foo --my-arg "${params.myArg}"
}
}
}
}
Nice! Glad to learn that this works! (note real one below 👇 )
This is what I did
sh "dagger call -m ./mymodule promote --sources \"$params.sources\" --user PIPELINE_USR --pass PIPELINE_PSW --tag \"$params.tag\" --targetTag \"$params.targetTag\""