Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alan-czajkowski opened this issue Nov 22, 2016 · 2 comments
Open

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

alan-czajkowski opened this issue Nov 22, 2016 · 2 comments

Comments

@alan-czajkowski
Copy link

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:https://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?
@dmarkov
Copy link

dmarkov commented Nov 28, 2016

@yegor256 please pay attention to this issue (par.21)

@yegor256
Copy link
Member

@alan-czajkowski seems like a bug, you're right. Can you please run Maven with --errors flag and post the stacktrace here? This will help me solve the problem faster. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants