This plugin allows replacing the TeamCity built-in artifacts storage with AWS S3. The artifacts storage can be changed at the project level. After changing the storage, new artifacts produced by the builds of this project will be published to the (specified) AWS S3 bucket. Besides publishing, the plugin also implements resolving of artifact dependencies and clean-up of build artifacts.
Baseline functionality finished. Feedback wanted.
The plugin is compatible with TeamCity 2017.1 and greater
When installed and configured, the plugin:
- allows uploading artifacts to Amazon S3
- allows downloading and removing artifacts from Amazon S3
- handles resolution of artifact dependencies
- handles clean-up of artifacts
- displays artifacts located in Amazon S3 in the TeamCity web UI.
Issue the mvn package
command from the root project to build your plugin. The resulting <artifactId>.zip package will be placed in the 'target' directory.
Download | Compatibility |
---|---|
Download | 2017.1.1 |
See instructions in TeamCity documentation.
The plugin adds the Artifacts Storage tab to the Project Settings page in the TeamCity Web UI. The tab lists the built-in TeamCity artifacts storage displayed by default and marked as active.
To configure Amazon S3 storage for TeamCity artifacts, perform the following:
- Select S3 Storage as the storage type.
- Provide an optional name for your storage.
- Select an AWS region.
- Provide your AWS Security Credentials.
- Specify an existing S3 bucket to store artifacts.
- Save your settings.
- The configured S3 storage will appear on the Artifacts storage page. Make it active using the corresponding link.
Now the artifacts of this project, its subprojects, and build configurations will be stored in the configured storage.
Bad Request (400) from S3 when downloading artifact from TeamCity in "ant get" task using basic http auth scheme (httpAuth prefix in URL)
Error message returned from AWS: Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified
Workaround: use pure 'curl -L'
Failed to resolve artifact dependency X: Failed to download file 'X': Failed to download https://teamcity/X.tar]: Illegal status [403] while downloading https://s3.X.amazonaws.com/bucket/X?...: Forbidden (jetbrains.buildServer.artifacts.impl.SourcePathAwareResolvingFailedException)
This can occur if the build agent is not able to fetch the artifact from the presigned URL generated by TeamCity within the time limit which is default 60s.
This value can be modified by setting a internal TeamCity server property storage.s3.url.expiration.time.seconds
.