Jenkins deploy on k8s
1.create user
2. Install
- Click
Dashboard->Manage Jenkins->Plugins

- Search
Publish Over SSH and install

- Click
Dashboard -> Manage Jenkins -> System, search Publish over SSH to add SSH Server

3. Creat job

- 在流水线处选择
Pipeline script, 并添加如下脚本
pipeline {
agent any
stages {
stage('Host1 implement.') {
steps {sshPublisher(publishers: [sshPublisherDesc(configName: 'SCCRhisDB', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'sh /oradata/wistron/shell/impdb_sccr-v5.sh', execTimeout: 86400000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '/')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
stage('Sendmail to admin.') {
steps {emailext attachLog: true, body: 'SCCR mouth archive implement complete.', subject: 'SCCR mouth archive job Email', to: 'eleven_pan@wistron.com,seven_qin@wistron.com'
}
}
}
}
