Skip to content

plugin failing when using (sub)folders in an S3 bucket #37

@alan-czajkowski

Description

@alan-czajkowski

For additional commentary, see: jcabi/jcabi#141

Consider this plugin configuration:

<configuration>
  <server>aws.amazon.com</server>
  <name>${project.artifactId}</name> <!-- value: artifact-id -->
  <bucket>${project.groupId}</bucket> <!-- value: com.example -->
  <key>${project.artifactId}/${project.version}</key> <!-- value: artifact-id/1.0.0-SNAPSHOT -->
  <template>${project.artifactId}</template>
</configuration>

So,
a) I've created an S3 bucket named after my project's group ID
b) I've created a folder in this S3 bucket named after my project's artifact ID
c) deploying fails because the plugin makes an assumption that the S3 key should also be considered as the versionLabel for deployment ... ?

Would it be possible to add a config param to the plugin to allow explicit defining of the versionLabel?

See the following error:

[INFO] S3 object 'artifact-id/1.0.0-SNAPSHOT' not found in 'com.example' bucket
[INFO] Uploading /.../artifact-id/target/artifact-id-1.0.0-SNAPSHOT.war (54 MB) to s3://com.example/artifact-id/1.0.0-SNAPSHOT... (may take a few minutes)
[INFO] Uploaded successfully to S3, etag=8dd6a3dbbf0289ec14da4b0fac03af04, expires=null, exp.rule=null, encryption=null, version=null
[INFO] Deployment took 3min
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:20.700s
[INFO] Finished at: Tue Feb 26 17:57:04 EST 2013
[INFO] Final Memory: 20M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jcabi:jcabi-beanstalk-maven-plugin:0.7.8:deploy (default) on project artifact-id: Execution default of goal com.jcabi:jcabi-beanstalk-maven-plugin:0.7.8:deploy failed: 1 validation error detected: Value 'artifact-id/1.0.0-SNAPSHOT' at 'versionLabel' failed to satisfy constraint: Member must satisfy regular expression pattern: [^/]+

Additional comments pasted from: jcabi/jcabi#141

  • some people are very picky about their version labels and assuming that the S3 key is an appropriate name for the version label is not necessarily a good assumption
  • you can make certain assumptions about values, BUT you should allow people to override your assumptions with additional config params, adding an optional versionLabel config to the plugin is the optimal solution
  • it is nice to visually see the version label being the same as the Maven artifact, it is purely for auditing reasons, and taking later action on this version label (via Amazon's API, etc.)
  • the problem is that the entire key becomes the version label, if there are multiple levels of folders in S3 (where you convert "/" to "_"), this could become problematic? ugly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions