I have created a Jenkins job that uses a groovy script (gradle) to download a file.
stages {
stage('Import and Unzip') {
steps {
cleanWs()
checkout([$class: 'GitSCM',
branches: [[name: "$GIT_BRANCH" ]],
extensions: [[$class: 'PruneStaleBranch']],
userRemoteConfigs: [[
url: 'git@github.com/repo1.git',
]]
])
script{
bat './gradlew --build-file scripts/Jenkins/build.gradle'
}
dir('scripts/Jenkins') {
bat '../../../gradlew downloadfile'
}
}
}
}
So now when I run this job I have a file in the Jenkins workspace ...
I want to add and commit it on another github repo : git@github.com/repo2.git
Any ideas how to do it ?
Thanks in advance