Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 84734aa

Browse files
committed
docs: update main readme and further configuration
1 parent 7ea9d7a commit 84734aa

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

vars/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
12201256
Compress a folder into a tar file.
12211257

@@ -1247,6 +1283,39 @@ p.setAge(50);
12471283
net.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
12511320
Update the commit status on GitHub with the current status of the build.
12521321

vars/stashV2.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def bucketUri = stashV2(name: 'source', bucket: 'my-bucket', credentialsId: 'my-
2727
* *bucket*: name of the bucket. JOB_GCS_BUCKET env variable can be uses instead. Optional
2828
* *credentialsId*: the credentials Id to access to the GCS Bucket. JOB_GCS_CREDENTIALS env variable can be uses instead. Optional
2929

30-
**NOTE**: `tar` binary is required in the CI Workers.
30+
**NOTE**:
31+
* `tar` binary is required in the CI Workers.
32+
* retention policy for the bucket is delegated on the Google side.
3133

3234
It requires [Google Cloud Storage plugin](https://plugins.jenkins.io/google-storage-plugin/)

vars/unstashV2.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ withEnv(["JOB_GCS_BUCKET=my-bucket", "JOB_GCS_CREDENTIALS=my-credentials"]){
2424
* *bucket*: name of the bucket. JOB_GCS_BUCKET env variable can be uses instead. Optional
2525
* *credentialsId*: the credentials Id to access to the GCS Bucket. JOB_GCS_CREDENTIALS env variable can be uses instead. Optional
2626

27-
**NOTE**: `tar` binary is required in the CI Workers.
27+
**NOTE**:
28+
* `tar` binary is required in the CI Workers.
29+
* retention policy for the bucket is delegated on the Google side.
2830

2931
It requires [Google Cloud Storage plugin](https://plugins.jenkins.io/google-storage-plugin/)

0 commit comments

Comments
 (0)