logoStacktape docs


bucket:sync

Overview and basic usage

Synchronizes the contents of a specified directory to the specified bucket.


You have 2 options to sync the bucket:

  • using stacktape configuration, you must supply both stage and resourceName. Bucket id is then determined from the deployed stack and directory to sync from stacktape configuration file.
  • When syncing using bucket id, you must specify valid bucketId (AWS physical resource id, or "name" of the bucket) and sourcePath. Specified directory is then synced to the specified bucket. If the bucket is deployed using Stacktape, you can get bucketId using stack:info command.
  • Existing files that are not present in the source will be removed from the bucket.

Copy

stacktape bucket:sync --region <<region>>

API reference

Options

region (--r)
Required

AWS region to use for the current operation.

Type: string ENUM

Possible values: af-south-1ap-east-1ap-northeast-1ap-northeast-2ap-northeast-3ap-south-1ap-southeast-1ap-southeast-2ca-central-1eu-central-1eu-north-1eu-south-1eu-west-1eu-west-2eu-west-3me-south-1sa-east-1us-east-1us-east-2us-west-1us-west-2

stage (--s)
Required

Stage used for the operation.

Type: string

  • Example stages are production, staging, 'testing' or 'dev-john'.
  • You can configure the default stage used with every Stacktape command using the defaults:configure command.
  • Maximum allowed length is 12 characters.
bucketId (--bi)

Identifier (AWS physical resource id, or "name") of the destination bucket.

Type: string

configPath (--cp)

Path to your stacktape configuration file.

Type: string

  • Relative to CWD (current working directory).
headersPreset (--hp)

Configures HTTP headers of uploaded files to be optimized for selected preset

Type: string ENUM

Possible values: gatsby-static-websitesingle-page-appstatic-website

Available presets:

  • static-website:
    • sets cache-control header value for all uploaded files to public, max-age=0, s-maxage=31536000, must-revalidate.
    • this setup caches all the content on the CDN but never caches files in the browser.
  • gatsby-static-website:
  • single-page-app:
    • optimized for a Single page application
    • index.html is never cached (so that when you re-deploy your website, your users always get the latest content)
    • All other assets (.js, .css, etc.) are cached indefinitely. You should ALWAYS add a content hash to the filename, so that your users always get a new version of your website after you deploy it. To learn how to add a content hash to your files, refer to the docs of your bundler, for example webpack docs.
invalidateCdnCache (--icc)

Invalidates cache of the CDN connected to the bucket

Type: boolean

logFormat (--lf)

Format of logs printed to your console.

Type: string ENUM

Possible values: basicfancyjsonnormal

Available options:

  • fancy: Logs are colorized and dynamically re-rendered.
  • normal: Logs are colorized but not dynamically re-rendered.
  • basic: Simple text only
  • json: Logs are printed as JSON objects
logLevel (--ll)

Level of logs that are being printed to the console.

Type: string ENUM

Possible values: debugerrorinfo

Available options:

  • info: Prints basic information about everything that's happening.
  • error: Prints only errors.
  • debug: Prints detailed information about everything that's happening.
profile (--p)

AWS profile to use with the command

Type: string

  • You can manage AWS profiles on your system using aws-profile:create, aws-profile:update or aws-profile:delete command.
  • You can configure the default profile used with every Stacktape command using the defaults:configure command.
resourceName (--rn)

No description

Type: string

sourcePath (--sp)

Path to the directory to synchronize to the bucket

Type: string

  • Can be absolute, or relative to the current working directory.
Need help? Ask a question on SlackDiscord or info@stacktape.com.