PHPackages                             onedesign/atomic-deploy - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. onedesign/atomic-deploy

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

onedesign/atomic-deploy
=======================

A script to easily handle atomic deployments in a Linux environment.

1.3.0(6mo ago)101.6k2[2 PRs](https://github.com/onedesign/atomic-deployments/pulls)UnlicensePHP

Since Aug 6Pushed 5mo ago9 watchersCompare

[ Source](https://github.com/onedesign/atomic-deployments)[ Packagist](https://packagist.org/packages/onedesign/atomic-deploy)[ RSS](/packages/onedesign-atomic-deploy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (10)Used By (0)

Atomic Deployments
==================

[](#atomic-deployments)

This project is based on the concepts presented in [Buddy Atomic Deployments](https://buddy.works/blog/introducing-atomic-deployments). It provides functionality to handle shared files and directories across deployments. While this was built for use with Buddy, it will work in any standard \*nix environment.

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

[](#dependencies)

- PHP 5.5+
- curl

File Structure
--------------

[](#file-structure)

- `deploy-cache/` - the location where all files are uploaded to the server
- `revisions/` - a directory containing all revisions
- `current` - a symbolic link to the current revision
- `shared/` - a directory containing files that should be shared across all deploys

Usage
-----

[](#usage)

```
curl -sS https://raw.githubusercontent.com/onedesign/atomic-deployments/master/atomic-deploy.php | php -- --revision=$(date "+%F-%H-%M-%S")
```

### Buddy + Craft 2 Example

[](#buddy--craft-2-example)

Add the following in the "SSH Commands" section after your file upload action in your pipeline:

```
curl -sS https://raw.githubusercontent.com/onedesign/atomic-deployments/master/atomic-deploy.php | php -- --revision=${execution.to_revision.revision} --symlinks='{"shared/config/.env.php":".env.php","shared/storage":"craft/storage"}'

```

### Options

[](#options)

- `--revision` (**required**) accepts a string ID for this revision
- `--deploy-dir` accepts a base directory for deployments (default: current working directory)
- `--deploy-cache-dir` accepts a target cache directory (default: `deploy-cache` within deploy-dir)
- `--revisions-to-keep` number of old revisions to keep in addition to the current revision (default: `20`)
- `--symlinks` a JSON hash of symbolic links to be created in the revision directory (default: `{}`)
- `--help` prints help and usage instructions
- `--ansi` forces ANSI color output
- `--no-ansi` disables ANSI color output
- `--quiet` supresses unimportant messages
- `--protect` Password protect sites at .oneis.us (default: `true`)

#### Symlinks

[](#symlinks)

Symlinks are specified as `{"target":"linkname"}` and use the native `ln` utility to create links.

- `target` is relative to the `--deploy-dir` path
- `linkname` is relative to the revision path

For example, specifying this option:

```
--symlinks='{"shared/config/.env.php":".env.php","shared/logs":"logs"}'

```

will create symlinks the same way as:

```
ln -s /shared/config/.env.php revisions//.env.php
ln -s /shared/logs revisions//logs

```

**Note:** Files and directories that exist where the symlinks are being created will be overwritten. For example, using the above example, this is actually what is happening:

```
rm -rf revisions//.env.php \
  && ln -sfn /shared/config/.env.php revisions//.env.php
rm -rf revisions//logs \
  && ln -sfn /shared/logs revisions//logs

```

Password Protection
-------------------

[](#password-protection)

By default, the deployment will password protect any site that is served from a \*.oneis.us domain name. This works by prepending the contents of the `templates/htaccess-auth.txt` file to any existing `.htaccess` file found in the `current/web` directory. If an `.htaccess` file does not exist within that directory, one will be generated using the `templates/htaccess.txt` file.

Testing
-------

[](#testing)

```
cd ./test
php ../bin/deploy \
  --deploy-cache-dir="./deploy-cache" \
  --revision="123456" \
  --symlinks='{"shared/config/env":".env","shared/storage":"storage"}'
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance69

Regular maintenance activity

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.8% 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 ~519 days

Total

4

Last Release

186d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99e41003ff905aa96723ebc124836b6fa5664823d554c10bfa27149d45f95768?d=identicon)[onedesign](/maintainers/onedesign)

---

Top Contributors

[![brianjhanson](https://avatars.githubusercontent.com/u/1843073?v=4)](https://github.com/brianjhanson "brianjhanson (10 commits)")[![mkornatz](https://avatars.githubusercontent.com/u/1489817?v=4)](https://github.com/mkornatz "mkornatz (5 commits)")[![MikeMcChillin](https://avatars.githubusercontent.com/u/872219?v=4)](https://github.com/MikeMcChillin "MikeMcChillin (2 commits)")

### Embed Badge

![Health badge](/badges/onedesign-atomic-deploy/health.svg)

```
[![Health](https://phpackages.com/badges/onedesign-atomic-deploy/health.svg)](https://phpackages.com/packages/onedesign-atomic-deploy)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

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