node { stage ('setup') { setupEnv (dockerImage:'dockerImage123') } stage ('train') { runNotebook (notebookPath:'notebookPath212') // { prepare, run, archive, legion } // runNotebook (notebookPath:'notebookPath213') } stage ('deploy') { deployModel () } stage ('test') { testModel () }}
dockerNode(dockerHost: 'unix:///var/run/docker.sock', image: 'jenkins/slave', remoteFs: '/home/jenkins') { sh 'echo "hello there"' } |
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5a2441d6-72ef-45f7-a415-356510c8a9cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
We have reached acceptable solution for the problem. It is loading groovy script with black magic around closure. Attaching code for the community benefit.
def container(myImageName, Closure body){ docker.image(myImageName).inside(dockerArgs(), body)}
def myImage = 'php:latest' def modelId = drun.modelId()
echo modelId
drun.container(myImage) { stage ('setup'){ sh 'id' echo 'value = ' + modelId }
stage('stage 1'){ sh '/usr/local/bin/php -version' }}
public class DrunPropertiesStep extends Step {
...
public static class Execution extends SynchronousStepExecution<Object> { private static final long serialVersionUID = 1;
Execution(StepContext context) { super(context); }
@Override protected Object run() throws Exception { Run run = getContext().get(Run.class); //todo: implement
JSONObject json = Utils.getJson(run.getRootDir().getPath(), run.getLogReader());
Map map = new HashMap<String, String>(); Iterator iter = json.keys(); while( iter.hasNext() ) { String key = iter.next().toString();
map.put(key, json.getString(key)); }
return map; } }
...
}