Add ability to pass custom context to test-cookiecutter job

Change-Id: I0a91a82eff1f7681cc9fed801206a681045130e2
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index 9312097..79a1632 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -286,6 +286,13 @@
                     parallel paralellEnvs
                     sh("rsync -a --exclude '*@tmp' ${templateEnvHead} ${templateEnvPatched}")
                 }
+                if (env.CUSTOM_COOKIECUTTER_CONTEXT) {
+                    // readYaml to check custom context structure
+                    def customContext = readYaml text: env.CUSTOM_COOKIECUTTER_CONTEXT
+                    writeYaml file: "${templateEnvHead}/contexts/custom_context.yml", data: customContext
+                    writeYaml file: "${templateEnvPatched}/contexts/custom_context.yml", data: customContext
+                    common.infoMsg("Using custom context provided from job parameter 'CUSTOM_COOKIECUTTER_CONTEXT'")
+                }
             }
             stage("Check workflow_definition") {
                 // Check only for patchset