PHP code example of jtmcc / atomic-deployments

1. Go to this page and download the library: Download jtmcc/atomic-deployments library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jtmcc / atomic-deployments example snippets


return [

    /**
     * Symbolic link to the current deployed build
     * This path will be used for schedules and setting your web root.
     */
    'deployment-link' => env('ATM_DEPLOYMENT_LINK'),

    /**
     * The primary build folder
     * This folder is where all deployments ran and ultimately copied to a deployment directory.
     */
    'build-path' => env('ATM_BUILD'),

    /**
     * Production build directory
     * Builds are copied here and linked for deployment
     * Ensure this directory has the  Deployment class used.
     *
     * Add custom deployments by implementing @see \JTMcC\AtomicDeployments\Interfaces\DeploymentInterface
     * and adding your class to this config property
     */
    'deployment-class' => \JTMcC\AtomicDeployments\Services\Deployment::class,

    /**
     * Migrate files|folders from the outgoing production build to your new release using a relative path and pattern.
     *
     * @see https://www.php.net/manual/en/function.glob.php
     */
    'migrate' => [
        //        'storage/framework/sessions/*',
    ],

];
shell script

composer 
php artisan vendor:publish --tag=atm-config

shell script
# nginx example
root /var/www/production-site/public;

#crontab logic example
php /var/www/production-site/artisan schedule:run
shell script
php artisan atomic-deployments:deploy --dry-run
shell script
php artisan atomic-deployments:deploy
shell script
php artisan atomic-deployments:deploy --directory=deployment_folder
shell script
php artisan atomic-deployments:deploy ---hash=abc1234
shell script
php artisan atomic-deployments:list
shell script
cd /home/forge/your-application.com
git pull origin main
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader --no-dev --no-progress

( flock -w 10 9 || exit 1
    echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock

if [ -f artisan ]; then
    $FORGE_PHP artisan migrate --force
    $FORGE_PHP artisan optimize:clear
    $FORGE_PHP artisan atomic-deployments:deploy
fi