Skip to content

Commit

Permalink
Add debugging dump option to Jenkins (#16758)
Browse files Browse the repository at this point in the history
* Add debugging dump option to Jenkins

* Update Jenkinsfile

Co-Authored-By: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com>

* Use whenTrue

* Add debug call to makeTarget and mageTargetWin

* Add mage dump

Co-authored-by: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com>
  • Loading branch information
cachedout and kuisathaverat authored Mar 11, 2020
1 parent 03d0c98 commit 5bd84ae
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pipeline {
parameters {
booleanParam(name: 'runAllStages', defaultValue: false, description: 'Allow to run all stages.')
booleanParam(name: 'windowsTest', defaultValue: true, description: 'Allow Windows stages.')
booleanParam(name: 'debug', defaultValue: false, description: 'Allow debug logging for Jenkins steps')
}
stages {
/**
Expand All @@ -38,6 +39,10 @@ pipeline {
dir("${BASE_DIR}"){
loadConfigEnvVars()
}
whenTrue(${params.debug}){
dumpFilteredEnvironment()
}
}
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
}
}
Expand Down Expand Up @@ -527,6 +532,10 @@ pipeline {
}

def makeTarget(context, target, clean = true){
whenTrue(${params.debug}){
dumpFilteredEnvironment()
dumpMage()
}
withGithubNotify(context: "${context}") {
withBeatsEnv(){
sh(label: "Make ${target}", script: """
Expand All @@ -541,6 +550,12 @@ def makeTarget(context, target, clean = true){
}

def mageTargetWin(context, target){
whenTrue(${params.debug}){
dumpFilteredEnvironment()
withBeatsEnvWin(){
dumpMage()
}
}
withGithubNotify(context: "${context}") {
withBeatsEnvWin(){
bat(label: "Mage ${target}", script: """
Expand Down Expand Up @@ -602,6 +617,62 @@ def withBeatsEnvWin(Closure body){
}
}

def dumpMage(){
echo "### MAGE DUMP ###"
sh(label: "Dump mage variables", script: "mage dumpVariables")
echo "### END MAGE DUMP ###"
}

def dumpFilteredEnvironment(){
echo "### ENV DUMP ###"
echo "BUILD_DIR: ${env.BUILD_DIR}"
echo "COVERAGE_DIR: ${env.COVERAGE_DIR}"
echo "BEATS: ${env.BEATS}"
echo "PROJECTS: ${env.PROJECTS}"
echo "PROJECTS_ENV: ${env.PROJECTS_ENV}"
echo "PYTHON_ENV: ${env.PYTHON_ENV}"
echo "PYTHON_EXE: ${env.PYTHON_EXE}"
echo "PYTHON_ENV_EXE: ${env.PYTHON_ENV_EXE}"
echo "VENV_PARAMS: ${env.VENV_PARAMS}"
echo "FIND: ${env.FIND}"
echo "GOLINT: ${env.GOLINT}"
echo "GOLINT_REPO: ${env.GOLINT_REPO}"
echo "REVIEWDOG: ${env.REVIEWDOG}"
echo "REVIEWDOG_OPTIONS: ${env.REVIEWDOG_OPTIONS}"
echo "REVIEWDOG_REPO: ${env.REVIEWDOG_REPO}"
echo "XPACK_SUFFIX: ${env.XPACK_SUFFIX}"
echo "PKG_BUILD_DIR: ${env.PKG_BUILD_DIR}"
echo "PKG_UPLOAD_DIR: ${env.PKG_UPLOAD_DIR}"
echo "COVERAGE_TOOL: ${env.COVERAGE_TOOL}"
echo "COVERAGE_TOOL_REPO: ${env.COVERAGE_TOOL_REPO}"
echo "TESTIFY_TOOL_REPO: ${env.TESTIFY_TOOL_REPO}"
echo "NOW: ${env.NOW}"
echo "GOBUILD_FLAGS: ${env.GOBUILD_FLAGS}"
echo "GOIMPORTS: ${env.GOIMPORTS}"
echo "GOIMPORTS_REPO: ${env.GOIMPORTS_REPO}"
echo "GOIMPORTS_LOCAL_PREFIX: ${env.GOIMPORTS_LOCAL_PREFIX}"
echo "PROCESSES: ${env.PROCESSES}"
echo "TIMEOUT: ${env.TIMEOUT}"
echo "PYTHON_TEST_FILES: ${env.PYTHON_TEST_FILES}"
echo "NOSETESTS_OPTIONS: ${env.NOSETESTS_OPTIONS}"
echo "TEST_ENVIRONMENT: ${env.TEST_ENVIRONMENT}"
echo "SYSTEM_TESTS: ${env.SYSTEM_TESTS}"
echo "STRESS_TESTS: ${env.STRESS_TESTS}"
echo "STRESS_TEST_OPTIONS: ${env.STRESS_TEST_OPTIONS}"
echo "GOX_OS: ${env.GOX_OS}"
echo "GOX_OSARCH: ${env.GOX_OSARCH}"
echo "GOX_FLAGS: ${env.GOX_FLAGS}"
echo "TESTING_ENVIRONMENT: ${env.TESTING_ENVIRONMENT}"
echo "BEAT_VERSION: ${env.BEAT_VERSION}"
echo "COMMIT_ID: ${env.COMMIT_ID}"
echo "DOCKER_COMPOSE_PROJECT_NAME: ${env.DOCKER_COMPOSE_PROJECT_NAME}"
echo "DOCKER_COMPOSE: ${env.DOCKER_COMPOSE}"
echo "DOCKER_CACHE: ${env.DOCKER_CACHE}"
echo "GOPACKAGES_COMMA_SEP: ${env.GOPACKAGES_COMMA_SEP}"
echo "PIP_INSTALL_PARAMS: ${env.PIP_INSTALL_PARAMS}"
echo "### END ENV DUMP ###"
}

def k8sTest(versions){
versions.each{ v ->
stage("k8s ${v}"){
Expand Down

0 comments on commit 5bd84ae

Please sign in to comment.