2024-10-28 |
This repository is no longer in use at Bonitasoft. |
---|
This plugin performs upload of directory to a given drive folder
There is only the pipeline function available.
Configure as follow where
googleCredentials
contains the private key content to access the APItoCopy
is the path on the filesystem of the directory to upload on google drivedestinationFolderId
is the id of the folder to upload that directory into (e.g. a team shared drive folder)
pipeline {
agent any
stages {
stage('prepare file ') {
steps {
sh "echo 'someContent' > toUpload.txt"
}
}
stage("upload to gdrive") {
steps {
withCredentials([string(credentialsId: 'gdrive', variable: 'GDRIVE_CREDENTIALS')]) {
gdriveUpload(
googleCredentials: GDRIVE_CREDENTIALS,
source: "toUpload.txt",
destinationId: "14_Xpzuld0lGyg7HgZojwNsJsITW5jTh9",
renameTo: "uploaded.txt"
)
}
}
}
stage("move specificFile") {
steps {
withCredentials([string(credentialsId: 'gdrive', variable: 'GDRIVE_CREDENTIALS')]) {
gdriveMove(
googleCredentials: GDRIVE_CREDENTIALS,
sourceId: "123XY",
elementName: "folder to move",
destinationParentFolderId: "1234XXX",
destinationFolderName: "7.12.X",
renameTo: "moved folder"
)
}
}
}
}
}
./gradlew :gdrive-jenkins:server
to run jenkins with that plugin
./gradlew :gdrive-jenkins:jpi
to produce the plugin
The compilation uses kapt
for annotation processing along with net.java.sezpoz:sezpoz
to process @Extension
annotations
To generate a new API Key you need to go here