213 shaares
1 résultat
taggé
argh
In a Groovy class:
private final Script script;
public MyClass(Script script) {
this.script = script;
}
public myMethod() {
this.script.env.test = "prout"
this.script.println(this.script.env.test)
this.script.properties([
this.script.parameters([
this.script.string(defaultValue: "${MY_VALUE}", description: 'the value', name: "${the_name}", trim: true),
this.script.password(defaultValue: "${MY_PASSWORD}", description: 'the password', name: "${the_password}", trim: true)
])
])
}
In the pipeline:
stage('My Stage') {
steps {
script {
MyClass toto = MyClass(this);
toto.myMethod();
}
}
}