-
Notifications
You must be signed in to change notification settings - Fork 33
/
Jenkinsfile
30 lines (27 loc) · 1.02 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pipeline {
agent any
stages {
stage('Daily Compliance Run') {
steps{
echo 'Running a compliance scan with inspec....'
script{
def remote = [:]
remote.name = "controlnode"
remote.host = "xxx.xxx.xxx.xxx"
remote.allowAnyHosts = true
withCredentials([sshUserPrivateKey(credentialsId: 'sshUser', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
remote.user = userName
remote.identityFile = identity
stage("Placeholder Stage...") {
sshCommand remote: remote, sudo: true, command: 'echo "add your stuff here....."'
sshCommand remote: remote, sudo: true, command: 'echo "some more stuff goes here....."'
}
stage("Scan with InSpec") {
sshCommand remote: remote, sudo: true, command: 'inspec exec /root/linux-baseline/'
}
}
}
}
}
}
}