jx step stash

list of jx commands

jx step stash

Stashes local files generated as part of a pipeline into long term storage

Synopsis

This pipeline step stashes the specified files from the build into some stable storage location.

Currently Jenkins X supports storing files into a branch of a git repository or in cloud blob storage like S3, GCS, Azure blobs etc.

When using Cloud Storage we use URLs like ‘s3://nameOfBucket’ on AWS, ‘gs://anotherBucket’ on GCP or on Azure ‘azblob://thatBucket’

See Also:

Examples

  # lets collect some files to the team's default storage location (which if not configured uses the current git repository's gh-pages branch)
  jx step stash -c tests -p "target/test-reports/*"
  
  # lets collect some files to a specific Git URL for a repository
  jx step stash -c tests -p "target/test-reports/*" --git-url https://github.com/myuser/myrepo.git
  
  # lets collect some files with the file names relative to the 'target/test-reports' folder and store in a Git URL
  jx step stash -c tests -p "target/test-reports/*" --basedir target/test-reports --git-url https://github.com/myuser/myrepo.git
  
  # lets collect some files to a specific AWS cloud storage bucket
  jx step stash -c coverage -p "build/coverage/*" --bucket-url s3://my-aws-bucket
  
  # lets collect some files to a specific cloud storage bucket
  jx step stash -c tests -p "target/test-reports/*" --bucket-url gs://my-gcp-bucket
  
  # lets collect some files to a specific cloud storage bucket and specify the path to store them inside
  jx step stash -c tests -p "target/test-reports/*" --bucket-url gs://my-gcp-bucket --to-path tests/mystuff

Options

      --basedir string           The base directory to use to create relative output file names. e.g. if you specify '--pattern "target/*.xml" then you may want to supply '--basedir target' to strip the 'target/' prefix from all collected files
      --bucket-url string        Specify the cloud storage bucket URL to send each file to. e.g. use 's3://nameOfBucket' on AWS, gs://anotherBucket' on GCP or on Azure 'azblob://thatBucket'
  -c, --classifier string        A name which classifies this type of file. Example values: coverage, tests, logs, reports
      --dir string               The source directory to try detect the current git repository or branch. Defaults to using the current directory
      --git-branch string        The branch to use to store files in the git repository (default "gh-pages")
      --git-url string           Specify the Git URL to of the repository to use for storage
  -h, --help                     help for stash
  -p, --pattern stringArray      Specify the pattern to use to look for files
      --project-branch string    The project git branch of the project to collect for. Used to default the branch folder in the storage. If not specified its discovered from the local '.git' folder
      --project-git-url string   The project git URL to collect for. Used to default the organisation and repository folders in the storage. If not specified its discovered from the local '.git' folder
  -t, --to-path string           The path within the storage to store the files. If not specified it defaults to 'jenkins-x/$category/$owner/$repoName/$branch/$buildNumber'

Options inherited from parent commands

  -b, --batch-mode   Runs in batch mode without prompting for user input (default true)
      --verbose      Enables verbose output

SEE ALSO

Auto generated by spf13/cobra on 22-Feb-2020

Last modified February 24, 2020: release 0.0.1496 (3079c6a)