dev-cli icon indicating copy to clipboard operation
dev-cli copied to clipboard

Support custom prefixes in S3 key

Open cameronpickham opened this issue 7 years ago • 4 comments

I'm able to specify a bucket, but it would be nice if I could namespace it so that my bucket can be more organized.

Currently-generated location: s3://mybucket/channels/alpha/mycli-v1.0.0-alpha.1/mycli-v1.0.0-alpha.1-linux-x64.tar.gz

Desired location: s3://mybucket/mycli/channels/alpha/mycli-v1.0.0-alpha.1/mycli-v1.0.0-alpha.1-linux-x64.tar.gz

cameronpickham avatar Jan 09 '19 04:01 cameronpickham

This should be supported. Just override the baseDir in package.json

jdx avatar Jan 15 '19 05:01 jdx

I tried this and couldn't get it work. I poked around the dev-cli and config source and can't find a way to do it.

cameronpickham avatar Jan 18 '19 22:01 cameronpickham

baseDir is used only to create the manifest but not used for publish. I had to redefine the whole oclif.update.s3.templates config :

"update": {
  "s3": {
	"bucket": "devbucket",
	"templates": {
	  "target": {
		"baseDir": "my-cli/<%- bin %>",
		"unversioned": "my-cli/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-<%- platform %>-<%- arch %><%- ext %>",
		"versioned": "my-cli/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %><%- ext %>",
		"manifest": "my-cli/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- platform %>-<%- arch %>"
	  },
	  "vanilla": {
		"baseDir": "my-cli/<%- bin %>",
		"unversioned": "my-cli/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-<%- platform %>-<%- arch %><%- ext %>",
		"versioned": "my-cli/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %><%- ext %>",
		"manifest": "my-cli/<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- platform %>-<%- arch %>"
	  }
	}
  }
}

r1m avatar Aug 23 '19 14:08 r1m

Another workaround is to set the path inside S3 bucket key...

"update": {
      "s3": {
        "bucket": "devbucket/my-cli"
      }
    }

It publish files inside the folder. but generated version file is wrong.

@oclif/dev-cli/1.22.2 linux-x64 node-v10.16.3

r1m avatar Aug 23 '19 14:08 r1m