-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jdstamp/dev-oscar-pipeline
example for ssh pipeline steps executed on oscar
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# ccmb-workflow | ||
Collection of scripts for workflow automation. | ||
|
||
## Workflow on oscar | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "From the shell script:" | ||
echo "Hello!" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!groovy | ||
|
||
node { | ||
checkout scm | ||
withCredentials( | ||
[ | ||
usernamePassword( | ||
credentialsId: 'brown-account', | ||
passwordVariable: 'PASSWORD', | ||
usernameVariable: 'USER') | ||
] | ||
) { | ||
def remote = [ | ||
name: 'oscar', | ||
host: 'ssh.ccv.brown.edu', | ||
user: USER, | ||
password: PASSWORD, | ||
allowAnyHosts: true | ||
] | ||
stage('Transfer a file to oscar') { | ||
writeFile file: 'hello.txt', text: 'Hello oscar!' | ||
sshPut remote: remote, from: 'hello.txt', into: '.' | ||
} | ||
stage('Run a command on oscar') { | ||
sshCommand remote: remote, command: "ls -lrt" | ||
sshCommand remote: remote, command: "for i in {1..5}; do echo -n \"Loop \$i \"; date > hello.txt; sleep 1; done" | ||
} | ||
stage('Run a shell script on oscar') { | ||
sshScript remote: remote, script: "oscar-job.sh" | ||
} | ||
stage('Fetch a file from oscar') { | ||
sshGet remote: remote, from: 'hello.txt', into: 'hello.txt', override: true | ||
sh 'cat hello.txt' | ||
} | ||
stage('Remove a file from oscar') { | ||
sshRemove remote: remote, path: "hello.txt" | ||
sshCommand remote: remote, command: "ls -lrt" | ||
} | ||
} | ||
} |