@@ -1216,6 +1216,42 @@ setupAPMGitEmail(global: true)
12161216
12171217* * global* : to configure the user and email account globally. Optional.
12181218
1219+ ## stashV2
1220+ Stash the current location, for such it compresses the current path and
1221+ upload it to Google Storage.
1222+
1223+ The configuration can be delegated through env variables or explicitly. The
1224+ explicit parameters do have precedence over the environment variables.
1225+
1226+ ```
1227+ // Given the environment variable with withEnv
1228+ withEnv(["JOB_GCS_BUCKET=my-bucket", "JOB_GCS_CREDENTIALS=my-credentials"]){
1229+ stashV2(name: 'source')
1230+ }
1231+
1232+ // Given the parameters
1233+ stashV2(name: 'source', bucket: 'my-bucket', credentialsId: 'my-credentials')
1234+
1235+ withEnv(["JOB_GCS_BUCKET=my-bucket", "JOB_GCS_CREDENTIALS=my-credentials"]){
1236+ // Even thought the env variable is set the bucket will 'foo' instead 'my-bucket'
1237+ stashV2(name: 'source', bucket: 'foo')
1238+ }
1239+
1240+ // Store the bucketUri of the just stashed folder.
1241+ def bucketUri = stashV2(name: 'source', bucket: 'my-bucket', credentialsId: 'my-credentials')
1242+
1243+ ```
1244+
1245+ * * name* : Name of the tar file to be created. Mandatory
1246+ * * bucket* : name of the bucket. JOB_GCS_BUCKET env variable can be uses instead. Optional
1247+ * * credentialsId* : the credentials Id to access to the GCS Bucket. JOB_GCS_CREDENTIALS env variable can be uses instead. Optional
1248+
1249+ ** NOTE** :
1250+ * ` tar ` binary is required in the CI Workers.
1251+ * retention policy for the bucket is delegated on the Google side.
1252+
1253+ It requires [ Google Cloud Storage plugin] ( https://plugins.jenkins.io/google-storage-plugin/ )
1254+
12191255## tar
12201256Compress a folder into a tar file.
12211257
@@ -1247,6 +1283,39 @@ p.setAge(50);
12471283net.sf.json.JSON obj = toJSON(p)
12481284```
12491285
1286+ ## unstashV2
1287+ Untash the given stashed id, for such it downloads the given stashed id, and
1288+ uncompresses in the current location.
1289+
1290+ The configuration can be delegated through env variables or explicitly. The
1291+ explicit parameters do have precedence over the environment variables.
1292+
1293+ ```
1294+ // Given the environment variable with withEnv
1295+ withEnv(["JOB_GCS_BUCKET=my-bucket", "JOB_GCS_CREDENTIALS=my-credentials"]){
1296+ unstashV2(name: 'source')
1297+ }
1298+
1299+ // Given the parameters
1300+ unstashV2(name: 'source', bucket: 'my-bucket', credentialsId: 'my-credentials')
1301+
1302+ withEnv(["JOB_GCS_BUCKET=my-bucket", "JOB_GCS_CREDENTIALS=my-credentials"]){
1303+ // Even thought the env variable is set the bucket will 'foo' instead 'my-bucket'
1304+ unstashV2(name: 'source', bucket: 'foo')
1305+ }
1306+
1307+ ```
1308+
1309+ * * name* : Name of the stash id to be unstashed. Mandatory
1310+ * * bucket* : name of the bucket. JOB_GCS_BUCKET env variable can be uses instead. Optional
1311+ * * credentialsId* : the credentials Id to access to the GCS Bucket. JOB_GCS_CREDENTIALS env variable can be uses instead. Optional
1312+
1313+ ** NOTE** :
1314+ * ` tar ` binary is required in the CI Workers.
1315+ * retention policy for the bucket is delegated on the Google side.
1316+
1317+ It requires [ Google Cloud Storage plugin] ( https://plugins.jenkins.io/google-storage-plugin/ )
1318+
12501319## updateGithubCommitStatus
12511320Update the commit status on GitHub with the current status of the build.
12521321
0 commit comments