This guide is used to setup a new feed hosted on Amazon S3 storage.
Create a sleet.json
config file to define a new package feed hosted on Amazon S3 storage.
sleet createconfig --s3
Edit sleet.json
using your editor of choice to set the url of your s3 bucket and access key.
notepad sleet.json
{
"sources": [
{
"name": "feed",
"type": "s3",
"path": "https://s3.amazonaws.com/my-bucket-feed/",
"profileName": "sleetProfile",
"bucketName": "my-bucket-feed",
"region": "us-west-2",
"baseURI": "https://tempuri.org/",
"feedSubPath": "a/b/c/"
}
]
}
For details on creating a credentials file go here
{
"sources": [
{
"name": "feed",
"type": "s3",
"path": "https://s3.amazonaws.com/my-bucket-feed/",
"bucketName": "my-bucket-feed",
"region": "us-east-1",
"accessKeyId": "IAM_ACCESS_KEY_ID",
"secretAccessKey": "IAM_SECRET_ACCESS_KEY",
"baseURI": "https://tempuri.org/",
"feedSubPath": "a/b/c/"
}
]
}
Now initialize the feed, this creates the basic files needed to get started. The source
value here corresponds to the name
property used in sleet.json
.
sleet init --source feed
Add packages to the feed with the push command, this can be used with either a path to a single nupkg or a folder of nupkgs.
sleet push d:\nupkgsToPush --source feed
Add the feed as a source to your NuGet.Config
file. In the example above the package source URL is https://s3.amazonaws.com/my-bucket-feed/index.json
Private feeds can be created by creating a lambda function to authenticate clients.
For help setting up S3 go here
In sleet.json set baseURI for the feed to the CloudFront address, this will write the CloudFront URI to the feed json files instead of the restricted S3 bucket which the client cannot access.