PHPackages                             asilgag/aws-s3-incremental-deployer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. asilgag/aws-s3-incremental-deployer

ActiveLibrary[CLI &amp; Console](/categories/cli)

asilgag/aws-s3-incremental-deployer
===================================

Incremental and atomic high-performance deployments for AWS S3

v2.0.1(2y ago)09.1k↓50%MITPHPPHP &gt;=8.0.0

Since Apr 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/asilgag/aws-s3-incremental-deployer)[ Packagist](https://packagist.org/packages/asilgag/aws-s3-incremental-deployer)[ Docs](https://github.com/asilgag/aws-s3-incremental-deployer)[ RSS](/packages/asilgag-aws-s3-incremental-deployer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

aws-s3-incremental-deployer
===========================

[](#aws-s3-incremental-deployer)

Incremental and atomic high-performance deployments for AWS S3.

- incremental: using a fast diff algorithm, this package only uploads changed files based on their contents.
- atomic: even thought atomicity is not supported by AWS S3, this package performs uploads in the most optimal way to nearly achieve the same result.
- high-performance: updates to sites with 100K files are usually deployed in ~10 seconds

Why don't use `aws s3 sync --delete`?
-------------------------------------

[](#why-dont-use-aws-s3-sync---delete)

`aws s3 sync --delete` uses two metrics to decide whether to sync from source to destination:

- file size
- timestamp

This works well in most cases, but not when you are deploying a site generated by a Static Site Generator like [Gatsby](https://www.gatsbyjs.org/). Gatsby re-generates all files on each build, so `aws s3 sync --delete` will upload all files since all of them are "new".

This package, on the contrary, uses a smarter (and faster) strategy: it compares file contents to decide whether to sync it or not. Hence, if your site contains thousands of files, but only 4 of them have changed, this package updates only those 4 files.

Installation
------------

[](#installation)

```
composer require asilgag/aws-s3-incremental-deployer

```

Dependencies
------------

[](#dependencies)

This package makes intensive use of the Unix shell. The following Unix commands MUST be present so this package can work as expected:

- aws ([AWS CLI](https://aws.amazon.com/cli/))
- find
- sort
- xargs
- sha1sum

Therefore, this package does not work on non-Unix OS (Windows, etc).

ACL Permissions
---------------

[](#acl-permissions)

The user performing the deployment MUST be granted the following ACL Permissions:

- READ
- WRITE
- READ\_ACP

Incremental deploys
-------------------

[](#incremental-deploys)

Instead of using a "aws s3 sync" command to synchronize a local folder to a bucket, this package uses a different strategy.

It makes use of the Unix command `sha1sum` to get the checksums of all files from a local folder, and then it compares it with the last deployed version hosted in a bucket. Then, it detects which files are new, edited or deleted, and it handles uploading them in the most "atomic" possible way:

- first, new assets and pages
- second, updated assets and pages
- third, homepage

You should use a CDN (CloudFront, Akamai, etc) with a proper cache policy to ensure no one access a broken version of your site while it's being uploaded.

Usage
-----

[](#usage)

```
use Asilgag\Aws\S3\AwsS3IncrementalDeployer;
use Asilgag\Aws\S3\Logger\MultiLogger;

// Use any PSR-3 compatible logger
$multiLogger = new MultiLogger('/path/to/log/file', TRUE);

// Create a AwsS3IncrementalDeployer object and configure its behaviour.
$deployer = new AwsS3IncrementalDeployer($multiLogger);

// Optional. Define an array of relative paths that shouldn't be uploaded.
$deployer->setExcludedPaths(['relative/path/to/exclude/in/all/cases/*']);

// Optional. Add options to the "aws" part of the command (--region, --profile, etc)
$deployer->getAwsCli()->getAwsOptions()->add('--region eu-east-1');

// Optional. Set environment for the command.
$deployer->getAwsCli()->setEnvironment('AWS_ACCESS_KEY_ID', '***');
$deployer->getAwsCli()->setEnvironment('AWS_SECRET_ACCESS_KEY', '***');

// Execute deploy operation.
try {
   $deployer->deploy('/path/to/local/site', 'bucket-name');
}
catch (RuntimeException $e) {
   // Do some logging
}

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~283 days

Recently: every ~139 days

Total

6

Last Release

795d ago

Major Versions

v1.3.0 → v2.0.02023-09-01

PHP version history (2 changes)v1.0.0PHP &gt;=7.1.0

v2.0.0PHP &gt;=8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7623730?v=4)[Alberto Silva](/maintainers/asilgag)[@asilgag](https://github.com/asilgag)

---

Top Contributors

[![asilgag](https://avatars.githubusercontent.com/u/7623730?v=4)](https://github.com/asilgag "asilgag (17 commits)")[![davidgallego](https://avatars.githubusercontent.com/u/6673087?v=4)](https://github.com/davidgallego "davidgallego (1 commits)")[![Luigisa](https://avatars.githubusercontent.com/u/7619915?v=4)](https://github.com/Luigisa "Luigisa (1 commits)")

---

Tags

clis3aws

### Embed Badge

![Health badge](/badges/asilgag-aws-s3-incremental-deployer/health.svg)

```
[![Health](https://phpackages.com/badges/asilgag-aws-s3-incremental-deployer/health.svg)](https://phpackages.com/packages/asilgag-aws-s3-incremental-deployer)
```

###  Alternatives

[league/climate

PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.

1.9k14.0M273](/packages/league-climate)[n98/magerun2

Tools for managing Magento projects and installations

928244.3k6](/packages/n98-magerun2)[acmephp/acmephp

Let's Encrypt client written in PHP

649155.1k](/packages/acmephp-acmephp)[fidry/console

Library to create CLI applications

192.0M4](/packages/fidry-console)[php-feed-io/feed-io

PHP library built to consume and serve JSONFeed / RSS / Atom feeds

15218.4k8](/packages/php-feed-io-feed-io)[php-school/php-workshop

PHP Workshop Framework

466.3k6](/packages/php-school-php-workshop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
