Run SQL as JENKINS_PIPELINE_job by SQL plus script runner plugin. Running the SQL script – As Scripted pipeline job from Jenkins file in GIT repo Note: the SQL script placed in the same location as Jenkins file
|
//Pipeline code (scripted pipe) in Jenkins file in GIT repo // node ('master') { stage('Code_checkout') { git url: 'https://github.com/mshan0181/java-sample-code.git' } stage('SQL_script_runner') { echo 'SQLPlusRunner running user define script for shandba@client_access' step([$class: 'SQLPlusRunnerBuilder',credentialsId:'shandb-priv-id', instance:'client_access',scriptType:'userDefined', script: '',scriptContent: 'select * from v$version']) step([$class: 'SQLPlusRunnerBuilder',credentialsId:'shandb-priv-id', instance:'client_access',scriptType:'userDefined', script: '',scriptContent: 'select name from v$database']) step([$class: 'SQLPlusRunnerBuilder',credentialsId:'shandb-priv-id', instance:'client_access',scriptType:'file', script: 'switchover_status.sql',scriptContent: '']) } } |
👉 Create the (above code) scripted pipeline in Jenkins… Read More