Created
April 16, 2019 12:28
-
-
Save mvk/dbc88280fdba255fa3cdfdadcde25332 to your computer and use it in GitHub Desktop.
mix scripted with declarative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { | |
docker { image 'docker-registry:5000/ruby:2.5.1' } | |
} | |
stages { | |
stage('Test') { | |
steps { | |
script { | |
String target = 'bla' | |
String targetUser = 'ku' | |
sshagent (['test']) { | |
sh([ | |
label: "on current agent", | |
script: "ls -l" | |
]) | |
sh([ | |
label: "on ${target}", | |
script: "ssh -l ${targetUser} ${target} whoami" | |
]) | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment