Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在jenkins文件中使用秘密环境变量_Jenkins - Fatal编程技术网

在jenkins文件中使用秘密环境变量

在jenkins文件中使用秘密环境变量,jenkins,Jenkins,您好,我想使用以下管道脚本来运行安全扫描 pipeline { agent any-with-jdk8-maven-curl-unzip stages { stage('Maven Build') { steps { - sh 'maven clean verify' } } stage('Veracode Pipeline Scan') { s

您好,我想使用以下管道脚本来运行安全扫描

pipeline {
    agent any-with-jdk8-maven-curl-unzip
    stages {
        stage('Maven Build') {
            steps {
                - sh 'maven clean verify'
        }
    }
        stage('Veracode Pipeline Scan') {
            steps {
                - sh `curl -O https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip`
                - sh `unzip pipeline-scan-LATEST.zip pipeline-scan.jar`
                - sh `java -jar pipeline-scan.jar \
                --veracode_api_id "${VERACODE_API_ID}" \
                --veracode_api_key "${VERACODE_API_SECRET}" \
                --file "build/libs/sample.jar" \
                --fail_on_severity="Very High, High" \
                --fail_on_cwe="80" \
                --baseline_file "${CI_BASELINE_PATH}" \
                --timeout "${CI_TIMEOUT}" \
                --project_name "${env.JOB_NAME}" \
                --project_url "${env.GIT_URL}" \
                --project_ref "${env.GIT_COMMIT}" \
            }
        }
    }
    post {
        always {
        archiveArtifacts artifacts: 'results.json', fingerprint: true
        }
    }
}
问题是我想把
VERACODE\u API\u ID
VERACODE\u API\u SECRET
存储为机密。我以前只加载了使用jenkins“凭据”来存储秘密值。将这些变量加载到环境中的最佳方式是什么