Deployment Directories

Amezmo maintains 2 root directories inside your instance to implement atomic deployments. Throughout this documentation, we refer to the "current release directory" as the directory that was created as a result of a succesfull deployment.

Directories

The timestamp variable is in the form of YYYY-MM-DDTHH:MM:SS.mmmmmm, and the commit ID is short form version of the SHA1 Git commit hash.

    
/webroot
    |----logs
    |----storage
    |----current -> /webroot/release/${TIMESTAMP}.${COMMIT_ID}
    |----release
    |-------${TIMESTAMP}.${COMMIT_ID}
    |-------${TIMESTAMP}.${COMMIT_ID}
    

Successful deployments

All of the following conditions must be met for a deployment to be considered succesful

  • The git repository and branch exists and is visible from Amezmo
  • No non-zero exit status codes from any of your hooks

Amezmo creates a new directory under /webroot/release. The directory created is effectively the result of running git pull at the time the deployment was executed. If your deployment succeeds, Amezmo updates the /webroot/current symbolic link to point to the new deployment directory that was created.

    
        /webroot/release/${TIMESTAMP}.${COMMIT_ID}
    

As a final step in the deployment process, the symbolic link located at /webroot/current is atomically updated to point the new release directory.

As part of the deployment process, Amezmo will run a chmod across your target deployment directory. This ensures that any files created from your hooks will have correct and expected permissions. Amezmo ensures the owner/group is www-data:deployer. This allows for expected permissions across all areas of your application.

Failed deployments

For a deployment to enter the Failed state, any of the following conditions must be met:

  • Amezmo cannot validate the git repository or branch.
  • Any hook, except for before.pull, exits with a non-zero status.

When a deployment step fails, the process will be aborted. This means that your current release will not be affected by a failed deployment, as Amezmo only updates your symbolic link as a final step in the process.

Need support?

We're always happy to help with either application or infrastructure questions Always feel free to reach out to us on Twitter, or contact support.

Subscribe