This repository was archived by the owner on Oct 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstashV2.txt
More file actions
34 lines (25 loc) · 1.33 KB
/
stashV2.txt
File metadata and controls
34 lines (25 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Stash the current location, for such it compresses the current path and
upload it to Google Storage.
The configuration can be delegated through env variables or explicitly. The
explicit parameters do have precedence over the environment variables.
```
// Given the environment variable with withEnv
withEnv(["JOB_GCS_BUCKET=my-bucket", "JOB_GCS_CREDENTIALS=my-credentials"]){
stashV2(name: 'source')
}
// Given the parameters
stashV2(name: 'source', bucket: 'my-bucket', credentialsId: 'my-credentials')
withEnv(["JOB_GCS_BUCKET=my-bucket", "JOB_GCS_CREDENTIALS=my-credentials"]){
// Even thought the env variable is set the bucket will 'foo' instead 'my-bucket'
stashV2(name: 'source', bucket: 'foo')
}
// Store the bucketUri of the just stashed folder.
def bucketUri = stashV2(name: 'source', bucket: 'my-bucket', credentialsId: 'my-credentials')
```
* *name*: Name of the tar file to be created. Mandatory
* *bucket*: name of the bucket. JOB_GCS_BUCKET env variable can be uses instead. Optional
* *credentialsId*: the credentials Id to access to the GCS Bucket. JOB_GCS_CREDENTIALS env variable can be uses instead. Optional
**NOTE**:
* `tar` binary is required in the CI Workers.
* retention policy for the bucket is delegated on the Google side.
It requires [Google Cloud Storage plugin](https://plugins.jenkins.io/google-storage-plugin/)