SQL
This commit is contained in:
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@@ -1,19 +1,7 @@
|
|||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
options {
|
|
||||||
skipStagesAfterUnstable()
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage('Build') {
|
|
||||||
steps {
|
|
||||||
node {
|
|
||||||
import groovy.sql.Sql
|
import groovy.sql.Sql
|
||||||
|
node{
|
||||||
Class.forName("com.mysql.jdbc.Driver")
|
Class.forName("com.mysql.jdbc.Driver")
|
||||||
def sql = Sql.newInstance("jdbc:mysql://mysql:3306/test_db", "user","passwd", "com.mysql.jdbc.Driver")
|
def sql = Sql.newInstance("jdbc:mysql://mysql:3306/test_db", "user","passwd", "com.mysql.jdbc.Driver")
|
||||||
def rows = sql.execute "select count(*) from test_table;"
|
def rows = sql.execute "select count(*) from test_table;"
|
||||||
echo rows.dump()
|
echo rows.dump()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user