Manage Assets Using s3cmd

To connect to the Servd Assets Platform using s3cmd, first ensure you have an up-to-date version installed. You can also install on macOS using brew:

brew install s3cmd

Once installed you'll need to configure s3cmd to tell it how to connect to the Servd platform:

s3cmd --configure

Access Key: [Access Key ID from the Servd dashboard]

Secret Key: [Access Key Secret from the Servd dashboard]

Default Region: eu-central-003

S3 Endpoint:

DNS-style bucket+hostname:port template: %(bucket)

Encryption password: [any random string]

Path to GPG program: [accept the default suggestion]

Use HTTPS protocol: yes

HTTP Proxy server name: [leave blank unless you know you need this]

Test access with supplied credentials?: yes

Save settings?: yes

You can now use s3cmd to explore and upload files to the Servd asset platform. Below are a few commands that you might find useful:

# List the files in your asset platform directory
s3cmd ls s3://cdn-assets-servd-host/[your-project-slug]/

# All upload and download commands can be tested by adding the --dry-run flag.
# This will display the source and destination paths that would be affected, but won't alter any files
# Once you have confirmed the paths look ok, remove the --dry-run flag and re-run the command

# Upload a file
s3cmd --dry-run put ./my-cat.jpg s3://cdn-assets-servd-host/[your-project-slug]/production/

# Delete a file
s3cmd --dry-run del s3://cdn-assets-servd-host/[your-project-slug]/production/my-cat.jpg

# Upload a folder
s3cmd --dry-run put --recursive ./cat-photos s3://cdn-assets-servd-host/[your-project-slug]/production/

# Sync a folder - this will also delete any remote files which don't exist locally
s3cmd --dry-run sync ./cat-photos s3://cdn-assets-servd-host/[your-project-slug]/production/cat-photos