Buildstash Upload Step
This step uploads build artifacts to the Buildstash web service.
Required Parameters
- API Key: Your Buildstash API key for authentication
- Primary File Path: Path to the file you want to upload (relative to workspace)
- Major Version: Major version component (e.g., "1")
- Minor Version: Minor version component (e.g., "0")
- Patch Version: Patch version component (e.g., "0")
- Platform: Target platform (e.g., "ios", "android")
- Stream: Build stream (e.g., "development", "production")
Optional Parameters
- Structure: Upload structure type ("file" or "file+expansion")
- Expansion File Path: Path to expansion file (required if structure is "file+expansion")
- Extra Version: Extra version component (e.g., "beta")
- Meta Version: Meta version component (e.g., "build.123")
- Custom Build Number: Custom build number
- Labels: Labels for the build (comma-seperated)
- Architectures: Supported architectures (comma-seperated)
- Notes: Additional notes about the build
CI/CD Parameters
- CI Pipeline: Name of the CI pipeline (automatically set to the project/job name)
- CI Run ID: CI run identifier (automatically set to build number)
- CI Run URL: URL to the CI run (automatically set to build URL)
- CI Build Duration: Build duration (automatically set to actual build duration in HH:mm:ss format)
Note: CI/CD parameters are automatically populated from Jenkins context and cannot be manually set in pipeline steps.
Version Control Parameters
- VC Host Type: Version control host type (default: "git")
- VC Host: Version control host (default: "github")
- VC Repo Name: Repository name
- VC Repo URL: Repository URL
- VC Branch: Branch name
- VC Commit SHA: Commit SHA
- VC Commit URL: Commit URL
Dynamic Values with Environment Variables
All fields support dynamic values using environment variables. In pipeline scripts, you can use Groovy variables directly or string expansion.
Examples:
- Direct variable:
platform: env.PLATFORM
- String expansion:
platform: '${PLATFORM}'
- File path:
primaryFilePath: "${env.WORKSPACE}/build/app.ipa"
This works for all fields including file paths, version components, platform, stream, labels, architectures, and SCM fields.
Example Usage
// Using environment variables
buildstash(
apiKey: 'your-api-key',
structure: 'file',
primaryFilePath: "${env.WORKSPACE}/build/app.ipa",
versionComponent1Major: '1',
versionComponent2Minor: '0',
versionComponent3Patch: '0',
platform: env.PLATFORM, // Using environment variable
stream: env.STREAM // Using environment variable
)
// Or with string expansion
buildstash(
apiKey: 'your-api-key',
primaryFilePath: '${WORKSPACE}/build/app.ipa',
versionComponent1Major: '1',
versionComponent2Minor: '0',
versionComponent3Patch: '0',
platform: '${PLATFORM}', // String expansion
stream: '${STREAM}' // String expansion
)
For more information, visit the Buildstash Documentation.