Gist for https://youtu.be/0GQZzLlnUws
pipeline {
agent none
stages {
stage('Hello') {
agent { label 'linux' }
steps {
sh '''
touch file.txt
mkdir -p target
touch target/file2.jar
touch target/file3.war
tree
'''
stash(name: 'myStash')
}
}
stage('check the file') {
agent { label 'macos' }
steps {
unstash 'myStash'
sh 'tree'
}
}
}
}
pipeline {
agent none
stages {
stage('Hello') {
agent { label 'linux' }
steps {
sh '''
touch file.txt
mkdir -p target
touch target/file2.jar
touch target/file3.war
tree
'''
stash(name: 'myStash', includes: '**/*.war')
}
}
stage('check the file') {
agent { label 'macos' }
steps {
unstash 'myStash'
sh 'tree'
}
}
}
}
pipeline {
agent none
stages {
stage('Hello') {
agent { label 'linux' }
steps {
sh '''
touch file.txt
mkdir -p target
touch target/file2.jar
touch target/file3.war
tree
'''
stash(name: 'myStash', excludes: '**/*.war')
}
}
stage('check the file') {
agent { label 'macos' }
steps {
unstash 'myStash'
sh 'tree'
}
}
}
}