Skip to content

Instantly share code, notes, and snippets.

@dragoonis
Last active September 22, 2020 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragoonis/d775b91f42afdb69279172673dcc3b31 to your computer and use it in GitHub Desktop.
Save dragoonis/d775b91f42afdb69279172673dcc3b31 to your computer and use it in GitHub Desktop.
org.jenkinsci.plugins.workflow.steps.MissingContextVariableException:
Required context class hudson.model.Node is missing
Perhaps you forgot to surround the code with a step that provides this,
such as: node
pipeline {
agent none
environment {
JAVA_HOME = "${tool 'jdk11'}"
MAVEN_HOME = "${tool 'Maven'}"
}
parameters {
choice(choices: mont_blanc_envs("gke-preprod env: prod"), description: 'Env to run.', name: 'MONT_BLANC_DEPLOY_NAME')
// string(defaultValue: '-Dcucumber.options="--plugin json:target/file-payment-cucumber-json-report.json --tags \'@payment and not (@ignore or @unstable or @bug)\'"
string(defaultValue: '', description: 'Tag for tests to be executed', name: 'runTag', trim: false)
string(defaultValue: '(@ignore or @unstable or @bug)', description: 'Tag for tests to be ignored', name: 'ignoreTag1', trim: false)
// booleanParam(defaultValue: false, description: 'Do you want to run SonarQube analysis?', name: 'runSonar')
}
stages {
stage('Purchase Expense') {
agent { label "kubernetes && ${k8s_env.name}" }
steps {
script {
def auto_test = false
if (branch_name == "develop") {
auto_test = true
}
mont_blanc_deploy(auto: auto_test, this.&purchaseExpenseTests)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment