PHPackages                             mohdishrat/autodeployment - 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. mohdishrat/autodeployment

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

mohdishrat/autodeployment
=========================

1.0.19(1y ago)040PHP

Since Oct 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ishrat03/autodeployment)[ Packagist](https://packagist.org/packages/mohdishrat/autodeployment)[ RSS](/packages/mohdishrat-autodeployment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (18)Used By (0)

Autodeployment Package
======================

[](#autodeployment-package)

📜 Overview
----------

[](#-overview)

This Laravel package `mohdishrat/autodeployment` provides a simplified solution to automatically deploy code through predefined routes and logic. It includes:

- Routes for managing deployment tasks
- A controller to handle logic
- Models and migrations to store deployment data
- A view to show records of the deployments.
- Use Ansible playbooks to deploy laravel projects
- Use git webhook to trigger deployment.

🚀 Features
----------

[](#-features)

- Automatic deployment routes
- Integrated controller and model for smooth handling
- Migration and view for easy data management
- Laravel compatibility

---

⚙️ Project Installation
-----------------------

[](#️-project-installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require mohdishrat/autodeployment
```

### Step 2: Update Provider

[](#step-2-update-provider)

```
Open bootstrap/providers.php
    add  Mohdishrat\Autodeployment\Providers\AutoDeploymentProvider::class in bootstrap/providers.php
If bootstrap/provider.php is not present in project then
    add Mohdishrat\Autodeployment\Providers\AutoDeploymentProvider::class in config/app.php under providers key

```

### Step 3: Update Composer.json

[](#step-3-update-composerjson)

```
Open project composer.json
add "Mohdishrat\\Autodeployment\\ComposerScripts::createPlaybooksDirectory" under scripts.post-autoload-dump key
    It will create necessary playbooks to start deployment

```

### Step 4: Setup .env

[](#step-4-setup-env)

```
These are the supported .env variables for deployment
    dv = default value
    PRODUCTION .env variables
        PROD_AUTODEPLOY_DEFAULT_BRANCH  // [dv = master] Default branch name for deployment.[take pull for this branch]
        PROD_DEPLOYMENT_PASSWORD  // Password to start deployment (password should be hashed with laravel Hash::make())
        PROD_AUTO_DEPLOY  // [dv = false] [true, false] true if set for start deployment when PR merge and false when need human interaction for deployment.
        SSH_KEY_PATH    // full path of ssh_key which will be used to pull the key. Please make sure ssh_key don't have passphrase.
        PROD_AUTODEPLOY_AUTH  // [dv = true][true, false] true when need authentication to open deployment page and false for no authentication required for deployment pages.
        PROD_SONARQUBE_SCAN_BRANCH  // if added sonar scan in project

        // Mandatory .env_variables to send email
        MAIL_MAILER
        MAIL_HOST
        MAIL_PORT
        MAIL_USERNAME
        MAIL_PASSWORD
        MAIL_ENCRYPTION
        MAIL_FROM_ADDRESS
        MAIL_FROM_NAME
        MAIL_TO

    DEVELOPMENT .env variables
        DEV_AUTODEPLOY_DEFAULT_BRANCH
        DEV_DEPLOYMENT_PASSWORD
        DEV_AUTO_DEPLOY
        SSH_KEY_PATH
        DEV_AUTODEPLOY_AUTH
        DEV_SONARQUBE_SCAN_BRANCH

        // Mandatory .env_variables to send email
        MAIL_MAILER
        MAIL_HOST
        MAIL_PORT
        MAIL_USERNAME
        MAIL_PASSWORD
        MAIL_ENCRYPTION
        MAIL_FROM_ADDRESS
        MAIL_FROM_NAME
        MAIL_TO

```

### Step 5: Run Artisan command and Composer Autoload

[](#step-5-run-artisan-command-and-composer-autoload)

```
run command
    composer dump-autoload
    php artisan optimize:clear

this will load .env values and create necessary playbooks

```

### Step 6: Update .gitignore

[](#step-6-update-gitignore)

```
add playbooks/*   // it will ignore the playbooks in git.

```

⚙️ Server Installation
----------------------

[](#️-server-installation)

### Step 1: Install Ansible Playbook

[](#step-1-install-ansible-playbook)

```
Linux
    $ sudo apt update
    $ sudo apt install software-properties-common
    $ sudo add-apt-repository --yes --update ppa:ansible/ansible
    $ sudo apt install ansible

For Other OS installation please follow the documentation
    https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html

```

### Step 2: Install supervisor

[](#step-2-install-supervisor)

```
Linux
    $ sudo apt update
    $ sudo apt install supervisor

Add config to run playbooks
    goto /etc/supervisor/conf.d
        nano cicd.conf
            past below lines [before save update projectpath]

            [program:cicd]
            process_name=%(program_name)s_%(process_num)02d
            command=php app/to/projectpath/artisan queue:work --queue=cicd --timeout=6000 --max-jobs=2
            autostart=true
            autorestart=true
            user=root
            numprocs=1
            redirect_stderr=true
            stdout_logfile=/var/log/supervisor/laravel-queue.log

Load config file
    $ sudo supervisorctl update

```

⚙️ Git Setup
------------

[](#️-git-setup)

Step 1: Add Webhook
-------------------

[](#step-1-add-webhook)

```
Add webhook to send webhook notification for Pull Request create or merge.
    URL: domain/deploymentwebhook
    METHOD: POST

Webhook Setting
    enable Pull request Setting
        Pull request Created  // this will be used for sonar qube scan
        Pull request Merged   // this will be used for deployment

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance40

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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 ~4 days

Recently: every ~10 days

Total

17

Last Release

500d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/399577c2662f08b38fa773682e95231bbf6ec9f254d1144f01f323c554171c6c?d=identicon)[ishrat03](/maintainers/ishrat03)

### Embed Badge

![Health badge](/badges/mohdishrat-autodeployment/health.svg)

```
[![Health](https://phpackages.com/badges/mohdishrat-autodeployment/health.svg)](https://phpackages.com/packages/mohdishrat-autodeployment)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M206](/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)
