Showing preview only (970K chars total). Download the full file or copy to clipboard to get everything.
Repository: ngmy/webloyer
Branch: master
Commit: 0bf9f867ab4c
Files: 341
Total size: 879.7 KB
Directory structure:
gitextract_lvb56yoq/
├── .coveralls.yml
├── .gitattributes
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── SCREENSHOTS.md
├── WEBAPIS.md
├── WEBHOOKS.md
├── app/
│ ├── Console/
│ │ ├── Commands/
│ │ │ ├── Inspire.php
│ │ │ └── Webloyer/
│ │ │ ├── DiscardOldDeployments.php
│ │ │ └── Install.php
│ │ └── Kernel.php
│ ├── Entities/
│ │ ├── ProjectAttribute/
│ │ │ └── ProjectAttributeEntity.php
│ │ └── Setting/
│ │ ├── AbstractSettingEntity.php
│ │ ├── AppSettingEntity.php
│ │ ├── DbSettingEntity.php
│ │ └── MailSettingEntity.php
│ ├── Events/
│ │ └── Event.php
│ ├── Exceptions/
│ │ └── Handler.php
│ ├── Http/
│ │ ├── Controllers/
│ │ │ ├── Auth/
│ │ │ │ ├── AuthController.php
│ │ │ │ └── PasswordController.php
│ │ │ ├── Controller.php
│ │ │ ├── DeploymentsController.php
│ │ │ ├── HomeController.php
│ │ │ ├── ProjectsController.php
│ │ │ ├── RecipesController.php
│ │ │ ├── ServersController.php
│ │ │ ├── SettingsController.php
│ │ │ ├── UsersController.php
│ │ │ ├── Webhook/
│ │ │ │ └── Github/
│ │ │ │ └── V1/
│ │ │ │ └── DeploymentsController.php
│ │ │ └── WelcomeController.php
│ │ ├── Kernel.php
│ │ ├── Middleware/
│ │ │ ├── ApplySettings.php
│ │ │ ├── Authenticate.php
│ │ │ ├── RedirectIfAuthenticated.php
│ │ │ ├── VerifyCsrfToken.php
│ │ │ └── VerifyGithubWebhookSecret.php
│ │ ├── Requests/
│ │ │ └── Request.php
│ │ ├── breadcrumbs.php
│ │ └── routes.php
│ ├── Jobs/
│ │ ├── Deploy.php
│ │ ├── Job.php
│ │ └── Rollback.php
│ ├── Listeners/
│ │ └── .gitkeep
│ ├── Models/
│ │ ├── BaseModel.php
│ │ ├── Deployment.php
│ │ ├── DeploymentPresenter.php
│ │ ├── MaxDeployment.php
│ │ ├── Project.php
│ │ ├── Recipe.php
│ │ ├── Server.php
│ │ ├── Setting.php
│ │ └── User.php
│ ├── Policies/
│ │ └── .gitkeep
│ ├── Providers/
│ │ ├── AppServiceProvider.php
│ │ ├── AuthServiceProvider.php
│ │ ├── EventServiceProvider.php
│ │ ├── RepositoryServiceProvider.php
│ │ └── RouteServiceProvider.php
│ ├── Repositories/
│ │ ├── AbstractConfigRepository.php
│ │ ├── AbstractEloquentRepository.php
│ │ ├── Project/
│ │ │ ├── EloquentProject.php
│ │ │ └── ProjectInterface.php
│ │ ├── Recipe/
│ │ │ ├── EloquentRecipe.php
│ │ │ └── RecipeInterface.php
│ │ ├── RepositoryInterface.php
│ │ ├── Role/
│ │ │ ├── EloquentRole.php
│ │ │ └── RoleInterface.php
│ │ ├── Server/
│ │ │ ├── EloquentServer.php
│ │ │ └── ServerInterface.php
│ │ ├── Setting/
│ │ │ ├── AppSettingInterface.php
│ │ │ ├── ConfigAppSetting.php
│ │ │ ├── ConfigDbSetting.php
│ │ │ ├── ConfigMailSetting.php
│ │ │ ├── DbSettingInterface.php
│ │ │ ├── EloquentSetting.php
│ │ │ ├── MailSettingInterface.php
│ │ │ └── SettingInterface.php
│ │ └── User/
│ │ ├── EloquentUser.php
│ │ └── UserInterface.php
│ ├── Services/
│ │ ├── Api/
│ │ │ ├── JsonRpc.php
│ │ │ └── Middleware/
│ │ │ └── Authenticate.php
│ │ ├── Config/
│ │ │ ├── ConfigReaderInterface.php
│ │ │ ├── ConfigWriterInterface.php
│ │ │ ├── DotenvReader.php
│ │ │ └── DotenvWriter.php
│ │ ├── Deployment/
│ │ │ ├── DeployCommanderInterface.php
│ │ │ ├── DeployerDeploymentFileBuilder.php
│ │ │ ├── DeployerFile.php
│ │ │ ├── DeployerFileBuilderInterface.php
│ │ │ ├── DeployerFileDirector.php
│ │ │ ├── DeployerRecipeFileBuilder.php
│ │ │ ├── DeployerServerListFileBuilder.php
│ │ │ ├── QueueDeployCommander.php
│ │ │ └── StorageDeployCommander.php
│ │ ├── Filesystem/
│ │ │ ├── FilesystemInterface.php
│ │ │ └── LaravelFilesystem.php
│ │ ├── Form/
│ │ │ ├── Deployment/
│ │ │ │ ├── DeploymentForm.php
│ │ │ │ └── DeploymentFormLaravelValidator.php
│ │ │ ├── Project/
│ │ │ │ ├── ProjectForm.php
│ │ │ │ └── ProjectFormLaravelValidator.php
│ │ │ ├── Recipe/
│ │ │ │ ├── RecipeForm.php
│ │ │ │ └── RecipeFormLaravelValidator.php
│ │ │ ├── Server/
│ │ │ │ ├── ServerForm.php
│ │ │ │ └── ServerFormLaravelValidator.php
│ │ │ ├── Setting/
│ │ │ │ ├── MailSettingForm.php
│ │ │ │ └── MailSettingFormLaravelValidator.php
│ │ │ └── User/
│ │ │ ├── UserForm.php
│ │ │ └── UserFormLaravelValidator.php
│ │ ├── Notification/
│ │ │ ├── MailNotifier.php
│ │ │ └── NotifierInterface.php
│ │ └── Validation/
│ │ ├── AbstractLaravelValidator.php
│ │ └── ValidableInterface.php
│ ├── Specifications/
│ │ ├── DeploymentSpecification.php
│ │ └── OldDeploymentSpecification.php
│ └── Traits/
│ └── RestExceptionHandlerTrait.php
├── artisan
├── bootstrap/
│ ├── app.php
│ ├── autoload.php
│ └── cache/
│ └── .gitignore
├── composer.json
├── config/
│ ├── acl.php
│ ├── app.php
│ ├── auth.php
│ ├── cache.php
│ ├── compile.php
│ ├── database.php
│ ├── filesystems.php
│ ├── mail.php
│ ├── queue.php
│ ├── services.php
│ ├── session.php
│ └── view.php
├── database/
│ ├── .gitignore
│ ├── migrations/
│ │ ├── .gitkeep
│ │ ├── 2014_10_12_000000_create_users_table.php
│ │ ├── 2014_10_12_100000_create_password_resets_table.php
│ │ ├── 2015_02_07_172606_create_roles_table.php
│ │ ├── 2015_02_07_172633_create_role_user_table.php
│ │ ├── 2015_02_07_172649_create_permissions_table.php
│ │ ├── 2015_02_07_172657_create_permission_role_table.php
│ │ ├── 2015_02_17_152439_create_permission_user_table.php
│ │ ├── 2015_02_22_123238_create_recipes_table.php
│ │ ├── 2015_02_23_123238_create_servers_table.php
│ │ ├── 2015_02_28_164641_create_projects_table.php
│ │ ├── 2015_03_01_084552_create_deployments_table.php
│ │ ├── 2015_05_28_132914_create_max_deployments_table.php
│ │ ├── 2015_06_16_143119_create_jobs_table.php
│ │ ├── 2015_08_10_143119_create_project_recipe_table.php
│ │ └── 2016_08_24_041250_create_settings_table.php
│ └── seeds/
│ ├── .gitkeep
│ ├── DatabaseSeeder.php
│ ├── PermissionRoleTableSeeder.php
│ ├── PermissionTableSeeder.php
│ ├── RecipeTableSeeder.php
│ ├── RoleTableSeeder.php
│ ├── RoleUserTableSeeder.php
│ └── UserTableSeeder.php
├── gulpfile.js
├── package.json
├── phpspec.yml
├── phpunit.xml
├── public/
│ ├── .gitignore
│ ├── .htaccess
│ ├── css/
│ │ └── app.css
│ ├── index.php
│ ├── js/
│ │ └── .gitignore
│ └── robots.txt
├── resources/
│ ├── assets/
│ │ └── less/
│ │ ├── app.less
│ │ ├── bootstrap/
│ │ │ ├── alerts.less
│ │ │ ├── badges.less
│ │ │ ├── bootstrap.less
│ │ │ ├── breadcrumbs.less
│ │ │ ├── button-groups.less
│ │ │ ├── buttons.less
│ │ │ ├── carousel.less
│ │ │ ├── close.less
│ │ │ ├── code.less
│ │ │ ├── component-animations.less
│ │ │ ├── dropdowns.less
│ │ │ ├── forms.less
│ │ │ ├── glyphicons.less
│ │ │ ├── grid.less
│ │ │ ├── input-groups.less
│ │ │ ├── jumbotron.less
│ │ │ ├── labels.less
│ │ │ ├── list-group.less
│ │ │ ├── media.less
│ │ │ ├── mixins/
│ │ │ │ ├── alerts.less
│ │ │ │ ├── background-variant.less
│ │ │ │ ├── border-radius.less
│ │ │ │ ├── buttons.less
│ │ │ │ ├── center-block.less
│ │ │ │ ├── clearfix.less
│ │ │ │ ├── forms.less
│ │ │ │ ├── gradients.less
│ │ │ │ ├── grid-framework.less
│ │ │ │ ├── grid.less
│ │ │ │ ├── hide-text.less
│ │ │ │ ├── image.less
│ │ │ │ ├── labels.less
│ │ │ │ ├── list-group.less
│ │ │ │ ├── nav-divider.less
│ │ │ │ ├── nav-vertical-align.less
│ │ │ │ ├── opacity.less
│ │ │ │ ├── pagination.less
│ │ │ │ ├── panels.less
│ │ │ │ ├── progress-bar.less
│ │ │ │ ├── reset-filter.less
│ │ │ │ ├── resize.less
│ │ │ │ ├── responsive-visibility.less
│ │ │ │ ├── size.less
│ │ │ │ ├── tab-focus.less
│ │ │ │ ├── table-row.less
│ │ │ │ ├── text-emphasis.less
│ │ │ │ ├── text-overflow.less
│ │ │ │ └── vendor-prefixes.less
│ │ │ ├── mixins.less
│ │ │ ├── modals.less
│ │ │ ├── navbar.less
│ │ │ ├── navs.less
│ │ │ ├── normalize.less
│ │ │ ├── pager.less
│ │ │ ├── pagination.less
│ │ │ ├── panels.less
│ │ │ ├── popovers.less
│ │ │ ├── print.less
│ │ │ ├── progress-bars.less
│ │ │ ├── responsive-embed.less
│ │ │ ├── responsive-utilities.less
│ │ │ ├── scaffolding.less
│ │ │ ├── tables.less
│ │ │ ├── theme.less
│ │ │ ├── thumbnails.less
│ │ │ ├── tooltip.less
│ │ │ ├── type.less
│ │ │ ├── utilities.less
│ │ │ ├── variables.less
│ │ │ └── wells.less
│ │ └── webloyer/
│ │ ├── bootstrap.less
│ │ ├── code.less
│ │ ├── forms.less
│ │ ├── helpers.less
│ │ └── list-group.less
│ ├── lang/
│ │ └── en/
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ ├── validation.php
│ │ └── webloyer.php
│ └── views/
│ ├── app.blade.php
│ ├── auth/
│ │ ├── login.blade.php
│ │ ├── password.blade.php
│ │ ├── register.blade.php
│ │ └── reset.blade.php
│ ├── deployments/
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── emails/
│ │ ├── notification.blade.php
│ │ └── password.blade.php
│ ├── errors/
│ │ └── 503.blade.php
│ ├── home.blade.php
│ ├── projects/
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── recipes/
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── servers/
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── settings/
│ │ └── email.blade.php
│ ├── users/
│ │ ├── change_password.blade.php
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── edit_api_token.blade.php
│ │ ├── edit_role.blade.php
│ │ └── index.blade.php
│ ├── vendor/
│ │ └── .gitkeep
│ └── welcome.blade.php
├── server.php
├── storage/
│ ├── .gitignore
│ ├── app/
│ │ └── .gitignore
│ ├── framework/
│ │ ├── .gitignore
│ │ ├── cache/
│ │ │ └── .gitignore
│ │ ├── sessions/
│ │ │ └── .gitignore
│ │ └── views/
│ │ └── .gitignore
│ └── logs/
│ └── .gitignore
└── tests/
├── Entities/
│ └── Setting/
│ ├── AppSettingEntityTest.php
│ ├── DbSettingEntityTest.php
│ └── MailSettingEntityTest.php
├── Http/
│ └── Controllers/
│ ├── DeploymentsControllerTest.php
│ ├── ProjectsControllerTest.php
│ ├── RecipesControllerTest.php
│ ├── ServersControllerTest.php
│ ├── SettingsControllerTest.php
│ ├── UsersControllerTest.php
│ └── Webhook/
│ └── Github/
│ └── V1/
│ └── DeploymentsControllerTest.php
├── Jobs/
│ ├── DeployTest.php
│ └── RollbackTest.php
├── Models/
│ ├── DeploymentPresenterTest.php
│ └── ProjectTest.php
├── Repositories/
│ ├── Project/
│ │ └── EloquentProjectTest.php
│ ├── Recipe/
│ │ └── EloquentRecipeTest.php
│ ├── Role/
│ │ └── EloquentRoleTest.php
│ ├── Server/
│ │ └── EloquentServerTest.php
│ ├── Setting/
│ │ ├── ConfigAppSettingTest.php
│ │ ├── ConfigDbSettingTest.php
│ │ └── ConfigMailSettingTest.php
│ └── User/
│ └── EloquentUserTest.php
├── Services/
│ ├── Api/
│ │ └── JsonRpcTest.php
│ ├── Config/
│ │ ├── DotenvReaderTest.php
│ │ └── DotenvWriterTest.php
│ ├── Deployment/
│ │ ├── DeployerDeploymentFileBuilderTest.php
│ │ ├── DeployerRecipeFileBuilderTest.php
│ │ ├── DeployerServerListFileBuilderTest.php
│ │ └── StorageDeployCommanderTest.php
│ ├── Filesystem/
│ │ └── LaravelFilesystemTest.php
│ ├── Form/
│ │ ├── Deployment/
│ │ │ ├── DeploymentFormLaravelValidatorTest.php
│ │ │ └── DeploymentFormTest.php
│ │ ├── Project/
│ │ │ ├── ProjectFormLaravelValidatorTest.php
│ │ │ └── ProjectFormTest.php
│ │ ├── Recipe/
│ │ │ ├── RecipeFormLaravelValidatorTest.php
│ │ │ └── RecipeFormTest.php
│ │ ├── Server/
│ │ │ ├── ServerFormLaravelValidatorTest.php
│ │ │ └── ServerFormTest.php
│ │ ├── Setting/
│ │ │ ├── MailSettingFormLaravelValidatorTest.php
│ │ │ └── MailSettingFormTest.php
│ │ └── User/
│ │ ├── UserFormLaravelValidatorTest.php
│ │ └── UserFormTest.php
│ └── Notification/
│ └── MailNotifierTest.php
├── Specifications/
│ ├── DeploymentSpecificationTest.php
│ └── OldDeploymentSpecificationTest.php
├── TestCase.php
└── _helpers/
├── ConsoleCommandTestHelper.php
├── ControllerTestHelper.php
├── DummyMiddleware.php
├── Factory.php
└── MockeryHelper.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .coveralls.yml
================================================
service_name: travis-ci
================================================
FILE: .gitattributes
================================================
* text=auto
*.css linguist-vendored
*.less linguist-vendored
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: ngmy
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://flattr.com/@ngmy
================================================
FILE: .gitignore
================================================
/vendor
/node_modules
.env
*.swp
================================================
FILE: .travis.yml
================================================
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
services:
- mysql
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev --no-interaction
- mysql -u root -e "create database webloyer_test"
script:
- mkdir -p build/logs
- php vendor/bin/phpunit
after_success:
- travis_retry php vendor/bin/php-coveralls
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015 Yuta Nagamiya
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Webloyer
[](https://packagist.org/packages/ngmy/webloyer)
[](https://packagist.org/packages/ngmy/webloyer)
[](https://packagist.org/packages/ngmy/webloyer)
[](https://packagist.org/packages/ngmy/webloyer)<br>
[](https://travis-ci.org/ngmy/webloyer)
[](https://coveralls.io/r/ngmy/webloyer?branch=master)
Webloyer is a Web UI for managing [Deployer](https://github.com/deployphp/deployer) deployments.
## Features
Webloyer has the following features:
* Project management
* Managing deployment settings on a project-by-project basis
* Deployment management on a project-by-project basis
* 1-click deploying and rolling back
* Keeping a log of every deployments
* E-mail notifications can be sent when a deployment finishes
* Recipe management
* Creating, editing, deleting and listing recipe files
* Server management
* Creating, editing, deleting and listing server list files
* User management
* Authentication with e-mail address and password
* Role-based access control to features
* Web APIs
* Webhooks
* GitHub
## Screenshots
See [screenshots](/SCREENSHOTS.md).
## Requirements
Webloyer has the following requirements:
* PHP >= 5.6.0
* OpenSSL PHP Extension
* PDO PHP Extension
* Mbstring PHP Extension
* Tokenizer PHP Extension
## Installation
### Option 1: Download Source Code
1. Download the application source code by using the Composer `create-project` command:
```
composer create-project ngmy/webloyer
```
2. Give write permission to the `storage` directory and the `bootstrap/cache` directory for your web server user (e.g. `www-data`) by running the following command:
```
chown -R www-data:www-data storage
chown -R www-data:www-data bootstrap/cache
```
3. Run the installer by using the Artisan `webloyer:install` command:
```
php artisan webloyer:install
```
**Note:** You must be running this command as your web server user.
4. Start the queue listener as a background process by using the Artisan `queue:listen` command:
```
nohup php artisan queue:listen --timeout=0 &
```
**Note:** You must be running this command as your web server user.
5. Add the following Cron entry to your server:
```
* * * * * php /path/to/webloyer/artisan schedule:run >> /dev/null 2>&1
```
**Note:** You must be running this Cron entry as your web server user.
### Option 2: Using Docker
You can also install using [Webloyer Docker](https://github.com/ngmy/webloyer-docker).
## Basic Usage
### Step 1: Login to Webloyer
1. Go to the Login page by click the "Login" link.
2. Enter the e-mail address and password.
3. Click the "Login" button to login to Webloyer.
### Step 2: Create Your Project
1. Go to the Create Project page by click the "Create" button in the Projects page.
2. Enter your project information.
**Note:** For now, Webloyer only supports the `deploy` task and the `rollback` task. Therefore, you must define these tasks in your Deployer recipe file.
**Note:** If you want to use the e-mail notification, you need to enter your e-mail settings from the E-Mail Settings page.
3. Click the "Store" button to finish project creation process.
### Step 3: Managing Deployments
1. Go to the Deployments page by click the "Deployments" button.
2. Run the `deploy` task by click the "Deploy" button. Or run the `rollback` task by click the "Rollback" button.
3. After the task of execution has been completed, it is possible to go to the Deployment Detail page by click the "Show" button, you can see the details of the task execution results.
## Advanced Usage
* [Web APIs](/WEBAPIS.md)
* [Webhooks](/WEBHOOKS.md)
## Foundation Library
Webloyer uses [Laravel](http://laravel.com/) as a foundation PHP framework.
## License
Webloyer is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
## Donation
Do you want to buy me a coffee?
[](https://flattr.com/submit/auto?fid=513grl&url=https%3A%2F%2Fgithub.com%2Fngmy%2Fwebloyer)
================================================
FILE: SCREENSHOTS.md
================================================
# Screenshots
## Login
[](https://gyazo.com/97aadef9d25c06e67d70aae12a0aa8da)
## Project Management
[](https://gyazo.com/d8c7d46ac818f57e738dd34fa1c83713)<br>
[](https://gyazo.com/24d48ddf502b46acdc407efc7f5c2dda)
## Deployment Management
[](https://gyazo.com/39e520f537d877bea52070d0a444ccff)<br>
[](https://gyazo.com/17cc4ff25b25e0a85e6a0e79cbbc7ac3)
## Recipe Management
[](https://gyazo.com/d609b1ee6bc6b62b189d7cd100a08bf7)<br>
[](https://gyazo.com/47b875828f5f84156816a015d46472ed)
## Server Management
[](https://gyazo.com/bb97dea77c1d84edd6b598420c9f7df3)<br>
[](https://gyazo.com/529e418174a32df51e12234f0a678c1b)
## User Management
[](https://gyazo.com/8812374fa5917022cfb42fd333282c5f)<br>
[](https://gyazo.com/e89694d7dc7cdf05c4605f384aba1551)<br>
[](https://gyazo.com/e4f3aab674caa9ab97aa78ff206575ff)<br>
[](https://gyazo.com/1e12d1c8ed1447dcb3cb7fd0210a47c4)
## Settings
[](https://gyazo.com/9af8b0675760785a19444a2ed5b7a87b)
================================================
FILE: WEBAPIS.md
================================================
# Web APIs
Webloyer provide Web APIs.<br>
For example, you can use these for Git hooks.
## Protocol
The Web APIs use the [JSON-RPC 2.0](http://www.jsonrpc.org/specification) protocol.<br>
You must call the Web APIs with a **POST** HTTP request.<br>
And you must call the Web APIs with a `Accept` header set to `application/json-rpc`.
## Endpoint
```
/api/v1/jsonrpc
```
## Authentication
You must provide your API token into a `Authorization: Bearer` header.<br>
You can see your API token in Edit API Token Page ([Users] -> [Edit] -> [Edit API Token]).
## API Reference
### deploy
Deploy a project.
#### Parameters
| Name | Type | Description |
| --- | --- | --- |
| project_id | integer | Project id. |
#### Example Request
```
curl -X POST -d '{"jsonrpc":"2.0","id":1,"method":"deploy","params":{"project_id":1}}' -H "Authorization: Bearer aiSPTQE2nMnmHtyfjZenfI5dcb52zANE30n5t1gL5H2BwPpXz9GIVYKVFE8x" -H "Accept: application/json-rpc" http://webloyer.local/api/v1/jsonrpc
```
#### Example Response
```json
{"jsonrpc":"2.0","result":{"id":11,"project_id":1,"number":11,"task":"deploy","status":null,"message":null,"user_id":1,"created_at":"2016-10-15 18:25:31","updated_at":"2016-10-15 18:25:31"},"id":1}
```
### rollback
Roll back a project to a previous deployment.
#### Parameters
| Name | Type | Description |
| --- | --- | --- |
| project_id | integer | Project id. |
#### Example Request
```
curl -X POST -d '{"jsonrpc":"2.0","id":1,"method":"rollback","params":{"project_id":1}}' -H "Authorization: Bearer aiSPTQE2nMnmHtyfjZenfI5dcb52zANE30n5t1gL5H2BwPpXz9GIVYKVFE8x" -H "Accept: application/json-rpc" http://webloyer.local/api/v1/jsonrpc
```
#### Example Response
```json
{"jsonrpc":"2.0","result":{"id":13,"project_id":1,"number":13,"task":"rollback","status":null,"message":null,"user_id":1,"created_at":"2016-10-15 18:36:22","updated_at":"2016-10-15 18:36:22"},"id":1}
```
================================================
FILE: WEBHOOKS.md
================================================
# Webhooks
Webloyer provide webhooks of GitHub to deploy a project.
## GitHub
### Usage
You must set "Execute By" in Create Project Page.<br>
If you want to use [GitHub webhook secret](https://developer.github.com/webhooks/securing/), you must also set "Secret".
### Endpoint
```
/webhook/github/v1/projects/:project_id/deployments
```
================================================
FILE: app/Console/Commands/Inspire.php
================================================
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
class Inspire extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'inspire';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Display an inspiring quote';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
}
}
================================================
FILE: app/Console/Commands/Webloyer/DiscardOldDeployments.php
================================================
<?php
namespace App\Console\Commands\Webloyer;
use App\Repositories\Project\ProjectInterface;
use App\Specifications\OldDeploymentSpecification;
use Illuminate\Console\Command;
use DB;
use DateTime;
class DiscardOldDeployments extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'webloyer:discard-old-deployments';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Discard old deployments';
protected $projectRepository;
protected $spec;
/**
* Create a new command instance.
*
* @param \App\Repositories\Project\ProjectInterface $projectRepository
* @return void
*/
public function __construct(ProjectInterface $projectRepository)
{
parent::__construct();
$this->projectRepository = $projectRepository;
$this->spec = new OldDeploymentSpecification(new DateTime);
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
DB::transaction(function () {
$projects = $this->projectRepository->all();
foreach ($projects as $project) {
$oldDeployments = $project->getSatisfyingDeployments($this->spec);
if (!$oldDeployments->isEmpty()) {
$project->deleteDeployments($oldDeployments);
}
}
});
}
}
================================================
FILE: app/Console/Commands/Webloyer/Install.php
================================================
<?php
namespace App\Console\Commands\Webloyer;
use Artisan;
use Hash;
use App\Repositories\Setting\AppSettingInterface;
use App\Repositories\Setting\DbSettingInterface;
use App\Repositories\User\UserInterface;
use Illuminate\Console\Command;
class Install extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'webloyer:install';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Install Webloyer';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @param \App\Repositories\Setting\AppSettingInterface $appSetting
* @param \App\Repositories\Setting\DbSettingInterface $dbSetting
* @param \App\Repositories\User\UserInterface $userRepository
* @return void
*/
public function handle(AppSettingInterface $appSetting, DbSettingInterface $dbSetting, UserInterface $userRepository)
{
$config['app']['url'] = $this->ask(trans('webloyer.enter_webloyer_url'));
$config['db']['driver'] = $this->choice(trans('webloyer.enter_db_system'), [
'mysql' => 'MySQL',
'pgsql' => 'Postgres',
'sqlite' => 'SQLite',
'sqlsrv' => 'SQL Server',
], 'mysql');
if ($config['db']['driver'] !== 'sqlite') {
$config['db']['host'] = $this->ask(trans('webloyer.enter_db_host'), 'localhost');
$config['db']['database'] = $this->ask(trans('webloyer.enter_db_name'), 'webloyer');
$config['db']['username'] = $this->ask(trans('webloyer.enter_db_username'), 'webloyer');
$config['db']['password'] = $this->ask(trans('webloyer.enter_db_password'), false);
} else {
$config['db']['host'] = null;
$config['db']['database'] = $this->ask(trans('webloyer.enter_db_name_sqlite'), storage_path('webloyer.sqlite'));
$config['db']['username'] = null;
$config['db']['password'] = null;
}
$config['admin']['name'] = $this->ask(trans('webloyer.enter_admin_name'));
$config['admin']['email'] = $this->ask(trans('webloyer.enter_admin_email'));
$config['admin']['password'] = $this->ask(trans('webloyer.enter_admin_password'));
// Set configuration to .env
$appSetting->update($config['app']);
$dbSetting->update($config['db']);
config(['database.default' => $config['db']['driver']]);
config(['database.connections.'.$config['db']['driver'].'.host' => $config['db']['host']]);
config(['database.connections.'.$config['db']['driver'].'.database' => $config['db']['database']]);
config(['database.connections.'.$config['db']['driver'].'.username' => $config['db']['username']]);
config(['database.connections.'.$config['db']['driver'].'.password' => $config['db']['password']]);
// Migrate and seed database
Artisan::call('migrate:refresh', [
'--force' => true,
'--no-interaction' => true,
]);
Artisan::call('db:seed', [
'--force' => true,
'--no-interaction' => true,
'--class' => 'RecipeTableSeeder',
]);
Artisan::call('db:seed', [
'--force' => true,
'--no-interaction' => true,
'--class' => 'RoleTableSeeder',
]);
Artisan::call('db:seed', [
'--force' => true,
'--no-interaction' => true,
'--class' => 'PermissionTableSeeder',
]);
Artisan::call('db:seed', [
'--force' => true,
'--no-interaction' => true,
'--class' => 'PermissionRoleTableSeeder',
]);
// Create admin user
$config['admin']['password'] = Hash::make($config['admin']['password']);
$config['admin']['api_token'] = str_random(60);
$user = $userRepository->create($config['admin']);
$user->assignRole('administrator');
}
}
================================================
FILE: app/Console/Kernel.php
================================================
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
'App\Console\Commands\Webloyer\Install',
'App\Console\Commands\Webloyer\DiscardOldDeployments',
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('webloyer:discard-old-deployments')
->everyMinute()
->withoutOverlapping();
}
}
================================================
FILE: app/Entities/ProjectAttribute/ProjectAttributeEntity.php
================================================
<?php
namespace App\Entities\ProjectAttribute;
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SerializedName;
class ProjectAttributeEntity
{
/**
* @Type("string")
* @Accessor(getter="getDeployPath",setter="setDeployPath")
* @SerializedName("deploy_path")
*/
protected $deployPath;
public function getDeployPath()
{
return $this->deployPath;
}
public function setDeployPath($deployPath)
{
$this->deployPath = $deployPath;
}
}
================================================
FILE: app/Entities/Setting/AbstractSettingEntity.php
================================================
<?php
namespace App\Entities\Setting;
abstract class AbstractSettingEntity
{
}
================================================
FILE: app/Entities/Setting/AppSettingEntity.php
================================================
<?php
namespace App\Entities\Setting;
use App\Entities\Setting\AbstractSettingEntity;
class AppSettingEntity extends AbstractSettingEntity
{
protected $url;
public function getUrl()
{
return $this->url;
}
public function setUrl($url)
{
$this->url = $url;
return $this;
}
}
================================================
FILE: app/Entities/Setting/DbSettingEntity.php
================================================
<?php
namespace App\Entities\Setting;
use App\Entities\Setting\AbstractSettingEntity;
class DbSettingEntity extends AbstractSettingEntity
{
protected $driver;
protected $host;
protected $database;
protected $username;
protected $password;
public function getDriver()
{
return $this->driver;
}
public function getHost()
{
return $this->host;
}
public function getDatabase()
{
return $this->database;
}
public function getUsername()
{
return $this->username;
}
public function getPassword()
{
return $this->password;
}
public function setDriver($driver)
{
$this->driver = $driver;
return $this;
}
public function setHost($host)
{
$this->host = $host;
return $this;
}
public function setDatabase($database)
{
$this->database = $database;
return $this;
}
public function setUsername($username)
{
$this->username = $username;
return $this;
}
public function setPassword($password)
{
$this->password = $password;
return $this;
}
}
================================================
FILE: app/Entities/Setting/MailSettingEntity.php
================================================
<?php
namespace App\Entities\Setting;
use App\Entities\Setting\AbstractSettingEntity;
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\Accessor;
use JMS\Serializer\Annotation\SerializedName;
class MailSettingEntity extends AbstractSettingEntity
{
/**
* @Type("string")
* @Accessor(getter="getDriver",setter="setDriver")
*/
protected $driver;
/**
* @Type("array")
* @Accessor(getter="getFrom",setter="setFrom")
*/
protected $from;
/**
* @Type("string")
* @Accessor(getter="getSmtpHost",setter="setSmtpHost")
* @SerializedName("smtp_host")
*/
protected $smtpHost;
/**
* @Type("integer")
* @Accessor(getter="getSmtpPort",setter="setSmtpPort")
* @SerializedName("smtp_port")
*/
protected $smtpPort;
/**
* @Type("string")
* @Accessor(getter="getSmtpEncryption",setter="setSmtpEncryption")
* @SerializedName("smtp_encryption")
*/
protected $smtpEncryption;
/**
* @Type("string")
* @Accessor(getter="getSmtpUsername",setter="setSmtpUsername")
* @SerializedName("smtp_username")
*/
protected $smtpUsername;
/**
* @Type("string")
* @Accessor(getter="getSmtpPassword",setter="setSmtpPassword")
* @SerializedName("smtp_password")
*/
protected $smtpPassword;
/**
* @Type("string")
* @Accessor(getter="getSendmailPath",setter="setSendmailPath")
* @SerializedName("sendmail_path")
*/
protected $sendmailPath;
public function getDriver()
{
return $this->driver;
}
public function getFrom()
{
return $this->from;
}
public function getSmtpHost()
{
return $this->smtpHost;
}
public function getSmtpPort()
{
return $this->smtpPort;
}
public function getSmtpEncryption()
{
return $this->smtpEncryption;
}
public function getSmtpUsername()
{
return $this->smtpUsername;
}
public function getSmtpPassword()
{
return $this->smtpPassword;
}
public function getSendmailPath()
{
return $this->sendmailPath;
}
public function setDriver($driver)
{
$this->driver = $driver;
return $this;
}
public function setFrom(array $from)
{
$this->from = $from;
return $this;
}
public function setSmtpHost($smtpHost)
{
$this->smtpHost = $smtpHost;
return $this;
}
public function setSmtpPort($smtpPort)
{
$this->smtpPort = $smtpPort;
return $this;
}
public function setSmtpEncryption($smtpEncryption)
{
$this->smtpEncryption = $smtpEncryption;
return $this;
}
public function setSmtpUsername($smtpUsername)
{
$this->smtpUsername = $smtpUsername;
return $this;
}
public function setSmtpPassword($smtpPassword)
{
$this->smtpPassword = $smtpPassword;
return $this;
}
public function setSendmailPath($sendmailPath)
{
$this->sendmailPath = $sendmailPath;
return $this;
}
}
================================================
FILE: app/Events/Event.php
================================================
<?php
namespace App\Events;
abstract class Event
{
//
}
================================================
FILE: app/Exceptions/Handler.php
================================================
<?php
namespace App\Exceptions;
use App\Traits\RestExceptionHandlerTrait;
use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
use RestExceptionHandlerTrait;
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
return parent::report($e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($request->is('webhook/*')) {
return $this->getJsonResponseForException($request, $e);
}
return parent::render($request, $e);
}
}
================================================
FILE: app/Http/Controllers/Auth/AuthController.php
================================================
<?php
namespace App\Http\Controllers\Auth;
use App\Models\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/
use AuthenticatesAndRegistersUsers;
protected $redirectTo = '/projects';
/**
* Create a new authentication controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'getLogout']);
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
public function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
/**
* Show the application registration form.
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @return void
*/
public function getRegister()
{
abort(404);
}
/**
* Handle a registration request for the application.
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @return void
*/
public function postRegister()
{
abort(404);
}
}
================================================
FILE: app/Http/Controllers/Auth/PasswordController.php
================================================
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class PasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
protected $redirectTo = '/projects';
/**
* Create a new password controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
================================================
FILE: app/Http/Controllers/Controller.php
================================================
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
abstract class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
================================================
FILE: app/Http/Controllers/DeploymentsController.php
================================================
<?php
namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\Project\ProjectInterface;
use App\Services\Form\Deployment\DeploymentForm;
use App\Models\Project;
use App\Models\Deployment;
use Illuminate\Http\Request;
class DeploymentsController extends Controller
{
protected $project;
protected $deploymentForm;
/**
* Create a new controller instance.
*
* @param \App\Repositories\Project\ProjectInterface $project
* @param \App\Services\Form\Deployment\DeploymentForm $deploymentForm
* @return void
*/
public function __construct(ProjectInterface $project, DeploymentForm $deploymentForm)
{
$this->middleware('auth');
$this->middleware('acl');
$this->project = $project;
$this->deploymentForm = $deploymentForm;
}
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Project $project
* @return Response
*/
public function index(Request $request, Project $project)
{
$page = $request->input('page', 1);
$perPage = 10;
$deployments = $project->getDeploymentsByPage($page, $perPage);
return view('deployments.index')
->with('deployments', $deployments)
->with('project', $project);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Project $project
* @return Response
*/
public function store(Request $request, Project $project)
{
$input = array_merge($request->all(), [
'status' => null,
'message' => null,
'project_id' => $project->id,
'user_id' => $request->user()->id,
]);
if ($this->deploymentForm->save($input)) {
$deployment = $project->getLastDeployment();
$link = link_to_route('projects.deployments.show', "#$deployment->number", [$project, $deployment->number]);
$request->session()->flash('status', "The deployment $link was successfully started.");
return redirect()->route('projects.deployments.index', [$project]);
} else {
return redirect()->route('projects.deployments.index', [$project])
->withInput()
->withErrors($this->deploymentForm->errors());
}
}
/**
* Display the specified resource.
*
* @param \App\Models\Project $project
* @param \App\Models\Deployment $deployment
* @return Response
*/
public function show(Project $project, Deployment $deployment)
{
return view('deployments.show')->with('deployment', $deployment);
}
}
================================================
FILE: app/Http/Controllers/HomeController.php
================================================
<?php
namespace App\Http\Controllers;
class HomeController extends Controller
{
/*
|--------------------------------------------------------------------------
| Home Controller
|--------------------------------------------------------------------------
|
| This controller renders your application's "dashboard" for users that
| are authenticated. Of course, you are free to change or remove the
| controller as you wish. It is just here to get your app started!
|
*/
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function index()
{
return view('home');
}
}
================================================
FILE: app/Http/Controllers/ProjectsController.php
================================================
<?php
namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\Project\ProjectInterface;
use App\Repositories\Recipe\RecipeInterface;
use App\Repositories\Server\ServerInterface;
use App\Repositories\User\UserInterface;
use App\Services\Form\Project\ProjectForm;
use App\Models\Project;
use Illuminate\Http\Request;
class ProjectsController extends Controller
{
protected $project;
protected $projectForm;
protected $recipe;
protected $server;
protected $user;
/**
* Create a new controller instance.
*
* @param \App\Repositories\Project\ProjectInterface $project
* @param \App\Services\Form\Project\ProjectForm $projectForm
* @param \App\Repositories\Recipe\RecipeInterface $recipe
* @param \App\Repositories\Server\ServerInterface $server
* @param \App\Repositories\User\UserInterface $user
* @return void
*/
public function __construct(ProjectInterface $project, ProjectForm $projectForm, RecipeInterface $recipe, ServerInterface $server, UserInterface $user)
{
$this->middleware('auth');
$this->middleware('acl');
$this->project = $project;
$this->projectForm = $projectForm;
$this->recipe = $recipe;
$this->server = $server;
$this->user = $user;
}
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function index(Request $request)
{
$page = $request->input('page', 1);
$perPage = 10;
$projects = $this->project->byPage($page, $perPage);
return view('projects.index')->with('projects', $projects);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$recipes = $this->recipe->all()->toArray();
$recipes = array_column($recipes, 'name', 'id');
$servers = $this->server->all()->toArray();
$servers = array_column($servers, 'name', 'id');
$users = $this->user->all()->toArray();
$users = array_column($users, 'email', 'id');
$users = ['' => ''] + $users;
return view('projects.create')
->with('recipes', $recipes)
->with('servers', $servers)
->with('users', $users);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function store(Request $request)
{
$input = $request->all();
if ($this->projectForm->save($input)) {
return redirect()->route('projects.index');
} else {
return redirect()->route('projects.create')
->withInput()
->withErrors($this->projectForm->errors());
}
}
/**
* Display the specified resource.
*
* @param \App\Models\Project $project
* @return Response
*/
public function show(Project $project)
{
$projectRecipe = $project->getRecipes()->toArray();
$projectServer = $this->server->byId($project->server_id);
return view('projects.show')
->with('project', $project)
->with('projectRecipe', $projectRecipe)
->with('projectServer', $projectServer);
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Project $project
* @return Response
*/
public function edit(Project $project)
{
$recipes = $this->recipe->all()->toArray();
$recipes = array_column($recipes, 'name', 'id');
$servers = $this->server->all()->toArray();
$servers = array_column($servers, 'name', 'id');
$projectRecipe = $project->getRecipes()->toArray();
$projectRecipe = array_column($projectRecipe, 'id');
$users = $this->user->all()->toArray();
$users = array_column($users, 'email', 'id');
$users = ['' => ''] + $users;
return view('projects.edit')
->with('project', $project)
->with('recipes', $recipes)
->with('servers', $servers)
->with('projectRecipe', $projectRecipe)
->with('users', $users);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Project $project
* @return Response
*/
public function update(Request $request, Project $project)
{
$input = array_merge($request->all(), ['id' => $project->id]);
if ($this->projectForm->update($input)) {
return redirect()->route('projects.index');
} else {
return redirect()->route('projects.edit', [$project])
->withInput()
->withErrors($this->projectForm->errors());
}
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Project $project
* @return Response
*/
public function destroy(Project $project)
{
$this->project->delete($project->id);
return redirect()->route('projects.index');
}
}
================================================
FILE: app/Http/Controllers/RecipesController.php
================================================
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\Recipe\RecipeInterface;
use App\Services\Form\Recipe\RecipeForm;
use App\Models\Recipe;
class RecipesController extends Controller
{
protected $recipe;
protected $recipeForm;
/**
* Create a new controller instance.
*
* @param \App\Repositories\Recipe\RecipeInterface $recipe
* @param \App\Services\Form\Recipe\RecipeForm $recipeForm
* @return void
*/
public function __construct(RecipeInterface $recipe, RecipeForm $recipeForm)
{
$this->middleware('auth');
$this->middleware('acl');
$this->recipe = $recipe;
$this->recipeForm = $recipeForm;
}
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function index(Request $request)
{
$page = $request->input('page', 1);
$perPage = 10;
$recipes = $this->recipe->byPage($page, $perPage);
return view('recipes.index')->with('recipes', $recipes);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return view('recipes.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function store(Request $request)
{
$input = $request->all();
if ($this->recipeForm->save($input)) {
return redirect()->route('recipes.index');
} else {
return redirect()->route('recipes.create')
->withInput()
->withErrors($this->recipeForm->errors());
}
}
/**
* Display the specified resource.
*
* @param \App\Models\Recipe $recipe
* @return Response
*/
public function show(Recipe $recipe)
{
$recipeProject = $recipe->getProjects()->toArray();
return view('recipes.show')->with('recipe', $recipe)
->with('recipeProject', $recipeProject);
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Recipe $recipe
* @return Response
*/
public function edit(Recipe $recipe)
{
return view('recipes.edit')->with('recipe', $recipe);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Recipe $recipe
* @return Response
*/
public function update(Request $request, Recipe $recipe)
{
$input = array_merge($request->all(), ['id' => $recipe->id]);
if ($this->recipeForm->update($input)) {
return redirect()->route('recipes.index');
} else {
return redirect()->route('recipes.edit', [$recipe])
->withInput()
->withErrors($this->recipeForm->errors());
}
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Recipe $recipe
* @return Response
*/
public function destroy(Recipe $recipe)
{
$this->recipe->delete($recipe->id);
return redirect()->route('recipes.index');
}
}
================================================
FILE: app/Http/Controllers/ServersController.php
================================================
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\Server\ServerInterface;
use App\Services\Form\Server\ServerForm;
use App\Models\Server;
class ServersController extends Controller
{
protected $server;
protected $serverForm;
/**
* Create a new controller instance.
*
* @param \App\Repositories\Server\ServerInterface $server
* @param \App\Services\Form\Server\ServerForm $serverForm
* @return void
*/
public function __construct(ServerInterface $server, ServerForm $serverForm)
{
$this->middleware('auth');
$this->middleware('acl');
$this->server = $server;
$this->serverForm = $serverForm;
}
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function index(Request $request)
{
$page = $request->input('page', 1);
$perPage = 10;
$servers = $this->server->byPage($page, $perPage);
return view('servers.index')->with('servers', $servers);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return view('servers.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function store(Request $request)
{
$input = $request->all();
if ($this->serverForm->save($input)) {
return redirect()->route('servers.index');
} else {
return redirect()->route('servers.create')
->withInput()
->withErrors($this->serverForm->errors());
}
}
/**
* Display the specified resource.
*
* @param \App\Models\Server $server
* @return Response
*/
public function show(Server $server)
{
return view('servers.show')->with('server', $server);
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\Server $server
* @return Response
*/
public function edit(Server $server)
{
return view('servers.edit')->with('server', $server);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Server $server
* @return Response
*/
public function update(Request $request, Server $server)
{
$input = array_merge($request->all(), ['id' => $server->id]);
if ($this->serverForm->update($input)) {
return redirect()->route('servers.index');
} else {
return redirect()->route('servers.edit', [$server])
->withInput()
->withErrors($this->serverForm->errors());
}
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Server $server
* @return Response
*/
public function destroy(Server $server)
{
$this->server->delete($server->id);
return redirect()->route('servers.index');
}
}
================================================
FILE: app/Http/Controllers/SettingsController.php
================================================
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Services\Form\Setting\MailSettingForm;
use App\Repositories\Setting\SettingInterface;
class SettingsController extends Controller
{
public function __construct()
{
$this->middleware('auth');
$this->middleware('acl');
}
public function getEmail(SettingInterface $settingRepository)
{
$settings = $settingRepository->byType('mail');
return view('settings.email')
->with('settings', $settings);
}
public function postEmail(Request $request, MailSettingForm $mailSettingForm)
{
$input = $request->all();
if ($mailSettingForm->update($input)) {
return redirect()->route('settings.email');
} else {
return redirect()->route('settings.email')
->withInput()
->withErrors($mailSettingForm->errors());
}
}
}
================================================
FILE: app/Http/Controllers/UsersController.php
================================================
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\User\UserInterface;
use App\Repositories\Role\RoleInterface;
use App\Services\Form\User\UserForm;
use App\Models\User;
class UsersController extends Controller
{
protected $user;
protected $userForm;
protected $role;
/**
* Create a new controller instance.
*
* @param \App\Repositories\User\UserInterface $user
* @param \App\Services\Form\User\UserForm $userForm
* @param \App\Repositories\Role\RoleInterface $role
* @return void
*/
public function __construct(UserInterface $user, UserForm $userForm, RoleInterface $role)
{
$this->middleware('auth');
$this->middleware('acl');
$this->user = $user;
$this->userForm = $userForm;
$this->role = $role;
}
/**
* Display a listing of the resource.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function index(Request $request)
{
$page = $request->input('page', 1);
$perPage = 10;
$users = $this->user->byPage($page, $perPage);
return view('users.index')->with('users', $users);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$roles = $this->role->all();
return view('users.create')
->with('roles', $roles);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function store(Request $request)
{
$input = $request->all();
if ($this->userForm->save($input)) {
return redirect()->route('users.index');
} else {
return redirect()->route('users.create')
->withInput()
->withErrors($this->userForm->errors());
}
}
/**
* Display the specified resource.
*
* @param \App\Models\User $user
* @return Response
*/
public function show(User $user)
{
return redirect()->route('users.edit', [$user]);
}
/**
* Show the form for editing the specified resource.
*
* @param \App\Models\User $user
* @return Response
*/
public function edit(User $user)
{
return view('users.edit')->with('user', $user);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\User $user
* @return Response
*/
public function update(Request $request, User $user)
{
$input = array_merge($request->all(), ['id' => $user->id]);
if ($this->userForm->update($input)) {
return redirect()->route('users.index');
} else {
return redirect()->route('users.edit', [$user])
->withInput()
->withErrors($this->userForm->errors());
}
}
/**
* Show the form for changing the password of the specified resource.
*
* @param \App\Models\User $user
* @return Response
*/
public function changePassword(User $user)
{
return view('users.change_password')->with('user', $user);
}
/**
* Update the password of the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\User $user
* @return Response
*/
public function updatePassword(Request $request, User $user)
{
$input = array_merge($request->all(), ['id' => $user->id]);
if ($this->userForm->updatePassword($input)) {
return redirect()->route('users.index');
} else {
return redirect()->route('users.password.change', [$user])
->withInput()
->withErrors($this->userForm->errors());
}
}
/**
* Show the form for editing the role of the specified resource.
*
* @param \App\Models\User $user
* @return Response
*/
public function editRole(User $user)
{
$roles = $this->role->all();
return view('users.edit_role')
->with('user', $user)
->with('roles', $roles);
}
/**
* Update the role of the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\User $user
* @return Response
*/
public function updateRole(Request $request, User $user)
{
$input = array_merge($request->all(), ['id' => $user->id]);
if ($this->userForm->updateRole($input)) {
return redirect()->route('users.index');
} else {
return redirect()->route('users.role.edit', [$user])
->withInput()
->withErrors($this->userForm->errors());
}
}
/**
* Show the form for editing the API token of the specified resource.
*
* @param \App\Models\User $user
* @return Response
*/
public function editApiToken(User $user)
{
return view('users.edit_api_token')
->with('user', $user);
}
/**
* Regenerate the API token of the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\User $user
* @return Response
*/
public function regenerateApiToken(Request $request, User $user)
{
$input = array_merge($request->all(), ['id' => $user->id]);
if ($this->userForm->regenerateApiToken($input)) {
return redirect()->route('users.index');
} else {
return redirect()->route('users.api_token.edit', [$user])
->withInput()
->withErrors($this->userForm->errors());
}
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\User $user
* @return Response
*/
public function destroy(User $user)
{
$this->user->delete($user->id);
return redirect()->route('users.index');
}
}
================================================
FILE: app/Http/Controllers/Webhook/Github/V1/DeploymentsController.php
================================================
<?php
namespace App\Http\Controllers\Webhook\Github\V1;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\Project\ProjectInterface;
use App\Services\Form\Deployment\DeploymentForm;
use App\Models\Project;
use Illuminate\Http\Request;
class DeploymentsController extends Controller
{
protected $project;
protected $deploymentForm;
/**
* Create a new controller instance.
*
* @param \App\Repositories\Project\ProjectInterface $project
* @param \App\Services\Form\Deployment\DeploymentForm $deploymentForm
* @return void
*/
public function __construct(ProjectInterface $project, DeploymentForm $deploymentForm)
{
$this->project = $project;
$this->deploymentForm = $deploymentForm;
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Project $project
* @return Response
*/
public function store(Request $request, Project $project)
{
$input = array_merge($request->all(), [
'status' => null,
'message' => null,
'project_id' => $project->id,
'user_id' => $project->github_webhook_user_id,
'task' => 'deploy',
]);
if ($this->deploymentForm->save($input)) {
$deployment = $project->getLastDeployment();
return $deployment->toJson();
} else {
abort(400, $this->deploymentForm->errors());
}
}
}
================================================
FILE: app/Http/Controllers/WelcomeController.php
================================================
<?php
namespace App\Http\Controllers;
class WelcomeController extends Controller
{
/*
|--------------------------------------------------------------------------
| Welcome Controller
|--------------------------------------------------------------------------
|
| This controller renders the "marketing page" for the application and
| is configured to only allow guests. Like most of the other sample
| controllers, you are free to modify or remove it as you desire.
|
*/
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function index()
{
return redirect('projects');
}
}
================================================
FILE: app/Http/Kernel.php
================================================
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware = [
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\ApplySettings::class,
];
protected $middlewareGroups = [
'web' => [
\Illuminate\Cookie\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
],
'api' => [
'throttle:60,1',
],
];
/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'acl' => \Kodeine\Acl\Middleware\HasPermission::class,
'github_webhook_secret' => \App\Http\Middleware\VerifyGithubWebhookSecret::class,
];
}
================================================
FILE: app/Http/Middleware/ApplySettings.php
================================================
<?php
namespace App\Http\Middleware;
use Closure;
use App\Repositories\Setting\SettingInterface;
class ApplySettings
{
protected $settingRepository;
public function __construct(SettingInterface $settingRepository)
{
$this->settingRepository = $settingRepository;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$mailSettings = $this->settingRepository->byType('mail');
if (isset($mailSettings->attributes->getFrom()['address'])) {
$fromAddress = $mailSettings->attributes->getFrom()['address'];
} else {
$fromAddress = null;
}
if (isset($mailSettings->attributes->getFrom()['name'])) {
$fromName = $mailSettings->attributes->getFrom()['name'];
} else {
$fromName = null;
}
config(['mail.driver' => $mailSettings->attributes->getDriver()]);
config(['mail.from.address' => $fromAddress]);
config(['mail.from.name' => $fromName]);
config(['mail.host' => $mailSettings->attributes->getSmtpHost()]);
config(['mail.port' => $mailSettings->attributes->getSmtpPort()]);
config(['mail.encryption' => $mailSettings->attributes->getSmtpEncryption()]);
config(['mail.username' => $mailSettings->attributes->getSmtpUsername()]);
config(['mail.password' => $mailSettings->attributes->getSmtpPassword()]);
config(['mail.sendmail' => $mailSettings->attributes->getSendmailPath()]);
return $next($request);
}
}
================================================
FILE: app/Http/Middleware/Authenticate.php
================================================
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class Authenticate
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->guest()) {
if ($request->ajax() || $request->wantsJson()) {
return response('Unauthorized.', 401);
} else {
return redirect()->guest('auth/login');
}
}
return $next($request);
}
}
================================================
FILE: app/Http/Middleware/RedirectIfAuthenticated.php
================================================
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\RedirectResponse;
class RedirectIfAuthenticated
{
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->check()) {
return new RedirectResponse(url('/projects'));
}
return $next($request);
}
}
================================================
FILE: app/Http/Middleware/VerifyCsrfToken.php
================================================
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
return parent::handle($request, $next);
}
}
================================================
FILE: app/Http/Middleware/VerifyGithubWebhookSecret.php
================================================
<?php
namespace App\Http\Middleware;
use Closure;
use App\Repositories\Project\ProjectInterface;
class VerifyGithubWebhookSecret
{
protected $projectRepository;
public function __construct(ProjectInterface $projectRepository)
{
$this->projectRepository = $projectRepository;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$secret = $request->projects->github_webhook_secret;
if (isset($secret)) {
$signature = 'sha1='.hash_hmac('sha1', $request->getContent(), $secret);
if ($signature !== $request->header('X-Hub-Signature')) {
abort(401);
}
}
return $next($request);
}
}
================================================
FILE: app/Http/Requests/Request.php
================================================
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
abstract class Request extends FormRequest
{
//
}
================================================
FILE: app/Http/breadcrumbs.php
================================================
<?php
Breadcrumbs::register('projects.index', function ($breadcrumbs) {
$breadcrumbs->push('Projects', route('projects.index'));
});
Breadcrumbs::register('projects.create', function ($breadcrumbs) {
$breadcrumbs->parent('projects.index');
$breadcrumbs->push('Create', route('projects.create'));
});
Breadcrumbs::register('projects.show', function ($breadcrumbs, App\Models\Project $project) {
$breadcrumbs->parent('projects.index');
$breadcrumbs->push($project->name, route('projects.show', [$project]));
});
Breadcrumbs::register('projects.edit', function ($breadcrumbs, App\Models\Project $project) {
$breadcrumbs->parent('projects.show', $project);
$breadcrumbs->push('Edit', route('projects.edit', [$project]));
});
Breadcrumbs::register('projects.deployments.index', function ($breadcrumbs, App\Models\Project $project) {
$breadcrumbs->parent('projects.show', $project);
$breadcrumbs->push('Deployments', route('projects.deployments.index', [$project]));
});
Breadcrumbs::register('projects.deployments.show', function ($breadcrumbs, App\Models\Project $project, App\Models\Deployment $deployment) {
$breadcrumbs->parent('projects.deployments.index', $project);
$breadcrumbs->push($deployment->number, route('projects.deployments.show', [$project, $deployment]));
});
Breadcrumbs::register('recipes.index', function ($breadcrumbs) {
$breadcrumbs->push('Recipes', route('recipes.index'));
});
Breadcrumbs::register('recipes.create', function ($breadcrumbs) {
$breadcrumbs->parent('recipes.index');
$breadcrumbs->push('Create', route('recipes.create'));
});
Breadcrumbs::register('recipes.show', function ($breadcrumbs, App\Models\Recipe $recipe) {
$breadcrumbs->parent('recipes.index');
$breadcrumbs->push($recipe->name, route('recipes.show', [$recipe]));
});
Breadcrumbs::register('recipes.edit', function ($breadcrumbs, App\Models\Recipe $recipe) {
$breadcrumbs->parent('recipes.show', $recipe);
$breadcrumbs->push('Edit', route('recipes.edit', [$recipe]));
});
Breadcrumbs::register('servers.index', function ($breadcrumbs) {
$breadcrumbs->push('Servers', route('servers.index'));
});
Breadcrumbs::register('servers.create', function ($breadcrumbs) {
$breadcrumbs->parent('servers.index');
$breadcrumbs->push('Create', route('servers.create'));
});
Breadcrumbs::register('servers.show', function ($breadcrumbs, App\Models\Server $server) {
$breadcrumbs->parent('servers.index');
$breadcrumbs->push($server->name, route('servers.show', [$server]));
});
Breadcrumbs::register('servers.edit', function ($breadcrumbs, App\Models\Server $server) {
$breadcrumbs->parent('servers.show', $server);
$breadcrumbs->push('Edit', route('servers.edit', [$server]));
});
Breadcrumbs::register('users.index', function ($breadcrumbs) {
$breadcrumbs->push('Users', route('users.index'));
});
Breadcrumbs::register('users.create', function ($breadcrumbs) {
$breadcrumbs->parent('users.index');
$breadcrumbs->push('Create', route('users.create'));
});
Breadcrumbs::register('users.show', function ($breadcrumbs, App\Models\User $user) {
$breadcrumbs->parent('users.index');
$breadcrumbs->push($user->name, route('users.show', [$user]));
});
Breadcrumbs::register('users.edit', function ($breadcrumbs, App\Models\User $user) {
$breadcrumbs->parent('users.show', $user);
$breadcrumbs->push('Edit', route('users.edit', [$user]));
});
Breadcrumbs::register('users.password.change', function ($breadcrumbs, App\Models\User $user) {
$breadcrumbs->parent('users.show', $user);
$breadcrumbs->push('Change Password', route('users.password.change', [$user]));
});
Breadcrumbs::register('users.role.edit', function ($breadcrumbs, App\Models\User $user) {
$breadcrumbs->parent('users.show', $user);
$breadcrumbs->push('Edit Role', route('users.role.edit', [$user]));
});
================================================
FILE: app/Http/routes.php
================================================
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::group(['middleware' => 'web'], function () {
Route::get('/', 'WelcomeController@index');
Route::controller('auth', 'Auth\AuthController', [
'getRegister' => 'auth.register',
'getLogin' => 'auth.login',
]);
Route::controller('password', 'Auth\PasswordController', [
'getEmail' => 'password.email',
'getReset' => 'password.reset',
]);
Route::group([
'protect_alias' => 'project',
], function () {
Route::resource('projects', 'ProjectsController');
});
Route::group([
'protect_alias' => 'deployment',
], function () {
Route::resource('projects.deployments', 'DeploymentsController', [
'only' => ['index', 'store', 'show']
]);
});
Route::group([
'protect_alias' => 'recipe',
], function () {
Route::resource('recipes', 'RecipesController');
});
Route::group([
'protect_alias' => 'server',
], function () {
Route::resource('servers', 'ServersController');
});
Route::group([
'protect_alias' => 'user',
], function () {
Route::get('users/{users}/password/change', [
'as' => 'users.password.change',
'uses' => 'UsersController@changePassword',
]);
Route::put('users/{users}/password', [
'as' => 'users.password.update',
'uses' => 'UsersController@updatePassword'
]);
Route::get('users/{users}/role/edit', [
'as' => 'users.role.edit',
'uses' => 'UsersController@editRole',
]);
Route::put('users/{users}/role', [
'as' => 'users.role.update',
'uses' => 'UsersController@updateRole'
]);
Route::get('users/{users}/api_token/edit', [
'as' => 'users.api_token.edit',
'uses' => 'UsersController@editApiToken',
]);
Route::put('users/{users}/api_token', [
'as' => 'users.api_token.regenerate',
'uses' => 'UsersController@regenerateApiToken'
]);
Route::resource('users', 'UsersController');
});
Route::group([
'protect_alias' => 'setting'
], function () {
Route::controller('settings', 'SettingsController', [
'getEmail' => 'settings.email'
]);
});
});
Route::group(['middleware' => 'api'], function () {
Route::group(['prefix' => 'api/v1'], function () {
Route::post('jsonrpc', function (Illuminate\Http\Request $request) {
$server = new JsonRPC\Server;
$middlewareHandler = $server->getMiddlewareHandler();
$middlewareHandler->withMiddleware(new App\Services\Api\Middleware\Authenticate($request));
$procedureHandler = $server->getProcedureHandler();
$procedureHandler->withObject(app()->make('App\Services\Api\JsonRpc'));
return $server->execute();
});
});
Route::group(['prefix' => 'webhook/github/v1', 'middleware' => 'github_webhook_secret'], function () {
Route::resource('projects.deployments', 'Webhook\Github\V1\DeploymentsController', [
'only' => ['store']
]);
});
});
================================================
FILE: app/Jobs/Deploy.php
================================================
<?php
namespace App\Jobs;
use App\Jobs\Job;
use App\Repositories\Project\ProjectInterface;
use App\Repositories\Server\ServerInterface;
use App\Repositories\Setting\SettingInterface;
use App\Services\Notification\NotifierInterface;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\Process\ProcessBuilder;
class Deploy extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
protected $deployment;
protected $executable;
/**
* Create a new job instance.
*
* @param \Illuminate\Database\Eloquent\Model $deployment
* @return void
*/
public function __construct(Model $deployment)
{
$this->deployment = $deployment;
$this->executable = base_path('vendor/bin/dep');
}
/**
* Execute the job.
*
* @param \App\Repositories\Project\ProjectInterface $projectRepository
* @param \App\Repositories\Server\ServerInterface $serverRepository
* @param \Symfony\Component\Process\ProcessBuilder $processBuilder
* @param \App\Services\Notification\NotifierInterface $notifier
* @param \App\Repositories\Setting\SettingInterface $settingRepository
* @return void
*/
public function handle(ProjectInterface $projectRepository, ServerInterface $serverRepository, ProcessBuilder $processBuilder, NotifierInterface $notifier, SettingInterface $settingRepository)
{
$deployment = $this->deployment;
$project = $projectRepository->byId($deployment->project_id);
$server = $serverRepository->byId($project->server_id);
$app = app();
// Create a server list file
$serverListFileBuilder = $app->make('App\Services\Deployment\DeployerServerListFileBuilder')
->setServer($server)
->setProject($project);
$serverListFile = $app->make('App\Services\Deployment\DeployerFileDirector', [$serverListFileBuilder])->construct();
// Create recipe files
foreach ($project->getRecipes() as $i => $recipe) {
// HACK: If an instance of DeployerRecipeFileBuilder class is not stored in an array, a destructor is called and a recipe file is deleted immediately.
$recipeFileBuilders[] = $app->make('App\Services\Deployment\DeployerRecipeFileBuilder')->setRecipe($recipe);
$recipeFiles[] = $app->make('App\Services\Deployment\DeployerFileDirector', [$recipeFileBuilders[$i]])->construct();
}
// Create a deployment file
$deploymentFileBuilder = $app->make('App\Services\Deployment\DeployerDeploymentFileBuilder')
->setProject($project)
->setServerListFile($serverListFile)
->setRecipeFile($recipeFiles);
$deploymentFile = $app->make('App\Services\Deployment\DeployerFileDirector', [$deploymentFileBuilder])->construct();
// Create a command
$processBuilder
->add($this->executable)
->add("-f={$deploymentFile->getFullPath()}")
->add('--ansi')
->add('-n')
->add('-vv')
->add('deploy')
->add($project->stage);
// Run the command
$tmp['id'] = $deployment->id;
$tmp['message'] = '';
$process = $processBuilder->getProcess();
$process->setTimeout(600);
$process->run(function ($type, $buffer) use (&$tmp, $project, $deployment) {
$tmp['message'] .= $buffer;
$tmp['number'] = $deployment->number;
$project->updateDeployment($tmp);
});
// Store the result
if ($process->isSuccessful()) {
$message = $process->getOutput();
} else {
$message = $process->getErrorOutput();
}
$data['id'] = $deployment->id;
$data['number'] = $deployment->number;
$data['message'] = $message;
$data['status'] = $process->getExitCode();
$project->updateDeployment($data);
// Notify
if (isset($project->email_notification_recipient)) {
$mailSettings = $settingRepository->byType('mail');
if (isset($mailSettings->attributes->getFrom()['address'])) {
$fromAddress = $mailSettings->attributes->getFrom()['address'];
} else {
$fromAddress = null;
}
if (isset($mailSettings->attributes->getFrom()['name'])) {
$fromName = $mailSettings->attributes->getFrom()['name'];
} else {
$fromName = null;
}
config(['mail.driver' => $mailSettings->attributes->getDriver()]);
config(['mail.from.address' => $fromAddress]);
config(['mail.from.name' => $fromName]);
config(['mail.host' => $mailSettings->attributes->getSmtpHost()]);
config(['mail.port' => $mailSettings->attributes->getSmtpPort()]);
config(['mail.encryption' => $mailSettings->attributes->getSmtpEncryption()]);
config(['mail.username' => $mailSettings->attributes->getSmtpUsername()]);
config(['mail.password' => $mailSettings->attributes->getSmtpPassword()]);
config(['mail.sendmail' => $mailSettings->attributes->getSendmailPath()]);
$deployment = $project->getDeploymentByNumber($deployment->number);
if ($process->isSuccessful()) {
$status = 'success';
} else {
$status = 'failure';
}
$subject = "Deployment of {$project->name} #{$deployment->number} finished: {$status}";
$message = view('emails.notification')
->with('project', $project)
->with('deployment', $deployment)
->render();
$notifier->to($project->email_notification_recipient)->notify($subject, $message);
}
}
}
================================================
FILE: app/Jobs/Job.php
================================================
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
abstract class Job
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "queueOn" and "delay" queue helper methods.
|
*/
use Queueable;
}
================================================
FILE: app/Jobs/Rollback.php
================================================
<?php
namespace App\Jobs;
use App\Jobs\Job;
use App\Repositories\Project\ProjectInterface;
use App\Repositories\Server\ServerInterface;
use App\Repositories\Setting\SettingInterface;
use App\Services\Notification\NotifierInterface;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\Process\ProcessBuilder;
class Rollback extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
protected $deployment;
protected $executable;
/**
* Create a new job instance.
*
* @param \Illuminate\Database\Eloquent\Model $deployment
* @return void
*/
public function __construct(Model $deployment)
{
$this->deployment = $deployment;
$this->executable = base_path('vendor/bin/dep');
}
/**
* Execute the job.
*
* @param \App\Repositories\Project\ProjectInterface $projectRepository
* @param \App\Repositories\Server\ServerInterface $serverRepository
* @param \Symfony\Component\Process\ProcessBuilder $processBuilder
* @param \App\Services\Notification\NotifierInterface $notifier
* @param \App\Repositories\Setting\SettingInterface $settingRepository
* @return void
*/
public function handle(ProjectInterface $projectRepository, ServerInterface $serverRepository, ProcessBuilder $processBuilder, NotifierInterface $notifier, SettingInterface $settingRepository)
{
$deployment = $this->deployment;
$project = $projectRepository->byId($deployment->project_id);
$server = $serverRepository->byId($project->server_id);
$app = app();
// Create a server list file
$serverListFileBuilder = $app->make('App\Services\Deployment\DeployerServerListFileBuilder')
->setServer($server)
->setProject($project);
$serverListFile = $app->make('App\Services\Deployment\DeployerFileDirector', [$serverListFileBuilder])->construct();
// Create recipe files
foreach ($project->getRecipes() as $i => $recipe) {
// HACK: If an instance of DeployerRecipeFileBuilder class is not stored in an array, a destructor is called and a recipe file is deleted immediately.
$recipeFileBuilders[] = $app->make('App\Services\Deployment\DeployerRecipeFileBuilder')->setRecipe($recipe);
$recipeFiles[] = $app->make('App\Services\Deployment\DeployerFileDirector', [$recipeFileBuilders[$i]])->construct();
}
// Create a deployment file
$deploymentFileBuilder = $app->make('App\Services\Deployment\DeployerDeploymentFileBuilder')
->setProject($project)
->setServerListFile($serverListFile)
->setRecipeFile($recipeFiles);
$deploymentFile = $app->make('App\Services\Deployment\DeployerFileDirector', [$deploymentFileBuilder])->construct();
// Create a command
$processBuilder
->add($this->executable)
->add("-f={$deploymentFile->getFullPath()}")
->add('--ansi')
->add('-n')
->add('-vv')
->add('rollback')
->add($project->stage);
// Run the command
$tmp['id'] = $deployment->id;
$tmp['message'] = '';
$process = $processBuilder->getProcess();
$process->setTimeout(600);
$process->run(function ($type, $buffer) use (&$tmp, $project, $deployment) {
$tmp['message'] .= $buffer;
$tmp['number'] = $deployment->number;
$project->updateDeployment($tmp);
});
// Store the result
if ($process->isSuccessful()) {
$message = $process->getOutput();
} else {
$message = $process->getErrorOutput();
}
$data['id'] = $deployment->id;
$data['number'] = $deployment->number;
$data['message'] = $message;
$data['status'] = $process->getExitCode();
$project->updateDeployment($data);
// Notify
if (isset($project->email_notification_recipient)) {
$mailSettings = $settingRepository->byType('mail');
if (isset($mailSettings->attributes->getFrom()['address'])) {
$fromAddress = $mailSettings->attributes->getFrom()['address'];
} else {
$fromAddress = null;
}
if (isset($mailSettings->attributes->getFrom()['name'])) {
$fromName = $mailSettings->attributes->getFrom()['name'];
} else {
$fromName = null;
}
config(['mail.driver' => $mailSettings->attributes->getDriver()]);
config(['mail.from.address' => $fromAddress]);
config(['mail.from.name' => $fromName]);
config(['mail.host' => $mailSettings->attributes->getSmtpHost()]);
config(['mail.port' => $mailSettings->attributes->getSmtpPort()]);
config(['mail.encryption' => $mailSettings->attributes->getSmtpEncryption()]);
config(['mail.username' => $mailSettings->attributes->getSmtpUsername()]);
config(['mail.password' => $mailSettings->attributes->getSmtpPassword()]);
config(['mail.sendmail' => $mailSettings->attributes->getSendmailPath()]);
$deployment = $project->getDeploymentByNumber($deployment->number);
if ($process->isSuccessful()) {
$status = 'success';
} else {
$status = 'failure';
}
$subject = "Deployment of {$project->name} #{$deployment->number} finished: {$status}";
$message = view('emails.notification')
->with('project', $project)
->with('deployment', $deployment)
->render();
$notifier->to($project->email_notification_recipient)->notify($subject, $message);
}
}
}
================================================
FILE: app/Listeners/.gitkeep
================================================
================================================
FILE: app/Models/BaseModel.php
================================================
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class BaseModel extends Model
{
protected function nullIfBlank($value)
{
return trim($value) !== '' ? $value : null;
}
}
================================================
FILE: app/Models/Deployment.php
================================================
<?php
namespace App\Models;
use Robbo\Presenter\PresentableInterface;
use SensioLabs\AnsiConverter\AnsiToHtmlConverter;
class Deployment extends BaseModel implements PresentableInterface
{
protected $table = 'deployments';
protected $fillable = [
'project_id',
'number',
'task',
'status',
'message',
'user_id',
];
protected $casts = [
'number' => 'integer',
'status' => 'integer',
];
/**
* Return a created presenter.
*
* @return \Robbo\Presenter\Presenter
*/
public function getPresenter()
{
$converter = new AnsiToHtmlConverter;
return new DeploymentPresenter($this, $converter);
}
public function user()
{
return $this->belongsTo('App\Models\User');
}
}
================================================
FILE: app/Models/DeploymentPresenter.php
================================================
<?php
namespace App\Models;
use Robbo\Presenter\Presenter;
class DeploymentPresenter extends Presenter
{
protected $converter;
public function __construct($object, $converter)
{
parent::__construct($object);
$this->converter = $converter;
}
public function status()
{
if (!isset($this->status)) {
return '<span></span>';
} elseif ($this->status === 0) {
return '<span class="glyphicon glyphicon-ok-circle green" aria-hidden="true"></span>';
} else {
return '<span class="glyphicon glyphicon-ban-circle red" aria-hidden="true"></span>';
}
}
public function statusText()
{
if (!isset($this->status)) {
return 'running';
} elseif ($this->status === 0) {
return 'success';
} else {
return 'failure';
}
}
public function message()
{
$html = $this->converter->convert($this->message);
return $html;
}
public function messageText()
{
$html = $this->message();
$text = htmlspecialchars_decode(strip_tags($html));
return $text;
}
}
================================================
FILE: app/Models/MaxDeployment.php
================================================
<?php
namespace App\Models;
class MaxDeployment extends BaseModel
{
protected $table = 'max_deployments';
protected $fillable = ['project_id', 'number'];
protected $casts = [
'number' => 'integer',
];
}
================================================
FILE: app/Models/Project.php
================================================
<?php
namespace App\Models;
use App\Specifications\DeploymentSpecification;
use Ngmy\EloquentSerializedLob\SerializedLobTrait;
use Illuminate\Support\Collection;
use DateTime;
class Project extends BaseModel
{
use SerializedLobTrait;
protected $table = 'projects';
protected $fillable = [
'name',
'stage',
'repository',
'server_id',
'email_notification_recipient',
'attributes',
'days_to_keep_deployments',
'max_number_of_deployments_to_keep',
'keep_last_deployment',
'github_webhook_secret',
'github_webhook_user_id',
];
public function setStageAttribute($value)
{
$this->attributes['stage'] = $this->nullIfBlank($value);
}
public function setEmailNotificationRecipientAttribute($value)
{
$this->attributes['email_notification_recipient'] = $this->nullIfBlank($value);
}
public function setDaysToKeepDeploymentsAttribute($value)
{
$this->attributes['days_to_keep_deployments'] = $this->nullIfBlank($value);
}
public function setMaxNumberOfDeploymentsToKeepAttribute($value)
{
$this->attributes['max_number_of_deployments_to_keep'] = $this->nullIfBlank($value);
}
public function setGithubWebhookSecretAttribute($value)
{
$this->attributes['github_webhook_secret'] = $this->nullIfBlank($value);
}
public function setGithubWebhookUserIdAttribute($value)
{
$this->attributes['github_webhook_user_id'] = $this->nullIfBlank($value);
}
public function maxDeployment()
{
return $this->hasOne('App\Models\MaxDeployment');
}
public function deployments()
{
return $this->hasMany('App\Models\Deployment');
}
public function recipes()
{
return $this->belongsToMany('App\Models\Recipe');
}
public function githubWebhookUser()
{
return $this->belongsTo('App\Models\User', 'github_webhook_user_id');
}
public function getGithubWebhookUser()
{
return $this->githubWebhookUser()->first();
}
public function getMaxDeployment()
{
return $this->maxDeployment()->lockForUpdate()->first();
}
public function getLastDeployment()
{
return $this->deployments()->orderBy('number', 'desc')->first();
}
public function getDeploymentByNumber($number)
{
return $this->deployments()->where('number', $number)->first();
}
public function getDeploymentsByPage($page = 1, $limit = 10)
{
return $this->deployments()
->orderBy('deployments.created_at', 'desc')
->skip($limit * ($page - 1))
->take($limit)
->paginate($limit);
}
public function getDeployments()
{
return $this->deployments()->orderBy('number', 'desc')->get();
}
public function deleteDeployments(Collection $deployments)
{
foreach ($deployments as $deployment) {
$deploymentIds[] = $deployment->id;
}
return $this->deployments()
->whereIn('id', $deploymentIds)
->delete();
}
public function getRecipes()
{
return $this->recipes()->orderBy('recipe_order')->get();
}
public function addMaxDeployment(array $data = [])
{
return $this->maxDeployment()->create($data);
}
public function addDeployment(array $data)
{
return $this->deployments()->create($data);
}
public function updateDeployment(array $data)
{
return $this->deployments()
->where('number', $data['number'])
->update($data);
}
public function syncRecipes(array $data)
{
foreach ($data as $i => $recipeId) {
$syncRecipeIds[$recipeId] = ['recipe_order' => $i + 1];
}
return $this->recipes()->sync($syncRecipeIds);
}
public function updateMaxDeployment(array $data)
{
return $this->maxDeployment()->update($data);
}
public function getDeploymentsWhereCreatedAtBefore(DateTime $date)
{
return $this->deployments()
->orderBy('number', 'desc')
->where('created_at', '<', $date)
->get();
}
public function getDeploymentsWhereNumberBefore($number)
{
return $this->deployments()
->orderBy('number', 'desc')
->where('number', '<', $number)
->get();
}
public function getSatisfyingDeployments(DeploymentSpecification $spec)
{
return $spec->satisfyingElementsFrom($this);
}
protected function serializedLobColumn()
{
return 'attributes';
}
protected function serializedLobSerializer()
{
return \Ngmy\EloquentSerializedLob\Serializer\JsonSerializer::class;
}
protected function serializedLobDeserializeType()
{
return \App\Entities\ProjectAttribute\ProjectAttributeEntity::class;
}
}
================================================
FILE: app/Models/Recipe.php
================================================
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Recipe extends BaseModel
{
protected $table = 'recipes';
protected $fillable = [
'name',
'description',
'body',
];
public function projects()
{
return $this->belongsToMany('App\Models\Project');
}
public function getProjects()
{
return $this->projects()->orderBy('name')->get();
}
}
================================================
FILE: app/Models/Server.php
================================================
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Server extends BaseModel
{
protected $table = 'servers';
protected $fillable = [
'name',
'description',
'body',
];
}
================================================
FILE: app/Models/Setting.php
================================================
<?php
namespace App\Models;
use Ngmy\EloquentSerializedLob\SerializedLobTrait;
class Setting extends BaseModel
{
use SerializedLobTrait;
protected $table = 'settings';
protected $fillable = [
'type',
'attributes',
];
protected function serializedLobColumn()
{
return 'attributes';
}
protected function serializedLobSerializer()
{
return \Ngmy\EloquentSerializedLob\Serializer\JsonSerializer::class;
}
protected function serializedLobDeserializeType()
{
if ($this->type === 'mail') {
return \App\Entities\Setting\MailSettingEntity::class;
}
}
}
================================================
FILE: app/Models/User.php
================================================
<?php
namespace App\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Kodeine\Acl\Traits\HasRole;
class User extends BaseModel implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, HasRole;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'email',
'password',
'api_token',
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'password',
'remember_token',
'api_token',
];
}
================================================
FILE: app/Policies/.gitkeep
================================================
================================================
FILE: app/Providers/AppServiceProvider.php
================================================
<?php
namespace App\Providers;
use App\Services\Deployment\QueueDeployCommander;
use App\Services\Deployment\DeployerFile;
use App\Services\Deployment\DeployerDeploymentFileBuilder;
use App\Services\Deployment\DeployerRecipeFileBuilder;
use App\Services\Deployment\DeployerServerListFileBuilder;
use App\Services\Form\Project\ProjectForm;
use App\Services\Form\Project\ProjectFormLaravelValidator;
use App\Services\Form\Deployment\DeploymentForm;
use App\Services\Form\Deployment\DeploymentFormLaravelValidator;
use App\Services\Form\Recipe\RecipeForm;
use App\Services\Form\Recipe\RecipeFormLaravelValidator;
use App\Services\Form\Server\ServerForm;
use App\Services\Form\Server\ServerFormLaravelValidator;
use App\Services\Form\User\UserForm;
use App\Services\Form\User\UserFormLaravelValidator;
use App\Services\Form\Setting\MailSettingForm;
use App\Services\Form\Setting\MailSettingFormLaravelValidator;
use App\Services\Notification\MailNotifier;
use App\Services\Config\DotenvReader;
use App\Services\Config\DotenvWriter;
use App\Services\Filesystem\LaravelFilesystem;
use App\Services\Api\JsonRpc;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Dumper;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// HACK `artisan optimize` and `phpunit` doesn't work with PHP 7.4 due to ErrorException.
$isArtisanOptimize = php_sapi_name() == 'cli' && $_SERVER['argv'][0] == 'artisan' && in_array('optimize', $_SERVER['argv']);
if (version_compare(phpversion(), '7.4.0', '>=') && ($isArtisanOptimize || $this->app->runningUnitTests())) {
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE);
}
}
/**
* Register any application services.
*
* This service provider is a great spot to register your various container
* bindings with the application. As you can see, we are registering our
* "Registrar" implementation here. You can add your own bindings too!
*
* @return void
*/
public function register()
{
$this->app->bind(
'Illuminate\Contracts\Auth\Registrar',
'App\Services\Registrar'
);
$this->app->bind('App\Services\Deployment\DeployCommanderInterface', function ($app) {
return new QueueDeployCommander(
$app->make('Illuminate\Contracts\Bus\Dispatcher')
);
});
$this->app->bind('App\Services\Form\Project\ProjectForm', function ($app) {
return new ProjectForm(
new ProjectFormLaravelValidator($app['validator']),
$app->make('App\Repositories\Project\ProjectInterface')
);
});
$this->app->bind('App\Services\Form\Deployment\DeploymentForm', function ($app) {
return new DeploymentForm(
new DeploymentFormLaravelValidator($app['validator']),
$app->make('App\Repositories\Project\ProjectInterface'),
$app->make('App\Services\Deployment\DeployCommanderInterface')
);
});
$this->app->bind('App\Services\Form\Recipe\RecipeForm', function ($app) {
return new RecipeForm(
new RecipeFormLaravelValidator($app['validator']),
$app->make('App\Repositories\Recipe\RecipeInterface')
);
});
$this->app->bind('App\Services\Form\Server\ServerForm', function ($app) {
return new ServerForm(
new ServerFormLaravelValidator($app['validator']),
$app->make('App\Repositories\Server\ServerInterface')
);
});
$this->app->bind('App\Services\Form\User\UserForm', function ($app) {
return new UserForm(
new UserFormLaravelValidator($app['validator']),
$app->make('App\Repositories\User\UserInterface')
);
});
$this->app->bind('App\Services\Form\Setting\MailSettingForm', function ($app) {
return new MailSettingForm(
new MailSettingFormLaravelValidator($app['validator']),
$app->make('App\Repositories\Setting\SettingInterface')
);
});
$this->app->bind('App\Services\Notification\NotifierInterface', function ($app) {
return new MailNotifier;
});
$this->app->bind('App\Services\Config\ConfigReaderInterface', function ($app) {
$path = base_path('.env');
return new DotenvReader(
new LaravelFilesystem($app['files']),
$path
);
});
$this->app->bind('App\Services\Config\ConfigWriterInterface', function ($app) {
$path = base_path('.env');
return new DotenvWriter(
new LaravelFilesystem($app['files']),
$path
);
});
$this->app->bind('App\Services\Deployment\DeployerServerListFileBuilder', function ($app) {
return new DeployerServerListFileBuilder(
new LaravelFilesystem($app['files']),
new DeployerFile,
new Parser,
new Dumper
);
});
$this->app->bind('App\Services\Deployment\DeployerRecipeFileBuilder', function ($app) {
return new DeployerRecipeFileBuilder(
new LaravelFilesystem($app['files']),
new DeployerFile
);
});
$this->app->bind('App\Services\Deployment\DeployerDeploymentFileBuilder', function ($app) {
return new DeployerDeploymentFileBuilder(
new LaravelFilesystem($app['files']),
new DeployerFile
);
});
$this->app->bind('App\Services\Api\JsonRpc', function ($app) {
return new JsonRpc(
$app->make('App\Repositories\Project\ProjectInterface'),
$app->make('App\Services\Form\Deployment\DeploymentForm')
);
});
}
}
================================================
FILE: app/Providers/AuthServiceProvider.php
================================================
<?php
namespace App\Providers;
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any application authentication / authorization services.
*
* @param \Illuminate\Contracts\Auth\Access\Gate $gate
* @return void
*/
public function boot(GateContract $gate)
{
$this->registerPolicies($gate);
//
}
}
================================================
FILE: app/Providers/EventServiceProvider.php
================================================
<?php
namespace App\Providers;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event handler mappings for the application.
*
* @var array
*/
protected $listen = [
'event.name' => [
'EventListener',
],
];
/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot(DispatcherContract $events)
{
parent::boot($events);
//
}
}
================================================
FILE: app/Providers/RepositoryServiceProvider.php
================================================
<?php
namespace App\Providers;
use App\Models\Project;
use App\Models\Recipe;
use App\Models\Server;
use App\Models\Setting;
use App\Models\User;
use App\Repositories\Project\EloquentProject;
use App\Repositories\Recipe\EloquentRecipe;
use App\Repositories\Server\EloquentServer;
use App\Repositories\User\EloquentUser;
use App\Repositories\Role\EloquentRole;
use App\Repositories\Setting\ConfigAppSetting;
use App\Repositories\Setting\ConfigDbSetting;
use App\Repositories\Setting\EloquentSetting;
use Kodeine\Acl\Models\Eloquent\Role;
use Illuminate\Support\ServiceProvider;
class RepositoryServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->bind('App\Repositories\Project\ProjectInterface', function ($app) {
return new EloquentProject(new Project);
});
$this->app->bind('App\Repositories\Recipe\RecipeInterface', function ($app) {
return new EloquentRecipe(new Recipe);
});
$this->app->bind('App\Repositories\Server\ServerInterface', function ($app) {
return new EloquentServer(new Server);
});
$this->app->bind('App\Repositories\User\UserInterface', function ($app) {
return new EloquentUser(new User);
});
$this->app->bind('App\Repositories\Role\RoleInterface', function ($app) {
return new EloquentRole(new Role);
});
$this->app->bind('App\Repositories\Setting\SettingInterface', function ($app) {
return new EloquentSetting(new Setting);
});
$this->app->bind('App\Repositories\Setting\DbSettingInterface', function ($app) {
return new ConfigDbSetting(
$app->make('App\Services\Config\ConfigReaderInterface'),
$app->make('App\Services\Config\ConfigWriterInterface')
);
});
$this->app->bind('App\Repositories\Setting\AppSettingInterface', function ($app) {
return new ConfigAppSetting(
$app->make('App\Services\Config\ConfigReaderInterface'),
$app->make('App\Services\Config\ConfigWriterInterface')
);
});
}
}
================================================
FILE: app/Providers/RouteServiceProvider.php
================================================
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to the controller routes in your routes file.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
parent::boot($router);
//
$router->bind('projects', function ($id) {
$projectRepository = $this->app->make('App\Repositories\Project\ProjectInterface');
$project = $projectRepository->byId($id);
if (is_null($project)) {
throw new NotFoundHttpException;
}
return $project;
});
$router->bind('deployments', function ($num, $route) {
$project = $route->parameter('projects');
$deployment = $project->getDeploymentByNumber($num);
if (is_null($deployment)) {
throw new NotFoundHttpException;
}
return $deployment;
});
$router->bind('recipes', function ($id) {
$recipeRepository = $this->app->make('App\Repositories\Recipe\RecipeInterface');
$recipe = $recipeRepository->byId($id);
if (is_null($recipe)) {
throw new NotFoundHttpException;
}
return $recipe;
});
$router->bind('servers', function ($id) {
$serverRepository = $this->app->make('App\Repositories\Server\ServerInterface');
$server = $serverRepository->byId($id);
if (is_null($server)) {
throw new NotFoundHttpException;
}
return $server;
});
$router->bind('users', function ($id) {
$userRepository = $this->app->make('App\Repositories\User\UserInterface');
$user = $userRepository->byId($id);
if (is_null($user)) {
throw new NotFoundHttpException;
}
return $user;
});
}
/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function map(Router $router)
{
$router->group(['namespace' => $this->namespace], function ($router) {
require app_path('Http/routes.php');
});
}
}
================================================
FILE: app/Repositories/AbstractConfigRepository.php
================================================
<?php
namespace App\Repositories;
use App\Services\Config\ConfigReaderInterface;
use App\Services\Config\ConfigWriterInterface;
abstract class AbstractConfigRepository implements RepositoryInterface
{
protected $reader;
protected $writer;
/**
* Create a new repository instance.
*
* @param \App\Services\Config\ConfigReaderInterface $reader
* @param \App\Services\Config\ConfigWriterInterface $writer
* @return void
*/
public function __construct(ConfigReaderInterface $reader, ConfigWriterInterface $writer)
{
$this->reader = $reader;
$this->writer = $writer;
}
public function byId($id)
{
}
public function byPage($page = 1, $limi = 10)
{
}
public function all()
{
}
public function create(array $data)
{
}
public function update(array $data)
{
}
public function delete($id)
{
}
}
================================================
FILE: app/Repositories/AbstractEloquentRepository.php
================================================
<?php
namespace App\Repositories;
abstract class AbstractEloquentRepository implements RepositoryInterface
{
protected $model;
/**
* Get a model by id.
*
* @param int $id Model id
* @return \Illuminate\Database\Eloquent\Model
*/
public function byId($id)
{
return $this->model->find($id);
}
/**
* Get paginated models.
*
* @param int $page Page number
* @param int $limit Number of models per page
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function byPage($page = 1, $limit = 10)
{
$models = $this->model
->skip($limit * ($page - 1))
->take($limit)
->paginate($limit);
return $models;
}
/**
* Get all models.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function all()
{
return $this->model->all();
}
/**
* Create a new model.
*
* @param array $data Data to create a model
* @return \Illuminate\Database\Eloquent\Model
*/
public function create(array $data)
{
$model = $this->model->create($data);
return $model;
}
/**
* Update an existing model.
*
* @param array $data Data to update a model
* @return boolean
*/
public function update(array $data)
{
$model = $this->model->find($data['id']);
$model->update($data);
return true;
}
/**
* Delete an existing model.
*
* @param int $id Model id
* @return boolean
*/
public function delete($id)
{
$model = $this->model->find($id);
$model->delete();
return true;
}
}
================================================
FILE: app/Repositories/Project/EloquentProject.php
================================================
<?php
namespace App\Repositories\Project;
use App\Repositories\AbstractEloquentRepository;
use Illuminate\Database\Eloquent\Model;
class EloquentProject extends AbstractEloquentRepository implements ProjectInterface
{
/**
* Create a new repository instance.
*
* @param \Illuminate\Database\Eloquent\Model $project
* @return void
*/
public function __construct(Model $project)
{
$this->model = $project;
}
/**
* Get paginated projects.
*
* @param int $page Page number
* @param int $limit Number of projects per page
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function byPage($page = 1, $limit = 10)
{
$projects = $this->model->with(['deployments' => function ($query) {
$query->orderBy('number', 'desc');
}])->orderBy('name')
->skip($limit * ($page - 1))
->take($limit)
->paginate($limit);
return $projects;
}
}
================================================
FILE: app/Repositories/Project/ProjectInterface.php
================================================
<?php
namespace App\Repositories\Project;
use App\Repositories\RepositoryInterface;
interface ProjectInterface extends RepositoryInterface
{
}
================================================
FILE: app/Repositories/Recipe/EloquentRecipe.php
================================================
<?php
namespace App\Repositories\Recipe;
use App\Repositories\AbstractEloquentRepository;
use Illuminate\Database\Eloquent\Model;
class EloquentRecipe extends AbstractEloquentRepository implements RecipeInterface
{
/**
* Create a new repository instance.
*
* @param \Illuminate\Database\Eloquent\Model $recipe
* @return void
*/
public function __construct(Model $recipe)
{
$this->model = $recipe;
}
/**
* Get paginated recipes.
*
* @param int $page Page number
* @param int $limit Number of recipes per page
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function byPage($page = 1, $limit = 10)
{
$recipes = $this->model->orderBy('name')
->skip($limit * ($page - 1))
->take($limit)
->paginate($limit);
return $recipes;
}
}
================================================
FILE: app/Repositories/Recipe/RecipeInterface.php
================================================
<?php
namespace App\Repositories\Recipe;
use App\Repositories\RepositoryInterface;
interface RecipeInterface extends RepositoryInterface
{
}
================================================
FILE: app/Repositories/RepositoryInterface.php
================================================
<?php
namespace App\Repositories;
interface RepositoryInterface
{
/**
* Get a model by id.
*
* @param int $id Model id
* @return mixed
*/
public function byId($id);
/**
* Get paginated models.
*
* @param int $page Page number
* @param int $limit Number of models per page
* @return mixed
*/
public function byPage($page = 1, $limit = 10);
/**
* Get all models.
*
* @return mixed
*/
public function all();
/**
* Create a new model.
*
* @param array $data Data to create a model
* @return mixed
*/
public function create(array $data);
/**
* Update an existing model.
*
* @param array $data Data to update a model
* @return mixed
*/
public function update(array $data);
/**
* Delete an existing model.
*
* @param int $id Model id
* @return mixed
*/
public function delete($id);
}
================================================
FILE: app/Repositories/Role/EloquentRole.php
================================================
<?php
namespace App\Repositories\Role;
use App\Repositories\AbstractEloquentRepository;
use Illuminate\Database\Eloquent\Model;
class EloquentRole extends AbstractEloquentRepository implements RoleInterface
{
/**
* Create a new repository instance.
*
* @param \Illuminate\Database\Eloquent\Model $role
* @return void
*/
public function __construct(Model $role)
{
$this->model = $role;
}
/**
* Get paginated roles.
*
* @param int $page Page number
* @param int $limit Number of roles per page
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function byPage($page = 1, $limit = 10)
{
$roles = $this->model->orderBy('name')
->skip($limit * ($page - 1))
->take($limit)
->paginate($limit);
return $roles;
}
}
================================================
FILE: app/Repositories/Role/RoleInterface.php
================================================
<?php
namespace App\Repositories\Role;
use App\Repositories\RepositoryInterface;
interface RoleInterface extends RepositoryInterface
{
}
================================================
FILE: app/Repositories/Server/EloquentServer.php
================================================
<?php
namespace App\Repositories\Server;
use App\Repositories\AbstractEloquentRepository;
use Illuminate\Database\Eloquent\Model;
class EloquentServer extends AbstractEloquentRepository implements ServerInterface
{
/**
* Create a new repository instance.
*
* @param \Illuminate\Database\Eloquent\Model $server
* @return void
*/
public function __construct(Model $server)
{
$this->model = $server;
}
/**
* Get paginated servers.
*
* @param int $page Page number
* @param int $limit Number of servers per page
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function byPage($page = 1, $limit = 10)
{
$servers = $this->model->orderBy('name')
->skip($limit * ($page - 1))
->take($limit)
->paginate($limit);
return $servers;
}
}
================================================
FILE: app/Repositories/Server/ServerInterface.php
================================================
<?php
namespace App\Repositories\Server;
use App\Repositories\RepositoryInterface;
interface ServerInterface extends RepositoryInterface
{
}
================================================
FILE: app/Repositories/Setting/AppSettingInterface.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Repositories\Setting\SettingInterface;
interface AppSettingInterface extends SettingInterface
{
}
================================================
FILE: app/Repositories/Setting/ConfigAppSetting.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Services\Config\ConfigReaderInterface;
use App\Services\Config\ConfigWriterInterface;
use App\Entities\Setting\AppSettingEntity;
use App\Repositories\AbstractConfigRepository;
use App\Repositories\Setting\AppSettingInterface;
class ConfigAppSetting extends AbstractConfigRepository implements AppSettingInterface
{
public function all()
{
$url = $this->reader->getConfig('APP_URL');
$appSetting = new AppSettingEntity;
$appSetting->setUrl($url);
return $appSetting;
}
public function update(array $data)
{
$this->writer->setConfig('APP_URL', $data['url']);
return true;
}
}
================================================
FILE: app/Repositories/Setting/ConfigDbSetting.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Services\Config\ConfigReaderInterface;
use App\Services\Config\ConfigWriterInterface;
use App\Entities\Setting\DbSettingEntity;
use App\Repositories\AbstractConfigRepository;
use App\Repositories\Setting\DbSettingInterface;
class ConfigDbSetting extends AbstractConfigRepository implements DbSettingInterface
{
public function all()
{
$driver = $this->reader->getConfig('DB_DRIVER');
$host = $this->reader->getConfig('DB_HOST');
$database = $this->reader->getConfig('DB_DATABASE');
$username = $this->reader->getConfig('DB_USERNAME');
$password = $this->reader->getConfig('DB_PASSWORD');
$dbSetting = new DbSettingEntity;
$dbSetting->setDriver($driver)
->setHost($host)
->setDatabase($database)
->setUsername($username)
->setPassword($password);
return $dbSetting;
}
public function update(array $data)
{
$this->writer->setConfig('DB_DRIVER', $data['driver']);
$this->writer->setConfig('DB_HOST', $data['host']);
$this->writer->setConfig('DB_DATABASE', $data['database']);
$this->writer->setConfig('DB_USERNAME', $data['username']);
$this->writer->setConfig('DB_PASSWORD', $data['password']);
return true;
}
}
================================================
FILE: app/Repositories/Setting/ConfigMailSetting.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Services\Config\ConfigReaderInterface;
use App\Services\Config\ConfigWriterInterface;
use App\Entities\Setting\MailSettingEntity;
use App\Repositories\AbstractConfigRepository;
use App\Repositories\Setting\MailSettingInterface;
class ConfigMailSetting extends AbstractConfigRepository implements MailSettingInterface
{
public function all()
{
$driver = $this->reader->getConfig('MAIL_DRIVER');
$fromAddress = $this->reader->getConfig('MAIL_FROM_ADDRESS');
$fromName = $this->reader->getConfig('MAIL_FROM_NAME');
$smtpHost = $this->reader->getConfig('MAIL_HOST');
$smtpPort = $this->reader->getConfig('MAIL_PORT');
$smtpEncryption = $this->reader->getConfig('MAIL_ENCRYPTION');
$smtpUsername = $this->reader->getConfig('MAIL_USERNAME');
$smtpPassword = $this->reader->getConfig('MAIL_PASSWORD');
$sendmailPath = $this->reader->getConfig('MAIL_SENDMAIL');
$from = [
'address' => $fromAddress,
'name' => $fromName,
];
$mailSetting = new MailSettingEntity;
$mailSetting->setDriver($driver)
->setFrom($from)
->setSmtpHost($smtpHost)
->setSmtpPort($smtpPort)
->setSmtpEncryption($smtpEncryption)
->setSmtpUsername($smtpUsername)
->setSmtpPassword($smtpPassword)
->setSendmailPath($sendmailPath);
return $mailSetting;
}
public function update(array $data)
{
$this->writer->setConfig('MAIL_DRIVER', $data['driver']);
$this->writer->setConfig('MAIL_FROM_ADDRESS', $data['from_address']);
$this->writer->setConfig('MAIL_FROM_NAME', $data['from_name']);
$this->writer->setConfig('MAIL_HOST', $data['smtp_host']);
$this->writer->setConfig('MAIL_PORT', $data['smtp_port']);
$this->writer->setConfig('MAIL_ENCRYPTION', $data['smtp_encryption']);
$this->writer->setConfig('MAIL_USERNAME', $data['smtp_username']);
$this->writer->setConfig('MAIL_PASSWORD', $data['smtp_password']);
$this->writer->setConfig('MAIL_SENDMAIL', $data['sendmail_path']);
return true;
}
}
================================================
FILE: app/Repositories/Setting/DbSettingInterface.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Repositories\Setting\SettingInterface;
interface DbSettingInterface extends SettingInterface
{
}
================================================
FILE: app/Repositories/Setting/EloquentSetting.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Repositories\AbstractEloquentRepository;
use App\Repositories\Setting\SettingInterface;
use App\Entities\Setting\MailSettingEntity;
use Illuminate\Database\Eloquent\Model;
class EloquentSetting extends AbstractEloquentRepository implements SettingInterface
{
/**
* Create a new repository instance.
*
* @param \Illuminate\Database\Eloquent\Model $setting
* @return void
*/
public function __construct(Model $setting)
{
$this->model = $setting;
}
/**
* Get a model by setting type. If a model does not exist, create a new model.
*
* @param string $id Setting type
* @return \Illuminate\Database\Eloquent\Model
*/
public function byType($type)
{
$setting = $this->model->where('type', $type)->first();
if (!is_null($setting)) {
return $setting;
}
if ($type === 'mail') {
$attributes = new MailSettingEntity;
$attributes->setDriver('smtp');
$attributes->setFrom([
'address' => 'webloyer@example.com',
'name' => 'Webloyer',
]);
$attributes->setSmtpHost('smtp.mailgun.org');
$attributes->setSmtpPort(587);
$attributes->setSmtpEncryption('tls');
$attributes->setSendmailPath('/usr/sbin/sendmail -bs');
}
return $this->model->create([
'type' => $type,
'attributes' => $attributes,
]);
}
/**
* Update an existing model has a same type.
*
* @param array $data Data to update a model
* @return boolean
*/
public function updateByType(array $data)
{
$setting = $this->model->where('type', $data['type'])->first();
$setting->update($data);
return true;
}
}
================================================
FILE: app/Repositories/Setting/MailSettingInterface.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Repositories\Setting\SettingInterface;
interface MailSettingInterface extends SettingInterface
{
}
================================================
FILE: app/Repositories/Setting/SettingInterface.php
================================================
<?php
namespace App\Repositories\Setting;
use App\Repositories\RepositoryInterface;
interface SettingInterface extends RepositoryInterface
{
}
================================================
FILE: app/Repositories/User/EloquentUser.php
================================================
<?php
namespace App\Repositories\User;
use App\Repositories\AbstractEloquentRepository;
use Illuminate\Database\Eloquent\Model;
class EloquentUser extends AbstractEloquentRepository implements UserInterface
{
/**
* Create a new repository instance.
*
* @param \Illuminate\Database\Eloquent\Model $user
* @return void
*/
public function __construct(Model $user)
{
$this->model = $user;
}
/**
* Get paginated users.
*
* @param int $page Page number
* @param int $limit Number of users per page
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function byPage($page = 1, $limit = 10)
{
$users = $this->model->orderBy('name')
->skip($limit * ($page - 1))
->take($limit)
->paginate($limit);
return $users;
}
}
================================================
FILE: app/Repositories/User/UserInterface.php
================================================
<?php
namespace App\Repositories\User;
use App\Repositories\RepositoryInterface;
interface UserInterface extends RepositoryInterface
{
}
================================================
FILE: app/Services/Api/JsonRpc.php
================================================
<?php
namespace App\Services\Api;
use App\Repositories\Project\ProjectInterface;
use App\Services\Form\Deployment\DeploymentForm;
use Auth;
use InvalidArgumentException;
class JsonRpc
{
protected $project;
protected $deploymentForm;
/**
* Create a new controller instance.
*
* @param \App\Repositories\Project\ProjectInterface $project
* @param \App\Services\Form\Deployment\DeploymentForm $deploymentForm
* @return void
*/
public function __construct(ProjectInterface $project, DeploymentForm $deploymentForm)
{
$this->project = $project;
$this->deploymentForm = $deploymentForm;
}
/**
* Deploy a project.
*
* @param int $project_id
* @return \App\Models\Deployment
*/
public function deploy($project_id)
{
$input = [
'status' => null,
'message' => null,
'project_id' => $project_id,
'user_id' => Auth::guard('api')->user()->id,
'task' => 'deploy',
];
if ($this->deploymentForm->save($input)) {
$project = $this->project->byId($project_id);
$deployment = $project->getLastDeployment();
return $deployment;
} else {
throw new InvalidArgumentException($this->deploymentForm->errors());
}
}
/**
* Roll back a deployment.
*
* @param int $project_id
* @return \App\Models\Deployment
*/
public function rollback($project_id)
{
$input = [
'status' => null,
'message' => null,
'project_id' => $project_id,
'user_id' => Auth::guard('api')->user()->id,
'task' => 'rollback',
];
if ($this->deploymentForm->save($input)) {
$project = $this->project->byId($project_id);
$deployment = $project->getLastDeployment();
return $deployment;
} else {
throw new InvalidArgumentException($this->deploymentForm->errors());
}
}
}
================================================
FILE: app/Services/Api/Middleware/Authenticate.php
================================================
<?php
namespace App\Services\Api\Middleware;
use JsonRPC\MiddlewareInterface;
use JsonRPC\Exception\AuthenticationFailureException;
use Illuminate\Http\Request;
use Auth;
class Authenticate implements MiddlewareInterface
{
protected $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function execute($username, $password, $procedureName)
{
$user = Auth::guard('api')->setRequest($this->request)->user();
if (is_null($user)) {
throw new AuthenticationFailureException('Wrong credentials!');
}
}
}
================================================
FILE: app/Services/Config/ConfigReaderInterface.php
================================================
<?php
namespace App\Services\Config;
interface ConfigReaderInterface
{
/**
* Get configuration.
*
* @param string $name Configuration name
* @return mixed
*/
public function getConfig($name);
}
================================================
FILE: app/Services/Config/ConfigWriterInterface.php
================================================
<?php
namespace App\Services\Config;
interface ConfigWriterInterface
{
/**
* Set configuration.
*
* @param string $name Configuration name
* @param string $value Configuration value
* @return mixed
*/
public function setConfig($name, $value);
}
================================================
FILE: app/Services/Config/DotenvReader.php
================================================
<?php
namespace App\Services\Config;
use App\Services\Config\ConfigReaderInterface;
use App\Services\Filesystem\FilesystemInterface;
class DotenvReader implements ConfigReaderInterface
{
protected $fs;
protected $path;
public function __construct(FilesystemInterface $fs, $path)
{
$this->fs = $fs;
$this->path = $path;
}
/**
* Get configuration from a .env file.
*
* @param string $name Configuration name
* @return string|null
*/
public function getConfig($name)
{
$contents = $this->fs->get($this->path);
if (preg_match("/^$name=(.*)$/m", $contents, $matches)) {
$value = $matches[1];
$value = $this->nullIfBlank($value);
} else {
$value = null;
}
return $value;
}
protected function nullIfBlank($value)
{
return trim($value) !== '' ? $value : null;
}
}
================================================
FILE: app/Services/Config/DotenvWriter.php
================================================
<?php
namespace App\Services\Config;
use App\Services\Config\ConfigWriterInterface;
use App\Services\Filesystem\FilesystemInterface;
class DotenvWriter implements ConfigWriterInterface
{
protected $fs;
protected $path;
public function __construct(FilesystemInterface $fs, $path)
{
$this->fs = $fs;
$this->path = $path;
}
/**
* Set configuration to a .env file.
*
* @param string $name Configuration name
* @param string $value Configuration value
* @return mixed
*/
public function setConfig($name, $value)
{
$contents = $this->fs->get($this->path);
if (preg_match("/^$name=.*$/m", $contents)) {
$contents = preg_replace("/^$name=.*$/m", "$name=$value", $contents);
} else {
$contents .= "$name=$value".PHP_EOL;
}
return $this->fs->put($this->path, $contents);
}
}
================================================
FILE: app/Services/Deployment/DeployCommanderInterface.php
================================================
<?php
namespace App\Services\Deployment;
interface DeployCommanderInterface
{
/**
* Give the command to deploy
*
* @param mixed $deployment
* @return boolean
*/
public function deploy($deployment);
/**
* Give the command to rollback
*
* @param mixed $deployment
* @return boolean
*/
public function rollback($deployment);
}
================================================
FILE: app/Services/Deployment/DeployerDeploymentFileBuilder.php
================================================
<?php
namespace App\Services\Deployment;
use App\Services\Deployment\DeployerFile;
use App\Services\Filesystem\FilesystemInterface;
use Illuminate\Database\Eloquent\Model;
class DeployerDeploymentFileBuilder implements DeployerFileBuilderInterface
{
protected $fs;
protected $deployerFile;
protected $project;
protected $serverListFile;
protected $recipeFile;
public function __construct(FilesystemInterface $fs, DeployerFile $deployerFile)
{
$this->fs = $fs;
$this->deployerFile = $deployerFile;
}
public function __destruct()
{
$this->fs->delete($this->deployerFile->getFullPath());
}
/**
* Set a deployment file path info.
*
* @return \App\Services\Deployment\DeployerDeploymentFileBuilder $this
*/
public function pathInfo()
{
$id = md5(uniqid(rand(), true));
$baseName = "deploy_$id.php";
$fullPath = storage_path("app/$baseName");
$this->deployerFile->setBaseName($baseName);
$this->deployerFile->setFullPath($fullPath);
return $this;
}
/**
* Put a deployment file.
*
* @return \App\Services\Deployment\DeployerDeploymentFileBuilder $this
*/
public function put()
{
$fullPath = $this->deployerFile->getFullPath();
$contents[] = '<?php';
// Declare a namespace
$contents[] = 'namespace Deployer;';
// Include recipe files
foreach ($this->recipeFile as $recipeFile) {
$contents[] = "require '{$recipeFile->getFullPath()}';";
}
// Set a repository
$contents[] = "set('repository', '{$this->project->repository}');";
// Load a server list file
$contents[] = "serverList('{$this->serverListFile->getFullPath()}');";
$this->fs->put($fullPath, implode(PHP_EOL, $contents));
return $this;
}
/**
* Get a deployment file instance.
*
* @return \App\Services\Deployment\DeployerFile
*/
public function getResult()
{
return $this->deployerFile;
}
/**
* Set a project model instance.
*
* @param \Illuminate\Database\Eloquent\Model $project
* @return \App\Services\Deployment\DeployerDeploymentFileBuilder $this
*/
public function setProject(Model $project)
{
$this->project = $project;
return $this;
}
/**
* Set a server list file instance.
*
* @param \App\Services\Deployment\DeployerFile $serverListFile
* @return \App\Services\Deployment\DeployerDeploymentFileBuilder $this
*/
public function setServerListFile(DeployerFile $serverListFile)
{
$this->serverListFile = $serverListFile;
return $this;
}
/**
* Set recipe file instances.
*
* @param array $recipeFile
* @return \App\Services\Deployment\DeployerDeploymentFileBuilder $this
*/
public function setRecipeFile(array $recipeFile)
{
$this->recipeFile = $recipeFile;
return $this;
}
}
================================================
FILE: app/Services/Deployment/DeployerFile.php
================================================
<?php
namespace App\Services\Deployment;
class DeployerFile
{
protected $baseName;
protected $fullPath;
/**
* Get a base name.
*
* @return string
*/
public function getBaseName()
{
return $this->baseName;
}
/**
* Get a full path.
*
* @return string
*/
public function getFullPath()
{
return $this->fullPath;
}
/**
* Set a base name.
*
* @param string Base name
* @return \App\Services\Deployment\DeployerFile $this
*/
public function setBaseName($baseName)
{
$this->baseName = $baseName;
return $this;
}
/**
* Set a full path.
*
* @param string Full path
* @return \App\Services\Deployment\DeployerFile $this
*/
public function setFullPath($fullPath)
{
$this->fullPath = $fullPath;
return $this;
}
}
================================================
FILE: app/Services/Deployment/DeployerFileBuilderInterface.php
================================================
<?php
namespace App\Services\Deployment;
interface DeployerFileBuilderInterface
{
/**
* Set a deployer file path info.
*
* @return \App\Services\Deployment\DeployerFileBuilderInterface $this
*/
public function pathInfo();
/**
* Put a deployer file.
*
* @return \App\Services\Deployment\DeployerFileBuilderInterface $this
*/
public function put();
/**
* Get a deployer file instance.
*
* @return \App\Services\Deployment\DeployerFile
*/
public function getResult();
}
================================================
FILE: app/Services/Deployment/DeployerFileDirector.php
================================================
<?php
namespace App\Services\Deployment;
class DeployerFileDirector
{
protected $fileBuilder;
public function __construct(DeployerFileBuilderInterface $fileBuilder)
{
$this->fileBuilder = $fileBuilder;
}
/**
* Construct a deployer file instance.
*
* @return \App\Services\Deployment\DeployerFile
*/
public function construct()
{
$this->fileBuilder->pathInfo();
$this->fileBuilder->put();
return $this->fileBuilder->getResult();
}
}
================================================
FILE: app/Services/Deployment/DeployerRecipeFileBuilder.php
================================================
<?php
namespace App\Services\Deployment;
use App\Services\Deployment\DeployerFile;
use App\Services\Filesystem\FilesystemInterface;
use Illuminate\Database\Eloquent\Model;
class DeployerRecipeFileBuilder implements DeployerFileBuilderInterface
{
protected $fs;
protected $deployerFile;
protected $recipe;
public function __construct(FilesystemInterface $fs, DeployerFile $deployerFile)
{
$this->fs = $fs;
$this->deployerFile = $deployerFile;
}
public function __destruct()
{
$this->fs->delete($this->deployerFile->getFullPath());
}
/**
* Set a recipe file path info.
*
* @return \App\Services\Deployment\DeployerRecipeFileBuilder $this
*/
public function pathInfo()
{
$id = md5(uniqid(rand(), true));
$baseName = "recipe_$id.php";
$fullPath = storage_path("app/$baseName");
$this->deployerFile->setBaseName($baseName);
$this->deployerFile->setFullPath($fullPath);
return $this;
}
/**
* Put a recipe file.
*
* @return \App\Services\Deployment\DeployerRecipeFileBuilder $this
*/
public function put()
{
$fullPath = $this->deployerFile->getFullPath();
$contents = $this->recipe->body;
$this->fs->put($fullPath, $contents);
return $this;
}
/**
* Get a recipe file instance.
*
* @return \App\Services\Deployment\DeployerFile
*/
public function getResult()
{
return $this->deployerFile;
}
/**
* Set a recipe model instance.
*
* @param \Illuminate\Database\Eloquent\Model $recipe
* @return \App\Services\Deployment\DeployerRecipeFileBuilder $this
*/
public function setRecipe(Model $recipe)
{
$this->recipe = $recipe;
return $this;
}
}
================================================
FILE: app/Services/Deployment/DeployerServerListFileBuilder.php
================================================
<?php
namespace App\Services\Deployment;
use App\Services\Deployment\DeployerFile;
use App\Services\Filesystem\FilesystemInterface;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Dumper;
class DeployerServerListFileBuilder implements DeployerFileBuilderInterface
{
protected $fs;
protected $deployerFile;
protected $yamlParser;
protected $yamlDumper;
protected $server;
protected $project;
public function __construct(FilesystemInterface $fs, DeployerFile $deployerFile, Parser $parser, Dumper $dumper)
{
$this->fs = $fs;
$this->deployerFile = $deployerFile;
$this->yamlParser = $parser;
$this->yamlDumper = $dumper;
}
public function __destruct()
{
$this->fs->delete($this->deployerFile->getFullPath());
}
/**
* Set a server list file path info.
*
* @return \App\Services\ServerList\DeployerServerListFileBuilder $this
*/
public function pathInfo()
{
$id = md5(uniqid(rand(), true));
$baseName = "server_$id.yml";
$fullPath = storage_path("app/$baseName");
$this->deployerFile->setBaseName($baseName);
$this->deployerFile->setFullPath($fullPath);
return $this;
}
/**
* Put a server list file.
*
* @return \App\Services\ServerList\DeployerServerListFileBuilder $this
*/
public function put()
{
$fullPath = $this->deployerFile->getFullPath();
$contents = $this->server->body;
// Override settings in a server list file
$serverList = $this->yamlParser->parse($contents);
$projectAttributes = $this->project->attributes;
if (!is_null($projectAttributes)) {
foreach ($serverList as $i => $server) {
if (!is_null($projectAttributes->getDeployPath())) {
$serverList[$i]['deploy_path'] = $projectAttributes->getDeployPath();
}
}
}
$newContents = $this->yamlDumper->dump($serverList);
$this->fs->put($fullPath, $newContents);
return $this;
}
/**
* Get a server list file instance.
*
* @return \App\Services\Deployment\DeployerFile
*/
public function getResult()
{
return $this->deployerFile;
}
/**
* Set a server model instance.
*
* @param \Illuminate\Database\Eloquent\Model $server
* @return \App\Services\ServerList\DeployerServerListFileBuilder $this
*/
public function setServer(Model $server)
{
$this->server = $server;
return $this;
}
/**
* Set a project model instance.
*
* @param \Illuminate\Database\Eloquent\Model $project
* @return \App\Services\ServerList\DeployerServerListFileBuilder $this
*/
public function setProject(Model $project)
{
$this->project = $project;
return $this;
}
}
================================================
FILE: app/Services/Deployment/QueueDeployCommander.php
================================================
<?php
namespace App\Services\Deployment;
use App\Jobs\Deploy;
use App\Jobs\Rollback;
use Illuminate\Contracts\Bus\Dispatcher;
class QueueDeployCommander implements DeployCommanderInterface
{
protected $dispatcher;
public function __construct(Dispatcher $dispatcher)
{
$this->dispatcher = $dispatcher;
}
/**
* Give the command to deploy
*
* @param mixed $deployment
* @return boolean
*/
public function deploy($deployment)
{
$this->dispatcher->dispatch(
new Deploy($deployment)
);
}
/**
* Give the command to rollback
*
* @param mixed $deployment
* @return boolean
*/
public function rollback($deployment)
{
$this->dispatcher->dispatch(
new Rollback($deployment)
);
}
}
================================================
FILE: app/Services/Deployment/StorageDeployCommander.php
================================================
<?php
namespace App\Services\Deployment;
use Storage;
class StorageDeployCommander implements DeployCommanderInterface
{
/**
* Give the command to deploy
*
* @param mixed $deployment
* @return boolean
*/
public function deploy($deployment)
{
if (!Storage::put('deploy.json', $deployment)) {
return false;
} else {
return true;
}
}
/**
* Give the command to rollback
*
* @param mixed $deployment
* @return boolean
*/
public function rollback($deployment)
{
if (!Storage::put('rollback.json', $deployment)) {
return false;
} else {
return true;
}
}
}
================================================
FILE: app/Services/Filesystem/FilesystemInterface.php
================================================
<?php
namespace App\Services\Filesystem;
interface FilesystemInterface
{
/**
* Write a file.
*
* @param string $path File path
* @param string $contents Contents to write a file
* @return mixed
*/
public function put($path, $contents);
/**
* Read a file.
*
* @param string $path File path
* @return string Contents
*/
public function get($path);
}
================================================
FILE: app/Services/Filesystem/LaravelFilesystem.php
================================================
<?php
namespace App\Services\Filesystem;
use App\Services\Filesystem\FilesystemInterface;
use Illuminate\Filesystem\Filesystem;
class LaravelFilesystem implements FilesystemInterface
{
protected $fs;
public function __construct(Filesystem $fs)
{
$this->fs = $fs;
}
/**
* Write a file.
*
* @param string $path File path
* @param string $contents Contents to write a file
* @return mixed
*/
public function put($path, $contents)
{
return $this->fs->put($path, $contents);
}
/**
* Read a file.
*
* @param string $path File path
* @return string Contents
*/
public function get($path)
{
return $this->fs->get($path);
}
/**
* Delete a file.
*
* @param string $path File path
* @return boolean
*/
public function delete($path)
{
return $this->fs->delete($path);
}
}
================================================
FILE: app/Services/Form/Deployment/DeploymentForm.php
================================================
<?php
namespace App\Services\Form\Deployment;
use App\Services\Validation\ValidableInterface;
use App\Services\Deployment\DeployCommanderInterface;
use App\Repositories\Project\ProjectInterface;
use DB;
class DeploymentForm
{
protected $validator;
protected $project;
protected $deployCommander;
/**
* Create a new form service instance.
*
* @param \App\Services\Validation\ValidableInterface $validator
* @param \App\Repositories\Project\ProjectInterface $project
* @param \App\Services\Deployment\DeployCommanderInterface $deployCommander
* @return void
*/
public function __construct(ValidableInterface $validator, ProjectInterface $project, DeployCommanderInterface $deployCommander)
{
$this->validator = $validator;
$this->project = $project;
$this->deployCommander = $deployCommander;
}
/**
* Create a new deployment.
*
* @param array $input Data to create a deployment
* @return boolean
*/
public function save(array $input)
{
if (!$this->valid($input)) {
return false;
}
$deployment = DB::transaction(function () use ($input) {
$project = $this->project->byId($input['project_id']);
$maxDeployment = $project->getMaxDeployment();
$input['number'] = $maxDeployment->number + 1;
$project->addDeployment($input);
$project->updateMaxDeployment(['number' => $input['number']]);
$deployment = $project->getDeploymentByNumber($input['number']);
return $deployment;
});
if (!$deployment) {
return false;
}
$this->deployCommander->{$input['task']}($deployment);
return true;
}
/**
* Return validation errors.
*
* @return array
*/
public function errors()
{
return $this->validator->errors();
}
/**
* Test whether form validator passes.
*
* @return boolean
*/
protected function valid(array $input)
{
return $this->validator->with($input)->passes();
}
}
================================================
FILE: app/Services/Form/Deployment/DeploymentFormLaravelValidator.php
================================================
<?php
namespace App\Services\Form\Deployment;
use App\Services\Validation\AbstractLaravelValidator;
class DeploymentFormLaravelValidator extends AbstractLaravelValidator
{
protected $rules = [
'project_id' => 'required|exists:projects,id',
'task' => 'required|in:deploy,rollback',
'user_id' => 'required|exists:users,id',
];
}
================================================
FILE: app/Services/Form/Project/ProjectForm.php
================================================
<?php
namespace App\Services\Form\Project;
use App\Services\Validation\ValidableInterface;
use App\Repositories\Project\ProjectInterface;
use DB;
class ProjectForm
{
protected $validator;
protected $project;
/**
* Create a new form service instance.
*
* @param \App\Services\Validation\ValidableInterface $validator
* @param \App\Repositories\Project\ProjectInterface $project
* @return void
*/
public function __construct(ValidableInterface $validator, ProjectInterface $project)
{
$this->validator = $validator;
$this->project = $project;
}
/**
* Create a new project.
*
* @param array $input Data to create a project
* @return boolean
*/
public function save(array $input)
{
$input['recipe_id'] = explode(',', $input['recipe_id_order']);
if (!$this->valid($input)) {
return false;
}
DB::transaction(function () use ($input) {
$projectAttribute = new \App\Entities\ProjectAttribute\ProjectAttributeEntity;
if (!empty($input['deploy_path'])) {
$projectAttribute->setDeployPath($input['deploy_path']);
}
$input['attributes'] = $projectAttribute;
if (isset($input['keep_last_deployment'])) {
$input['keep_last_deployment'] = true;
} else {
$input['keep_last_deployment'] = false;
}
$project = $this->project->create($input);
$project->addMaxDeployment();
$project->syncRecipes($input['recipe_id']);
});
return true;
}
/**
* Update an existing project.
*
* @param array $input Data to update a project
* @return boolean
*/
public function update(array $input)
{
$input['recipe_id'] = explode(',', $input['recipe_id_order']);
if (!$this->valid($input)) {
return false;
}
DB::transaction(function () use ($input) {
$project = $this->project->byId($input['id']);
$project->syncRecipes($input['recipe_id']);
$projectAttribute = new \App\Entities\ProjectAttribute\ProjectAttributeEntity;
if (!empty($input['deploy_path'])) {
$projectAttribute->setDeployPath($input['deploy_path']);
}
$input['attributes'] = $projectAttribute;
if (isset($input['keep_last_deployment'])) {
$input['keep_last_deployment'] = true;
} else {
$input['keep_last_deployment'] = false;
}
$this->project->update($input);
});
return true;
}
/**
* Return validation errors.
*
* @return array
*/
public function errors()
{
return $this->validator->errors();
}
/**
* Test whether form validator passes.
*
* @return boolean
*/
protected function valid(array $input)
{
return $this->validator->with($input)->passes();
}
}
================================================
FILE: app/Services/Form/Project/ProjectFormLaravelValidator.php
================================================
<?php
namespace App\Services\Form\Project;
use App\Services\Validation\AbstractLaravelValidator;
class ProjectFormLaravelValidator extends AbstractLaravelValidator
{
protected $rules = [
'name' => 'required',
'stage' => 'required',
'recipe_id' => 'required',
'server_id' => 'required|exists:servers,id',
'repository' => 'required|url',
'deploy_path' => 'string',
'email_notification_recipient' => 'email',
'days_to_keep_deployments' => 'integer|min:1',
'max_number_of_deployments_to_keep' => 'integer|min:1',
'keep_last_deployment' => 'boolean',
'github_webhook_secret' => 'string',
];
protected function rules()
{
$rules = [];
if (isset($this->data['recipe_id'])) {
foreach ($this->data['recipe_id'] as $key => $val) {
$rules["recipe_id.$key"] = 'required|exists:recipes,id';
}
}
// HACK Laravel 5.2 URL validation doesn't work with PHP 7.3 due to preg_match() error.
if (version_compare(phpversion(), '7.3.0', '>=')) {
$rules['repository'] = 'required';
}
return $rules;
}
}
================================================
FILE: app/Services/Form/Recipe/RecipeForm.php
================================================
<?php
namespace App\Services\Form\Recipe;
use App\Services\Validation\ValidableInterface;
use App\Repositories\Recipe\RecipeInterface;
class RecipeForm
{
protected $validator;
protected $recipe;
/**
* Create a new form service instance.
*
* @param \App\Services\Validation\ValidableInterface $validator
* @param \App\Repositories\Recipe\RecipeInterface $recipe
* @return void
*/
public function __construct(ValidableInterface $validator, RecipeInterface $recipe)
{
$this->validator = $validator;
$this->recipe = $recipe;
}
/**
* Create a new recipe.
*
* @param array $input Data to create a recipe
* @return boolean
*/
public function save(array $input)
{
if (!$this->valid($input)) {
return false;
}
return $this->recipe->create($input);
}
/**
* Update an existing recipe.
*
* @param array $input Data to update a recipe
* @return boolean
*/
public function update(array $input)
{
if (!$this->valid($input)) {
return false;
}
return $this->recipe->update($input);
}
/**
* Return validation errors.
*
* @return array
*/
public function errors()
{
return $this->validator->errors();
}
/**
* Test whether form validator passes.
*
* @return boolean
*/
protected function valid(array $input)
{
return $this->validator->with($input)->passes();
}
}
================================================
FILE: app/Services/Form/Recipe/RecipeFormLaravelValidator.php
================================================
<?php
namespace App\Services\Form\Recipe;
use App\Services\Validation\AbstractLaravelValidator;
class RecipeFormLaravelValidator extends AbstractLaravelValidator
{
protected $rules = [
'name' => 'required',
'body' => 'required',
];
}
================================================
FILE: app/Services/Form/Server/ServerForm.php
================================================
<?php
namespace App\Services\Form\Server;
use App\Services\Validation\ValidableInterface;
use App\Repositories\Server\ServerInterface;
class ServerForm
{
protected $validator;
protected $server;
/**
* Create a new form service instance.
*
* @param \App\Services\Validation\ValidableInterface $validator
* @param \App\Repositories\Server\ServerInterface $server
* @return void
*/
public function __construct(ValidableInterface $validator, ServerInterface $server)
{
$this->validator = $validator;
$this->server = $server;
}
/**
* Create a new server.
*
* @param array $input Data to create a server
* @return boolean
*/
public function save(array $input)
{
if (!$this->valid($input)) {
return false;
}
return $this->server->create($input);
}
/**
* Update an existing server.
*
* @param array $input Data to update a server
* @return boolean
*/
public function update(array $input)
{
if (!$this->valid($input)) {
return false;
}
return $this->server->update($input);
}
/**
* Return validation errors.
*
* @return array
*/
public function errors()
{
return $this->validator->errors();
}
/**
* Test whether form validator passes.
*
* @return boolean
*/
protected function valid(array $input)
{
return $this->validator->with($input)->passes();
}
}
================================================
FILE: app/Services/Form/Server/ServerFormLaravelValidator.php
================================================
<?php
namespace App\Services\Form\Server;
use App\Services\Validation\AbstractLaravelValidator;
class ServerFormLaravelValidator extends AbstractLaravelValidator
{
protected $rules = [
'name' => 'required',
'body' => 'required',
];
}
================================================
FILE: app/Services/Form/Setting/MailSettingForm.php
================================================
<?php
namespace App\Services\Form\Setting;
use App\Services\Validation\ValidableInterface;
use App\Repositories\Setting\SettingInterface;
class MailSettingForm
{
protected $validator;
protected $setting;
/**
* Create a new form service instance.
*
* @param \App\Services\Validation\ValidableInterface $validator
* @param \App\Repositories\Setting\SettingInterface $setting
* @return void
*/
public function __construct(ValidableInterface $validator, SettingInterface $setting)
{
$this->validator = $validator;
$this->setting = $setting;
}
/**
* Update an existing setting.
*
* @param array $input Data to update a setting
* @return boolean
*/
public function update(array $input)
{
if (!$this->valid($input)) {
return false;
}
foreach ($input as $key => $value) {
if ($value === '') {
$input[$key] = null;
}
}
$mailSetting = new \App\Entities\Setting\MailSettingEntity;
$mailSetting->setDriver($input['driver']);
$mailSetting->setFrom([
'address' => $input['from_address'],
'name' => $input['from_name'],
]);
$mailSetting->setSmtpHost($input['smtp_host']);
$mailSetting->setSmtpPort($input['smtp_port']);
$mailSetting->setSmtpEncryption($input['smtp_encryption']);
$mailSetting->setSmtpUsername($input['smtp_username']);
$mailSetting->setSmtpPassword($input['smtp_password']);
$mailSetting->setSendmailPath($input['sendmail_path']);
$input['attributes'] = $mailSetting;
$input['type'] = 'mail';
$this->setting->updateByType($input);
return true;
}
/**
* Return validation errors.
*
* @return array
*/
public function errors()
{
return $this->validator->errors();
}
/**
* Test whether form validator passes.
*
* @return boolean
*/
protected function valid(array $input)
{
return $this->validator->with($input)->passes();
}
}
================================================
FILE: app/Services/Form/Setting/MailSettingFormLaravelValidator.php
================================================
<?php
namespace App\Services\Form\Setting;
use App\Services\Validation\AbstractLaravelValidator;
class MailSettingFormLaravelValidator extends AbstractLaravelValidator
{
protected $rules = [
'driver' => 'required|in:smtp,mail,sendmail',
'from_address' => 'required|email',
'from_name' => 'sometimes',
'smtp_host' => 'sometimes',
'smtp_port' => 'sometimes|integer|min:0|max:65535',
'smtp_encryption' => 'sometimes|in:tls,ssl',
'smtp_username' => 'sometimes',
'smtp_password' => 'sometimes',
'sendmail_path' => 'sometimes',
];
}
================================================
FILE: app/Services/Form/User/UserForm.php
================================================
<?php
namespace App\Services\Form\User;
use DB;
use Hash;
use App\Services\Validation\ValidableInterface;
use App\Repositories\User\UserInterface;
class UserForm
{
protected $validator;
protected $user;
/**
* Create a new form service instance.
*
* @param \App\Services\Validation\ValidableInterface $validator
* @param \App\Repositories\User\UserInterface $user
* @return void
*/
public function __construct(ValidableInterface $validator, UserInterface $user)
{
$this->validator = $validator;
$this->user = $user;
}
/**
* Create a new user.
*
* @param array $input Data to create a user
* @return boolean
*/
public function save(array $input)
{
if (!$this->valid($input)) {
return false;
}
if (isset($input['password'])) {
$input['password'] = Hash::make($input['password']);
}
$input['api_token'] = str_random(60);
DB::transaction(function () use ($input) {
$user = $this->user->create($input);
if (isset($input['role'])) {
$user->assignRole($input['role']);
}
});
return true;
}
/**
* Update an existing user.
*
* @param array $input Data to update a user
* @return boolean
*/
public function update(array $input)
{
if (!$this->valid($input)) {
return false;
}
DB::transaction(function () use ($input) {
$this->user->update($input);
});
return true;
}
/**
* Update a password of an existing user.
*
* @param array $input Data to update a user
* @return boolean
*/
public function updatePassword(array $input)
{
if (!$this->valid($input)) {
return false;
}
$input['password'] = Hash::make($input['password']);
return $this->user->update($input);
}
/**
* Update a role of an existing user.
*
* @param array $input Data to update a user
* @return boolean
*/
public function updateRole(array $input)
{
if (!$this->valid($input)) {
return false;
}
if (!isset($input['role'])) {
$input['role'] = [];
}
DB::transaction(function () use ($input) {
$user = $this->user->byId($input['id']);
$user->revokeAllRoles();
if (!empty($input['role'])) {
$user->assignRole($input['role']);
}
});
return true;
}
public function regenerateApiToken(array $input)
{
$input['api_token'] = str_random(60);
return $this->user->update($input);
return true;
}
/**
* Return validation errors.
*
* @return array
*/
public function errors()
{
return $this->validator->errors();
}
/**
* Test whether form validator passes.
*
* @return boolean
*/
protected function valid(array $input)
{
return $this->validator->with($input)->passes();
}
}
================================================
FILE: app/Services/Form/User/UserFormLaravelValidator.php
================================================
<?php
namespace App\Services\Form\User;
use App\Services\Validation\AbstractLaravelValidator;
class UserFormLaravelValidator extends AbstractLaravelValidator
{
protected $rules = [
'name' => 'sometimes|required',
'password' => 'sometimes|required|min:8|confirmed',
'role' => 'sometimes|required',
];
protected function rules()
{
$rules = [];
// For role
if (isset($this->data['role'])) {
foreach ($this->data['role'] as $key => $val) {
$rules["role.$key"] = 'required|exists:roles,id';
}
}
// For email
$unique = 'unique:users,email';
if (isset($this->data['id'])) {
$unique .= ','.$this->data['id'];
}
$rules['email'] = "sometimes|required|email|$unique";
return $rules;
}
}
================================================
FILE: app/Services/Notification/MailNotifier.php
================================================
<?php
namespace App\Services\Notification;
use Mail;
class MailNotifier implements NotifierInterface
{
/**
* Recipient of notification.
*
* @var string
*/
protected $to;
/**
* Sender of notification.
*
* @var string
*/
protected $from;
/**
* Recipient of notification.
*
* @param string $to The recipient
* @return App\Services\Notification\NotifierInterface Return self for chainability
*/
public function to($to)
{
$this->to = $to;
return $this;
}
/**
* Sender of notification.
*
* @param string $from The sender
* @return App\Services\Notification\NotifierInterface Return self for chainability
*/
public function from($from)
{
$this->from = $from;
return $this;
}
/**
* Send notification.
*
* @param string $subject The subject of notification
* @param string $message The message of notification
* @return void
*/
public function notify($subject, $message)
{
Mail::raw($message, function ($m) use ($subject) {
$m->to($this->to)->subject($subject);
});
}
}
================================================
FILE: app/Services/Notification/NotifierInterface.php
================================================
<?php
namespace App\Services\Notification;
interface NotifierInterface
{
/**
* Recipient of notification.
*
* @var string
*/
public function to($to);
/**
* Sender of notification.
*
* @param string $from The sender
* @return App\Services\Notification\NotifierInterface Return self for chainability
*/
public function from($from);
/**
* Send notification.
*
* @param string $subject The subject of notification
* @param string $message The message of notification
* @return void
*/
public function notify($subject, $message);
}
================================================
FILE: app/Services/Validation/AbstractLaravelValidator.php
================================================
<?php
namespace App\Services\Validation;
use Illuminate\Validation\Factory;
abstract class AbstractLaravelValidator implements ValidableInterface
{
protected $validator;
protected $data = [];
protected $errors = [];
protected $rules = [];
/**
* Create a new validator instance.
*
* @param \Illuminate\Validation\Factory $validator
* @return void
*/
public function __construct(Factory $validator)
{
$this->validator = $validator;
}
/**
* Add data to validation.
*
* @param array Data to validation
* @return \App\Services\Validation\ValidableInterface $this
*/
public function with(array $data)
{
$this->data = $data;
return $this;
}
/**
* Test whether passes validation.
*
* @return boolean
*/
public function passes()
{
$rules = array_merge($this->rules, $this->rules());
$validator = $this->validator->make($this->data, $rules);
if ($validator->fails()) {
$this->errors = $validator->messages();
return false;
}
return true;
}
/**
* Return validation errors.
*
* @return array
*/
public function errors()
{
return $this->errors;
}
/**
* Return validation rules.
*
* @return array
*/
protected function rules()
{
return [];
}
}
================================================
FILE: app/Services/Validation/ValidableInterface.php
================================================
<?php
namespace App\Services\Validation;
interface ValidableInterface
{
/**
* Add data to validation.
*
* @param array Data to validation
* @return \App\Services\Validation\ValidableInterface $this
*/
public function with(array $input);
/**
* Test whether passes validation.
*
* @return boolean
*/
public function passes();
/**
* Return validation errors.
*
* @return array
*/
public function errors();
}
================================================
FILE: app/Specifications/DeploymentSpecification.php
================================================
<?php
namespace App\Specifications;
use Illuminate\Database\Eloquent\Model;
class DeploymentSpecification
{
/**
* Get elements that satisfy the specification.
*
* @param \Illuminate\Database\Eloquent\Model $project
* @return \Illuminate\Support\Collection
*/
public function satisfyingElementsFrom(Model $project)
{
return $project->getDeployments();
}
}
================================================
FILE: app/Specifications/OldDeploymentSpecification.php
================================================
<?php
namespace App\Specifications;
use Illuminate\Database\Eloquent\Model;
use DateTime;
class OldDeploymentSpecification extends DeploymentSpecification
{
protected $currentDate;
public function __construct(DateTime $currentDate)
{
$this->currentDate = $currentDate;
}
/**
* Get elements that satisfy the specification.
*
* @param \Illuminate\Database\Eloquent\Model $project
* @return \Illuminate\Support\Collection
*/
public function satisfyingElementsFrom(Model $project)
{
if ($project->getDeployments()->isEmpty()) {
return collect([]);
}
$oldDeployments = collect([]);
$pastDaysToKeepDeployments = collect([]);
$pastNumToKeepDeployments = collect([]);
if (!is_null($project->days_to_keep_deployments)) {
$currentDate = clone $this->currentDate;
$date = $currentDate->modify('-'.$project->days_to_keep_deployments.' days');
$pastDaysToKeepDeployments = $project->getDeploymentsWhereCreatedAtBefore($date);
if ($project->keep_last_deployment && $pastDaysToKeepDeployments->contains($project->getLastDeployment())) {
$pastDaysToKeepDeployments->shift();
}
}
if (!is_null($project->max_number_of_deployments_to_keep)) {
$number = $project->getLastDeployment()->number - $project->max_number_of_deployments_to_keep + 1;
$pastNumToKeepDeployments = $project->getDeploymentsWhereNumberBefore($number);
}
return $oldDeployments->merge($pastDaysToKeepDeployments)
->merge($pastNumToKeepDeployments)
->sortByDesc('number')
->unique('number')
->values();
}
}
================================================
FILE: app/Traits/RestExceptionHandlerTrait.php
================================================
<?php
namespace App\Traits;
use Exception;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
trait RestExceptionHandlerTrait
{
/**
* Create a new JSON response based on exception type.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\JsonResponse
*/
protected function getJsonResponseForException(Request $request, Exception $e)
{
if ($e instanceof HttpException) {
if ($e->getStatusCode() == 401) {
return $this->unauthorized();
} elseif ($e->getStatusCode() == 404) {
return $this->notFound();
} elseif ($e->getStatusCode() < 500) {
return $this->badRequest();
} else {
return $this->internalError();
}
} else {
return $this->internalError();
}
}
/**
* Return JSON response for bad request.
*
* @param string $message
* @param int $statusCode
* @return \Illuminate\Http\JsonResponse
*/
protected function badRequest($message = 'Bad request', $statusCode = 400)
{
return $this->jsonResponse(['error' => $message], $statusCode);
}
/**
* Return JSON response for unauthorized.
*
* @param string $message
* @param int $statusCode
* @return \Illuminate\Http\JsonResponse
*/
protected function unauthorized($message = 'Unauthorized', $statusCode = 401)
{
return $this->jsonResponse(['error' => $message], $statusCode);
}
/**
* Return JSON response for not found.
*
* @param string $message
* @param int $statusCode
* @return \Illuminate\Http\JsonResponse
*/
protected function notFound($message = 'Not found', $statusCode = 404)
{
return $this->jsonResponse(['error' => $message], $statusCode);
}
/**
* Return JSON response for internal error.
*
* @param string $message
* @param int $statusCode
* @return \Illuminate\Http\JsonResponse
*/
protected function internalError($message = 'Internal error', $statusCode = 500)
{
return $this->jsonResponse(['error' => $message], $statusCode);
}
/**
* Return JSON response.
*
* @param array|null $payload
* @param int $statusCode
* @return \Illuminate\Http\JsonResponse
*/
protected function jsonResponse(array $payload = null, $statusCode = 404)
{
$payload = $payload ?: [];
return response()->json($payload, $statusCode);
}
}
================================================
FILE: artisan
================================================
#!/usr/bin/env php
<?php
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make('Illuminate\Contracts\Console\Kernel');
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running. We will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);
================================================
FILE: bootstrap/app.php
================================================
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
'Illuminate\Contracts\Http\Kernel',
'App\Http\Kernel'
);
$app->singleton(
'Illuminate\Contracts\Console\Kernel',
'App\Console\Kernel'
);
$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'App\Exceptions\Handler'
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;
================================================
FILE: bootstrap/autoload.php
================================================
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Include The Compiled Class File
|--------------------------------------------------------------------------
|
| To dramatically increase your application's performance, you may use a
| compiled class file which contains all of the classes commonly used
| by a request. The Artisan "optimize" is used to create this file.
|
*/
$compiledPath = __DIR__.'/cache/compiled.php';
if (file_exists($compiledPath)) {
require $compiledPath;
}
================================================
FILE: bootstrap/cache/.gitignore
================================================
*
!.gitignore
================================================
FILE: composer.json
================================================
{
"name": "ngmy/webloyer",
"description": "Webloyer is a Web UI for managing Deployer deployments",
"keywords": ["deployer", "deploy", "deployment"],
"license": "MIT",
"authors": [
{
"name": "Yuta Nagamiya",
"email": "y.nagamiya@gmail.com"
}
],
"type": "project",
"repositories": [
{
"type": "package",
"package": {
"name": "ajaxorg/ace-builds",
"version": "1.2.0",
"source": {
"url": "https://github.com/ajaxorg/ace-builds.git",
"type": "git",
"reference": "v1.2.0"
}
}
},
{
"type": "package",
"package": {
"name": "lou/multi-select",
"version": "0.9.12",
"source": {
"url": "https://github.com/lou/multi-select.git",
"type": "git",
"reference": "0.9.12"
}
}
},
{
"type": "vcs",
"url": "https://github.com/matasarei/JsonRPC.git"
}
],
"require": {
"php": ">=5.6.0",
"laravel/framework": "5.2.*",
"laravelcollective/html": "5.2.*",
"davejamesmiller/laravel-breadcrumbs": "3.0.*",
"robclancy/presenter": "1.3.*",
"ajaxorg/ace-builds": "~1.2.0",
"lou/multi-select": "0.9.12",
"kodeine/laravel-acl": "~1.0@dev",
"sensiolabs/ansi-to-html": "~1.0",
"symfony/yaml": "~3.0",
"ngmy/eloquent-serialized-lob": "^0.1.0",
"fguillot/json-rpc": "~v1.2.1",
"deployer/deployer": "^4.0"
},
"require-dev": {
"phpunit/phpunit": "~5.0",
"symfony/dom-crawler": "~3.0",
"symfony/css-selector": "~3.0",
"mockery/mockery": "dev-master",
"mikey179/vfsstream": "~1",
"php-coveralls/php-coveralls": "^2.2"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php",
"tests/_helpers"
]
},
"scripts": {
"post-install-cmd": [
"mkdir -p public/js/vendor/ajaxorg",
"ln -nfs $(pwd)/vendor/ajaxorg/ace-builds/src-min-noconflict public/js/vendor/ajaxorg/ace",
"mkdir -p public/vendor/lou/multi-select",
"cp -r $(pwd)/vendor/lou/multi-select/js public/vendor/lou/multi-select",
"cp -r $(pwd)/vendor/lou/multi-select/css public/vendor/lou/multi-select",
"cp -r $(pwd)/vendor/lou/multi-select/img public/vendor/lou/multi-select",
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"mkdir -p public/js/vendor/ajaxorg",
"ln -nfs $(pwd)/vendor/ajaxorg/ace-builds/src-min-noconflict public/js/vendor/ajaxorg/ace",
"mkdir -p public/vendor/lou/multi-select",
"cp -r $(pwd)/vendor/lou/multi-select/js public/vendor/lou/multi-select",
"cp -r $(pwd)/vendor/lou/multi-select/css public/vendor/lou/multi-select",
"cp -r $(pwd)/vendor/lou/multi-select/img public/vendor/lou/multi-select",
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
================================================
FILE: config/acl.php
================================================
<?php
return [
/**
* Model definitions.
* If you want to use your own model and extend it
* to package's model. You can define your model here.
*/
'role' => 'Kodeine\Acl\Models\Eloquent\Role',
'permission' => 'Kodeine\Acl\Models\Eloquent\Permission',
/**
* NTFS right, the more permissive wins
* If you have multiple permission aliases assigned, each alias
* has a common permission, view.house => false, but one alias
* has it set to true. If ntfs right is enabled, true value
* wins the race, ie the more permissive wins.
*/
'ntfs' => false,
];
================================================
FILE: config/app.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services your application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG'),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY', 'SomeRandomString'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/
'log' => 'daily',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\RepositoryServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
Robbo\Presenter\PresenterServiceProvider::class,
Kodeine\Acl\AclServiceProvider::class,
Ngmy\EloquentSerializedLob\SerializedLobTraitServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Input' => Illuminate\Support\Facades\Input::class,
'Inspiring' => Illuminate\Foundation\Inspiring::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Breadcrumbs' => DaveJamesMiller\Breadcrumbs\Facade::class,
],
];
================================================
FILE: config/auth.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passw
gitextract_lvb56yoq/
├── .coveralls.yml
├── .gitattributes
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── SCREENSHOTS.md
├── WEBAPIS.md
├── WEBHOOKS.md
├── app/
│ ├── Console/
│ │ ├── Commands/
│ │ │ ├── Inspire.php
│ │ │ └── Webloyer/
│ │ │ ├── DiscardOldDeployments.php
│ │ │ └── Install.php
│ │ └── Kernel.php
│ ├── Entities/
│ │ ├── ProjectAttribute/
│ │ │ └── ProjectAttributeEntity.php
│ │ └── Setting/
│ │ ├── AbstractSettingEntity.php
│ │ ├── AppSettingEntity.php
│ │ ├── DbSettingEntity.php
│ │ └── MailSettingEntity.php
│ ├── Events/
│ │ └── Event.php
│ ├── Exceptions/
│ │ └── Handler.php
│ ├── Http/
│ │ ├── Controllers/
│ │ │ ├── Auth/
│ │ │ │ ├── AuthController.php
│ │ │ │ └── PasswordController.php
│ │ │ ├── Controller.php
│ │ │ ├── DeploymentsController.php
│ │ │ ├── HomeController.php
│ │ │ ├── ProjectsController.php
│ │ │ ├── RecipesController.php
│ │ │ ├── ServersController.php
│ │ │ ├── SettingsController.php
│ │ │ ├── UsersController.php
│ │ │ ├── Webhook/
│ │ │ │ └── Github/
│ │ │ │ └── V1/
│ │ │ │ └── DeploymentsController.php
│ │ │ └── WelcomeController.php
│ │ ├── Kernel.php
│ │ ├── Middleware/
│ │ │ ├── ApplySettings.php
│ │ │ ├── Authenticate.php
│ │ │ ├── RedirectIfAuthenticated.php
│ │ │ ├── VerifyCsrfToken.php
│ │ │ └── VerifyGithubWebhookSecret.php
│ │ ├── Requests/
│ │ │ └── Request.php
│ │ ├── breadcrumbs.php
│ │ └── routes.php
│ ├── Jobs/
│ │ ├── Deploy.php
│ │ ├── Job.php
│ │ └── Rollback.php
│ ├── Listeners/
│ │ └── .gitkeep
│ ├── Models/
│ │ ├── BaseModel.php
│ │ ├── Deployment.php
│ │ ├── DeploymentPresenter.php
│ │ ├── MaxDeployment.php
│ │ ├── Project.php
│ │ ├── Recipe.php
│ │ ├── Server.php
│ │ ├── Setting.php
│ │ └── User.php
│ ├── Policies/
│ │ └── .gitkeep
│ ├── Providers/
│ │ ├── AppServiceProvider.php
│ │ ├── AuthServiceProvider.php
│ │ ├── EventServiceProvider.php
│ │ ├── RepositoryServiceProvider.php
│ │ └── RouteServiceProvider.php
│ ├── Repositories/
│ │ ├── AbstractConfigRepository.php
│ │ ├── AbstractEloquentRepository.php
│ │ ├── Project/
│ │ │ ├── EloquentProject.php
│ │ │ └── ProjectInterface.php
│ │ ├── Recipe/
│ │ │ ├── EloquentRecipe.php
│ │ │ └── RecipeInterface.php
│ │ ├── RepositoryInterface.php
│ │ ├── Role/
│ │ │ ├── EloquentRole.php
│ │ │ └── RoleInterface.php
│ │ ├── Server/
│ │ │ ├── EloquentServer.php
│ │ │ └── ServerInterface.php
│ │ ├── Setting/
│ │ │ ├── AppSettingInterface.php
│ │ │ ├── ConfigAppSetting.php
│ │ │ ├── ConfigDbSetting.php
│ │ │ ├── ConfigMailSetting.php
│ │ │ ├── DbSettingInterface.php
│ │ │ ├── EloquentSetting.php
│ │ │ ├── MailSettingInterface.php
│ │ │ └── SettingInterface.php
│ │ └── User/
│ │ ├── EloquentUser.php
│ │ └── UserInterface.php
│ ├── Services/
│ │ ├── Api/
│ │ │ ├── JsonRpc.php
│ │ │ └── Middleware/
│ │ │ └── Authenticate.php
│ │ ├── Config/
│ │ │ ├── ConfigReaderInterface.php
│ │ │ ├── ConfigWriterInterface.php
│ │ │ ├── DotenvReader.php
│ │ │ └── DotenvWriter.php
│ │ ├── Deployment/
│ │ │ ├── DeployCommanderInterface.php
│ │ │ ├── DeployerDeploymentFileBuilder.php
│ │ │ ├── DeployerFile.php
│ │ │ ├── DeployerFileBuilderInterface.php
│ │ │ ├── DeployerFileDirector.php
│ │ │ ├── DeployerRecipeFileBuilder.php
│ │ │ ├── DeployerServerListFileBuilder.php
│ │ │ ├── QueueDeployCommander.php
│ │ │ └── StorageDeployCommander.php
│ │ ├── Filesystem/
│ │ │ ├── FilesystemInterface.php
│ │ │ └── LaravelFilesystem.php
│ │ ├── Form/
│ │ │ ├── Deployment/
│ │ │ │ ├── DeploymentForm.php
│ │ │ │ └── DeploymentFormLaravelValidator.php
│ │ │ ├── Project/
│ │ │ │ ├── ProjectForm.php
│ │ │ │ └── ProjectFormLaravelValidator.php
│ │ │ ├── Recipe/
│ │ │ │ ├── RecipeForm.php
│ │ │ │ └── RecipeFormLaravelValidator.php
│ │ │ ├── Server/
│ │ │ │ ├── ServerForm.php
│ │ │ │ └── ServerFormLaravelValidator.php
│ │ │ ├── Setting/
│ │ │ │ ├── MailSettingForm.php
│ │ │ │ └── MailSettingFormLaravelValidator.php
│ │ │ └── User/
│ │ │ ├── UserForm.php
│ │ │ └── UserFormLaravelValidator.php
│ │ ├── Notification/
│ │ │ ├── MailNotifier.php
│ │ │ └── NotifierInterface.php
│ │ └── Validation/
│ │ ├── AbstractLaravelValidator.php
│ │ └── ValidableInterface.php
│ ├── Specifications/
│ │ ├── DeploymentSpecification.php
│ │ └── OldDeploymentSpecification.php
│ └── Traits/
│ └── RestExceptionHandlerTrait.php
├── artisan
├── bootstrap/
│ ├── app.php
│ ├── autoload.php
│ └── cache/
│ └── .gitignore
├── composer.json
├── config/
│ ├── acl.php
│ ├── app.php
│ ├── auth.php
│ ├── cache.php
│ ├── compile.php
│ ├── database.php
│ ├── filesystems.php
│ ├── mail.php
│ ├── queue.php
│ ├── services.php
│ ├── session.php
│ └── view.php
├── database/
│ ├── .gitignore
│ ├── migrations/
│ │ ├── .gitkeep
│ │ ├── 2014_10_12_000000_create_users_table.php
│ │ ├── 2014_10_12_100000_create_password_resets_table.php
│ │ ├── 2015_02_07_172606_create_roles_table.php
│ │ ├── 2015_02_07_172633_create_role_user_table.php
│ │ ├── 2015_02_07_172649_create_permissions_table.php
│ │ ├── 2015_02_07_172657_create_permission_role_table.php
│ │ ├── 2015_02_17_152439_create_permission_user_table.php
│ │ ├── 2015_02_22_123238_create_recipes_table.php
│ │ ├── 2015_02_23_123238_create_servers_table.php
│ │ ├── 2015_02_28_164641_create_projects_table.php
│ │ ├── 2015_03_01_084552_create_deployments_table.php
│ │ ├── 2015_05_28_132914_create_max_deployments_table.php
│ │ ├── 2015_06_16_143119_create_jobs_table.php
│ │ ├── 2015_08_10_143119_create_project_recipe_table.php
│ │ └── 2016_08_24_041250_create_settings_table.php
│ └── seeds/
│ ├── .gitkeep
│ ├── DatabaseSeeder.php
│ ├── PermissionRoleTableSeeder.php
│ ├── PermissionTableSeeder.php
│ ├── RecipeTableSeeder.php
│ ├── RoleTableSeeder.php
│ ├── RoleUserTableSeeder.php
│ └── UserTableSeeder.php
├── gulpfile.js
├── package.json
├── phpspec.yml
├── phpunit.xml
├── public/
│ ├── .gitignore
│ ├── .htaccess
│ ├── css/
│ │ └── app.css
│ ├── index.php
│ ├── js/
│ │ └── .gitignore
│ └── robots.txt
├── resources/
│ ├── assets/
│ │ └── less/
│ │ ├── app.less
│ │ ├── bootstrap/
│ │ │ ├── alerts.less
│ │ │ ├── badges.less
│ │ │ ├── bootstrap.less
│ │ │ ├── breadcrumbs.less
│ │ │ ├── button-groups.less
│ │ │ ├── buttons.less
│ │ │ ├── carousel.less
│ │ │ ├── close.less
│ │ │ ├── code.less
│ │ │ ├── component-animations.less
│ │ │ ├── dropdowns.less
│ │ │ ├── forms.less
│ │ │ ├── glyphicons.less
│ │ │ ├── grid.less
│ │ │ ├── input-groups.less
│ │ │ ├── jumbotron.less
│ │ │ ├── labels.less
│ │ │ ├── list-group.less
│ │ │ ├── media.less
│ │ │ ├── mixins/
│ │ │ │ ├── alerts.less
│ │ │ │ ├── background-variant.less
│ │ │ │ ├── border-radius.less
│ │ │ │ ├── buttons.less
│ │ │ │ ├── center-block.less
│ │ │ │ ├── clearfix.less
│ │ │ │ ├── forms.less
│ │ │ │ ├── gradients.less
│ │ │ │ ├── grid-framework.less
│ │ │ │ ├── grid.less
│ │ │ │ ├── hide-text.less
│ │ │ │ ├── image.less
│ │ │ │ ├── labels.less
│ │ │ │ ├── list-group.less
│ │ │ │ ├── nav-divider.less
│ │ │ │ ├── nav-vertical-align.less
│ │ │ │ ├── opacity.less
│ │ │ │ ├── pagination.less
│ │ │ │ ├── panels.less
│ │ │ │ ├── progress-bar.less
│ │ │ │ ├── reset-filter.less
│ │ │ │ ├── resize.less
│ │ │ │ ├── responsive-visibility.less
│ │ │ │ ├── size.less
│ │ │ │ ├── tab-focus.less
│ │ │ │ ├── table-row.less
│ │ │ │ ├── text-emphasis.less
│ │ │ │ ├── text-overflow.less
│ │ │ │ └── vendor-prefixes.less
│ │ │ ├── mixins.less
│ │ │ ├── modals.less
│ │ │ ├── navbar.less
│ │ │ ├── navs.less
│ │ │ ├── normalize.less
│ │ │ ├── pager.less
│ │ │ ├── pagination.less
│ │ │ ├── panels.less
│ │ │ ├── popovers.less
│ │ │ ├── print.less
│ │ │ ├── progress-bars.less
│ │ │ ├── responsive-embed.less
│ │ │ ├── responsive-utilities.less
│ │ │ ├── scaffolding.less
│ │ │ ├── tables.less
│ │ │ ├── theme.less
│ │ │ ├── thumbnails.less
│ │ │ ├── tooltip.less
│ │ │ ├── type.less
│ │ │ ├── utilities.less
│ │ │ ├── variables.less
│ │ │ └── wells.less
│ │ └── webloyer/
│ │ ├── bootstrap.less
│ │ ├── code.less
│ │ ├── forms.less
│ │ ├── helpers.less
│ │ └── list-group.less
│ ├── lang/
│ │ └── en/
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ ├── validation.php
│ │ └── webloyer.php
│ └── views/
│ ├── app.blade.php
│ ├── auth/
│ │ ├── login.blade.php
│ │ ├── password.blade.php
│ │ ├── register.blade.php
│ │ └── reset.blade.php
│ ├── deployments/
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── emails/
│ │ ├── notification.blade.php
│ │ └── password.blade.php
│ ├── errors/
│ │ └── 503.blade.php
│ ├── home.blade.php
│ ├── projects/
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── recipes/
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── servers/
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── settings/
│ │ └── email.blade.php
│ ├── users/
│ │ ├── change_password.blade.php
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── edit_api_token.blade.php
│ │ ├── edit_role.blade.php
│ │ └── index.blade.php
│ ├── vendor/
│ │ └── .gitkeep
│ └── welcome.blade.php
├── server.php
├── storage/
│ ├── .gitignore
│ ├── app/
│ │ └── .gitignore
│ ├── framework/
│ │ ├── .gitignore
│ │ ├── cache/
│ │ │ └── .gitignore
│ │ ├── sessions/
│ │ │ └── .gitignore
│ │ └── views/
│ │ └── .gitignore
│ └── logs/
│ └── .gitignore
└── tests/
├── Entities/
│ └── Setting/
│ ├── AppSettingEntityTest.php
│ ├── DbSettingEntityTest.php
│ └── MailSettingEntityTest.php
├── Http/
│ └── Controllers/
│ ├── DeploymentsControllerTest.php
│ ├── ProjectsControllerTest.php
│ ├── RecipesControllerTest.php
│ ├── ServersControllerTest.php
│ ├── SettingsControllerTest.php
│ ├── UsersControllerTest.php
│ └── Webhook/
│ └── Github/
│ └── V1/
│ └── DeploymentsControllerTest.php
├── Jobs/
│ ├── DeployTest.php
│ └── RollbackTest.php
├── Models/
│ ├── DeploymentPresenterTest.php
│ └── ProjectTest.php
├── Repositories/
│ ├── Project/
│ │ └── EloquentProjectTest.php
│ ├── Recipe/
│ │ └── EloquentRecipeTest.php
│ ├── Role/
│ │ └── EloquentRoleTest.php
│ ├── Server/
│ │ └── EloquentServerTest.php
│ ├── Setting/
│ │ ├── ConfigAppSettingTest.php
│ │ ├── ConfigDbSettingTest.php
│ │ └── ConfigMailSettingTest.php
│ └── User/
│ └── EloquentUserTest.php
├── Services/
│ ├── Api/
│ │ └── JsonRpcTest.php
│ ├── Config/
│ │ ├── DotenvReaderTest.php
│ │ └── DotenvWriterTest.php
│ ├── Deployment/
│ │ ├── DeployerDeploymentFileBuilderTest.php
│ │ ├── DeployerRecipeFileBuilderTest.php
│ │ ├── DeployerServerListFileBuilderTest.php
│ │ └── StorageDeployCommanderTest.php
│ ├── Filesystem/
│ │ └── LaravelFilesystemTest.php
│ ├── Form/
│ │ ├── Deployment/
│ │ │ ├── DeploymentFormLaravelValidatorTest.php
│ │ │ └── DeploymentFormTest.php
│ │ ├── Project/
│ │ │ ├── ProjectFormLaravelValidatorTest.php
│ │ │ └── ProjectFormTest.php
│ │ ├── Recipe/
│ │ │ ├── RecipeFormLaravelValidatorTest.php
│ │ │ └── RecipeFormTest.php
│ │ ├── Server/
│ │ │ ├── ServerFormLaravelValidatorTest.php
│ │ │ └── ServerFormTest.php
│ │ ├── Setting/
│ │ │ ├── MailSettingFormLaravelValidatorTest.php
│ │ │ └── MailSettingFormTest.php
│ │ └── User/
│ │ ├── UserFormLaravelValidatorTest.php
│ │ └── UserFormTest.php
│ └── Notification/
│ └── MailNotifierTest.php
├── Specifications/
│ ├── DeploymentSpecificationTest.php
│ └── OldDeploymentSpecificationTest.php
├── TestCase.php
└── _helpers/
├── ConsoleCommandTestHelper.php
├── ControllerTestHelper.php
├── DummyMiddleware.php
├── Factory.php
└── MockeryHelper.php
SYMBOL INDEX (810 symbols across 177 files)
FILE: app/Console/Commands/Inspire.php
class Inspire (line 8) | class Inspire extends Command
method handle (line 29) | public function handle()
FILE: app/Console/Commands/Webloyer/DiscardOldDeployments.php
class DiscardOldDeployments (line 11) | class DiscardOldDeployments extends Command
method __construct (line 37) | public function __construct(ProjectInterface $projectRepository)
method handle (line 50) | public function handle()
FILE: app/Console/Commands/Webloyer/Install.php
class Install (line 14) | class Install extends Command
method __construct (line 35) | public function __construct()
method handle (line 48) | public function handle(AppSettingInterface $appSetting, DbSettingInter...
FILE: app/Console/Kernel.php
class Kernel (line 8) | class Kernel extends ConsoleKernel
method schedule (line 26) | protected function schedule(Schedule $schedule)
FILE: app/Entities/ProjectAttribute/ProjectAttributeEntity.php
class ProjectAttributeEntity (line 9) | class ProjectAttributeEntity
method getDeployPath (line 18) | public function getDeployPath()
method setDeployPath (line 23) | public function setDeployPath($deployPath)
FILE: app/Entities/Setting/AbstractSettingEntity.php
class AbstractSettingEntity (line 5) | abstract class AbstractSettingEntity
FILE: app/Entities/Setting/AppSettingEntity.php
class AppSettingEntity (line 7) | class AppSettingEntity extends AbstractSettingEntity
method getUrl (line 11) | public function getUrl()
method setUrl (line 16) | public function setUrl($url)
FILE: app/Entities/Setting/DbSettingEntity.php
class DbSettingEntity (line 7) | class DbSettingEntity extends AbstractSettingEntity
method getDriver (line 19) | public function getDriver()
method getHost (line 24) | public function getHost()
method getDatabase (line 29) | public function getDatabase()
method getUsername (line 34) | public function getUsername()
method getPassword (line 39) | public function getPassword()
method setDriver (line 44) | public function setDriver($driver)
method setHost (line 51) | public function setHost($host)
method setDatabase (line 58) | public function setDatabase($database)
method setUsername (line 65) | public function setUsername($username)
method setPassword (line 72) | public function setPassword($password)
FILE: app/Entities/Setting/MailSettingEntity.php
class MailSettingEntity (line 10) | class MailSettingEntity extends AbstractSettingEntity
method getDriver (line 66) | public function getDriver()
method getFrom (line 71) | public function getFrom()
method getSmtpHost (line 76) | public function getSmtpHost()
method getSmtpPort (line 81) | public function getSmtpPort()
method getSmtpEncryption (line 86) | public function getSmtpEncryption()
method getSmtpUsername (line 91) | public function getSmtpUsername()
method getSmtpPassword (line 96) | public function getSmtpPassword()
method getSendmailPath (line 101) | public function getSendmailPath()
method setDriver (line 106) | public function setDriver($driver)
method setFrom (line 113) | public function setFrom(array $from)
method setSmtpHost (line 120) | public function setSmtpHost($smtpHost)
method setSmtpPort (line 127) | public function setSmtpPort($smtpPort)
method setSmtpEncryption (line 134) | public function setSmtpEncryption($smtpEncryption)
method setSmtpUsername (line 141) | public function setSmtpUsername($smtpUsername)
method setSmtpPassword (line 148) | public function setSmtpPassword($smtpPassword)
method setSendmailPath (line 155) | public function setSendmailPath($sendmailPath)
FILE: app/Events/Event.php
class Event (line 5) | abstract class Event
FILE: app/Exceptions/Handler.php
class Handler (line 13) | class Handler extends ExceptionHandler
method report (line 37) | public function report(Exception $e)
method render (line 49) | public function render($request, Exception $e)
FILE: app/Http/Controllers/Auth/AuthController.php
class AuthController (line 10) | class AuthController extends Controller
method __construct (line 32) | public function __construct()
method validator (line 43) | public function validator(array $data)
method create (line 58) | public function create(array $data)
method getRegister (line 73) | public function getRegister()
method postRegister (line 84) | public function postRegister()
FILE: app/Http/Controllers/Auth/PasswordController.php
class PasswordController (line 8) | class PasswordController extends Controller
method __construct (line 30) | public function __construct()
FILE: app/Http/Controllers/Controller.php
class Controller (line 10) | abstract class Controller extends BaseController
FILE: app/Http/Controllers/DeploymentsController.php
class DeploymentsController (line 14) | class DeploymentsController extends Controller
method __construct (line 27) | public function __construct(ProjectInterface $project, DeploymentForm ...
method index (line 43) | public function index(Request $request, Project $project)
method store (line 63) | public function store(Request $request, Project $project)
method show (line 92) | public function show(Project $project, Deployment $deployment)
FILE: app/Http/Controllers/HomeController.php
class HomeController (line 5) | class HomeController extends Controller
method __construct (line 23) | public function __construct()
method index (line 33) | public function index()
FILE: app/Http/Controllers/ProjectsController.php
class ProjectsController (line 15) | class ProjectsController extends Controller
method __construct (line 37) | public function __construct(ProjectInterface $project, ProjectForm $pr...
method index (line 55) | public function index(Request $request)
method create (line 71) | public function create()
method store (line 95) | public function store(Request $request)
method show (line 114) | public function show(Project $project)
method edit (line 132) | public function edit(Project $project)
method update (line 162) | public function update(Request $request, Project $project)
method destroy (line 181) | public function destroy(Project $project)
FILE: app/Http/Controllers/RecipesController.php
class RecipesController (line 13) | class RecipesController extends Controller
method __construct (line 26) | public function __construct(RecipeInterface $recipe, RecipeForm $recip...
method index (line 41) | public function index(Request $request)
method create (line 57) | public function create()
method store (line 68) | public function store(Request $request)
method show (line 87) | public function show(Recipe $recipe)
method edit (line 101) | public function edit(Recipe $recipe)
method update (line 113) | public function update(Request $request, Recipe $recipe)
method destroy (line 132) | public function destroy(Recipe $recipe)
FILE: app/Http/Controllers/ServersController.php
class ServersController (line 13) | class ServersController extends Controller
method __construct (line 26) | public function __construct(ServerInterface $server, ServerForm $serve...
method index (line 41) | public function index(Request $request)
method create (line 57) | public function create()
method store (line 68) | public function store(Request $request)
method show (line 87) | public function show(Server $server)
method edit (line 98) | public function edit(Server $server)
method update (line 110) | public function update(Request $request, Server $server)
method destroy (line 129) | public function destroy(Server $server)
FILE: app/Http/Controllers/SettingsController.php
class SettingsController (line 12) | class SettingsController extends Controller
method __construct (line 14) | public function __construct()
method getEmail (line 20) | public function getEmail(SettingInterface $settingRepository)
method postEmail (line 28) | public function postEmail(Request $request, MailSettingForm $mailSetti...
FILE: app/Http/Controllers/UsersController.php
class UsersController (line 14) | class UsersController extends Controller
method __construct (line 30) | public function __construct(UserInterface $user, UserForm $userForm, R...
method index (line 46) | public function index(Request $request)
method create (line 62) | public function create()
method store (line 76) | public function store(Request $request)
method show (line 95) | public function show(User $user)
method edit (line 106) | public function edit(User $user)
method update (line 118) | public function update(Request $request, User $user)
method changePassword (line 137) | public function changePassword(User $user)
method updatePassword (line 149) | public function updatePassword(Request $request, User $user)
method editRole (line 168) | public function editRole(User $user)
method updateRole (line 184) | public function updateRole(Request $request, User $user)
method editApiToken (line 203) | public function editApiToken(User $user)
method regenerateApiToken (line 216) | public function regenerateApiToken(Request $request, User $user)
method destroy (line 235) | public function destroy(User $user)
FILE: app/Http/Controllers/Webhook/Github/V1/DeploymentsController.php
class DeploymentsController (line 12) | class DeploymentsController extends Controller
method __construct (line 25) | public function __construct(ProjectInterface $project, DeploymentForm ...
method store (line 38) | public function store(Request $request, Project $project)
FILE: app/Http/Controllers/WelcomeController.php
class WelcomeController (line 5) | class WelcomeController extends Controller
method __construct (line 23) | public function __construct()
method index (line 33) | public function index()
FILE: app/Http/Kernel.php
class Kernel (line 7) | class Kernel extends HttpKernel
FILE: app/Http/Middleware/ApplySettings.php
class ApplySettings (line 8) | class ApplySettings
method __construct (line 12) | public function __construct(SettingInterface $settingRepository)
method handle (line 24) | public function handle($request, Closure $next)
FILE: app/Http/Middleware/Authenticate.php
class Authenticate (line 8) | class Authenticate
method handle (line 18) | public function handle($request, Closure $next, $guard = null)
FILE: app/Http/Middleware/RedirectIfAuthenticated.php
class RedirectIfAuthenticated (line 9) | class RedirectIfAuthenticated
method __construct (line 24) | public function __construct(Guard $auth)
method handle (line 36) | public function handle($request, Closure $next)
FILE: app/Http/Middleware/VerifyCsrfToken.php
class VerifyCsrfToken (line 8) | class VerifyCsrfToken extends BaseVerifier
method handle (line 17) | public function handle($request, Closure $next)
FILE: app/Http/Middleware/VerifyGithubWebhookSecret.php
class VerifyGithubWebhookSecret (line 8) | class VerifyGithubWebhookSecret
method __construct (line 12) | public function __construct(ProjectInterface $projectRepository)
method handle (line 24) | public function handle($request, Closure $next)
FILE: app/Http/Requests/Request.php
class Request (line 7) | abstract class Request extends FormRequest
FILE: app/Jobs/Deploy.php
class Deploy (line 17) | class Deploy extends Job implements ShouldQueue
method __construct (line 31) | public function __construct(Model $deployment)
method handle (line 47) | public function handle(ProjectInterface $projectRepository, ServerInte...
FILE: app/Jobs/Job.php
class Job (line 7) | abstract class Job
FILE: app/Jobs/Rollback.php
class Rollback (line 17) | class Rollback extends Job implements ShouldQueue
method __construct (line 31) | public function __construct(Model $deployment)
method handle (line 47) | public function handle(ProjectInterface $projectRepository, ServerInte...
FILE: app/Models/BaseModel.php
class BaseModel (line 7) | class BaseModel extends Model
method nullIfBlank (line 9) | protected function nullIfBlank($value)
FILE: app/Models/Deployment.php
class Deployment (line 8) | class Deployment extends BaseModel implements PresentableInterface
method getPresenter (line 31) | public function getPresenter()
method user (line 37) | public function user()
FILE: app/Models/DeploymentPresenter.php
class DeploymentPresenter (line 7) | class DeploymentPresenter extends Presenter
method __construct (line 11) | public function __construct($object, $converter)
method status (line 18) | public function status()
method statusText (line 29) | public function statusText()
method message (line 40) | public function message()
method messageText (line 47) | public function messageText()
FILE: app/Models/MaxDeployment.php
class MaxDeployment (line 5) | class MaxDeployment extends BaseModel
FILE: app/Models/Project.php
class Project (line 10) | class Project extends BaseModel
method setStageAttribute (line 30) | public function setStageAttribute($value)
method setEmailNotificationRecipientAttribute (line 35) | public function setEmailNotificationRecipientAttribute($value)
method setDaysToKeepDeploymentsAttribute (line 40) | public function setDaysToKeepDeploymentsAttribute($value)
method setMaxNumberOfDeploymentsToKeepAttribute (line 45) | public function setMaxNumberOfDeploymentsToKeepAttribute($value)
method setGithubWebhookSecretAttribute (line 50) | public function setGithubWebhookSecretAttribute($value)
method setGithubWebhookUserIdAttribute (line 55) | public function setGithubWebhookUserIdAttribute($value)
method maxDeployment (line 60) | public function maxDeployment()
method deployments (line 65) | public function deployments()
method recipes (line 70) | public function recipes()
method githubWebhookUser (line 75) | public function githubWebhookUser()
method getGithubWebhookUser (line 80) | public function getGithubWebhookUser()
method getMaxDeployment (line 85) | public function getMaxDeployment()
method getLastDeployment (line 90) | public function getLastDeployment()
method getDeploymentByNumber (line 95) | public function getDeploymentByNumber($number)
method getDeploymentsByPage (line 100) | public function getDeploymentsByPage($page = 1, $limit = 10)
method getDeployments (line 109) | public function getDeployments()
method deleteDeployments (line 114) | public function deleteDeployments(Collection $deployments)
method getRecipes (line 125) | public function getRecipes()
method addMaxDeployment (line 130) | public function addMaxDeployment(array $data = [])
method addDeployment (line 135) | public function addDeployment(array $data)
method updateDeployment (line 140) | public function updateDeployment(array $data)
method syncRecipes (line 147) | public function syncRecipes(array $data)
method updateMaxDeployment (line 156) | public function updateMaxDeployment(array $data)
method getDeploymentsWhereCreatedAtBefore (line 161) | public function getDeploymentsWhereCreatedAtBefore(DateTime $date)
method getDeploymentsWhereNumberBefore (line 169) | public function getDeploymentsWhereNumberBefore($number)
method getSatisfyingDeployments (line 177) | public function getSatisfyingDeployments(DeploymentSpecification $spec)
method serializedLobColumn (line 182) | protected function serializedLobColumn()
method serializedLobSerializer (line 187) | protected function serializedLobSerializer()
method serializedLobDeserializeType (line 192) | protected function serializedLobDeserializeType()
FILE: app/Models/Recipe.php
class Recipe (line 7) | class Recipe extends BaseModel
method projects (line 17) | public function projects()
method getProjects (line 22) | public function getProjects()
FILE: app/Models/Server.php
class Server (line 7) | class Server extends BaseModel
FILE: app/Models/Setting.php
class Setting (line 7) | class Setting extends BaseModel
method serializedLobColumn (line 18) | protected function serializedLobColumn()
method serializedLobSerializer (line 23) | protected function serializedLobSerializer()
method serializedLobDeserializeType (line 28) | protected function serializedLobDeserializeType()
FILE: app/Models/User.php
class User (line 14) | class User extends BaseModel implements AuthenticatableContract, Authori...
FILE: app/Providers/AppServiceProvider.php
class AppServiceProvider (line 32) | class AppServiceProvider extends ServiceProvider
method boot (line 39) | public function boot()
method register (line 57) | public function register()
FILE: app/Providers/AuthServiceProvider.php
class AuthServiceProvider (line 8) | class AuthServiceProvider extends ServiceProvider
method boot (line 25) | public function boot(GateContract $gate)
FILE: app/Providers/EventServiceProvider.php
class EventServiceProvider (line 8) | class EventServiceProvider extends ServiceProvider
method boot (line 27) | public function boot(DispatcherContract $events)
FILE: app/Providers/RepositoryServiceProvider.php
class RepositoryServiceProvider (line 23) | class RepositoryServiceProvider extends ServiceProvider
method boot (line 30) | public function boot()
method register (line 40) | public function register()
FILE: app/Providers/RouteServiceProvider.php
class RouteServiceProvider (line 10) | class RouteServiceProvider extends ServiceProvider
method boot (line 27) | public function boot(Router $router)
method map (line 99) | public function map(Router $router)
FILE: app/Repositories/AbstractConfigRepository.php
class AbstractConfigRepository (line 8) | abstract class AbstractConfigRepository implements RepositoryInterface
method __construct (line 21) | public function __construct(ConfigReaderInterface $reader, ConfigWrite...
method byId (line 27) | public function byId($id)
method byPage (line 31) | public function byPage($page = 1, $limi = 10)
method all (line 35) | public function all()
method create (line 39) | public function create(array $data)
method update (line 43) | public function update(array $data)
method delete (line 47) | public function delete($id)
FILE: app/Repositories/AbstractEloquentRepository.php
class AbstractEloquentRepository (line 5) | abstract class AbstractEloquentRepository implements RepositoryInterface
method byId (line 15) | public function byId($id)
method byPage (line 27) | public function byPage($page = 1, $limit = 10)
method all (line 42) | public function all()
method create (line 53) | public function create(array $data)
method update (line 66) | public function update(array $data)
method delete (line 81) | public function delete($id)
FILE: app/Repositories/Project/EloquentProject.php
class EloquentProject (line 8) | class EloquentProject extends AbstractEloquentRepository implements Proj...
method __construct (line 16) | public function __construct(Model $project)
method byPage (line 28) | public function byPage($page = 1, $limit = 10)
FILE: app/Repositories/Project/ProjectInterface.php
type ProjectInterface (line 7) | interface ProjectInterface extends RepositoryInterface
FILE: app/Repositories/Recipe/EloquentRecipe.php
class EloquentRecipe (line 8) | class EloquentRecipe extends AbstractEloquentRepository implements Recip...
method __construct (line 16) | public function __construct(Model $recipe)
method byPage (line 28) | public function byPage($page = 1, $limit = 10)
FILE: app/Repositories/Recipe/RecipeInterface.php
type RecipeInterface (line 7) | interface RecipeInterface extends RepositoryInterface
FILE: app/Repositories/RepositoryInterface.php
type RepositoryInterface (line 5) | interface RepositoryInterface
method byId (line 13) | public function byId($id);
method byPage (line 22) | public function byPage($page = 1, $limit = 10);
method all (line 29) | public function all();
method create (line 37) | public function create(array $data);
method update (line 45) | public function update(array $data);
method delete (line 53) | public function delete($id);
FILE: app/Repositories/Role/EloquentRole.php
class EloquentRole (line 8) | class EloquentRole extends AbstractEloquentRepository implements RoleInt...
method __construct (line 16) | public function __construct(Model $role)
method byPage (line 28) | public function byPage($page = 1, $limit = 10)
FILE: app/Repositories/Role/RoleInterface.php
type RoleInterface (line 7) | interface RoleInterface extends RepositoryInterface
FILE: app/Repositories/Server/EloquentServer.php
class EloquentServer (line 8) | class EloquentServer extends AbstractEloquentRepository implements Serve...
method __construct (line 16) | public function __construct(Model $server)
method byPage (line 28) | public function byPage($page = 1, $limit = 10)
FILE: app/Repositories/Server/ServerInterface.php
type ServerInterface (line 7) | interface ServerInterface extends RepositoryInterface
FILE: app/Repositories/Setting/AppSettingInterface.php
type AppSettingInterface (line 7) | interface AppSettingInterface extends SettingInterface
FILE: app/Repositories/Setting/ConfigAppSetting.php
class ConfigAppSetting (line 11) | class ConfigAppSetting extends AbstractConfigRepository implements AppSe...
method all (line 13) | public function all()
method update (line 23) | public function update(array $data)
FILE: app/Repositories/Setting/ConfigDbSetting.php
class ConfigDbSetting (line 11) | class ConfigDbSetting extends AbstractConfigRepository implements DbSett...
method all (line 13) | public function all()
method update (line 31) | public function update(array $data)
FILE: app/Repositories/Setting/ConfigMailSetting.php
class ConfigMailSetting (line 11) | class ConfigMailSetting extends AbstractConfigRepository implements Mail...
method all (line 13) | public function all()
method update (line 43) | public function update(array $data)
FILE: app/Repositories/Setting/DbSettingInterface.php
type DbSettingInterface (line 7) | interface DbSettingInterface extends SettingInterface
FILE: app/Repositories/Setting/EloquentSetting.php
class EloquentSetting (line 10) | class EloquentSetting extends AbstractEloquentRepository implements Sett...
method __construct (line 18) | public function __construct(Model $setting)
method byType (line 29) | public function byType($type)
method updateByType (line 62) | public function updateByType(array $data)
FILE: app/Repositories/Setting/MailSettingInterface.php
type MailSettingInterface (line 7) | interface MailSettingInterface extends SettingInterface
FILE: app/Repositories/Setting/SettingInterface.php
type SettingInterface (line 7) | interface SettingInterface extends RepositoryInterface
FILE: app/Repositories/User/EloquentUser.php
class EloquentUser (line 8) | class EloquentUser extends AbstractEloquentRepository implements UserInt...
method __construct (line 16) | public function __construct(Model $user)
method byPage (line 28) | public function byPage($page = 1, $limit = 10)
FILE: app/Repositories/User/UserInterface.php
type UserInterface (line 7) | interface UserInterface extends RepositoryInterface
FILE: app/Services/Api/JsonRpc.php
class JsonRpc (line 10) | class JsonRpc
method __construct (line 23) | public function __construct(ProjectInterface $project, DeploymentForm ...
method deploy (line 35) | public function deploy($project_id)
method rollback (line 60) | public function rollback($project_id)
FILE: app/Services/Api/Middleware/Authenticate.php
class Authenticate (line 10) | class Authenticate implements MiddlewareInterface
method __construct (line 14) | public function __construct(Request $request)
method execute (line 19) | public function execute($username, $password, $procedureName)
FILE: app/Services/Config/ConfigReaderInterface.php
type ConfigReaderInterface (line 5) | interface ConfigReaderInterface
method getConfig (line 13) | public function getConfig($name);
FILE: app/Services/Config/ConfigWriterInterface.php
type ConfigWriterInterface (line 5) | interface ConfigWriterInterface
method setConfig (line 14) | public function setConfig($name, $value);
FILE: app/Services/Config/DotenvReader.php
class DotenvReader (line 8) | class DotenvReader implements ConfigReaderInterface
method __construct (line 14) | public function __construct(FilesystemInterface $fs, $path)
method getConfig (line 26) | public function getConfig($name)
method nullIfBlank (line 40) | protected function nullIfBlank($value)
FILE: app/Services/Config/DotenvWriter.php
class DotenvWriter (line 8) | class DotenvWriter implements ConfigWriterInterface
method __construct (line 14) | public function __construct(FilesystemInterface $fs, $path)
method setConfig (line 27) | public function setConfig($name, $value)
FILE: app/Services/Deployment/DeployCommanderInterface.php
type DeployCommanderInterface (line 5) | interface DeployCommanderInterface
method deploy (line 13) | public function deploy($deployment);
method rollback (line 21) | public function rollback($deployment);
FILE: app/Services/Deployment/DeployerDeploymentFileBuilder.php
class DeployerDeploymentFileBuilder (line 9) | class DeployerDeploymentFileBuilder implements DeployerFileBuilderInterface
method __construct (line 21) | public function __construct(FilesystemInterface $fs, DeployerFile $dep...
method __destruct (line 27) | public function __destruct()
method pathInfo (line 37) | public function pathInfo()
method put (line 55) | public function put()
method getResult (line 84) | public function getResult()
method setProject (line 95) | public function setProject(Model $project)
method setServerListFile (line 108) | public function setServerListFile(DeployerFile $serverListFile)
method setRecipeFile (line 121) | public function setRecipeFile(array $recipeFile)
FILE: app/Services/Deployment/DeployerFile.php
class DeployerFile (line 5) | class DeployerFile
method getBaseName (line 16) | public function getBaseName()
method getFullPath (line 26) | public function getFullPath()
method setBaseName (line 37) | public function setBaseName($baseName)
method setFullPath (line 50) | public function setFullPath($fullPath)
FILE: app/Services/Deployment/DeployerFileBuilderInterface.php
type DeployerFileBuilderInterface (line 5) | interface DeployerFileBuilderInterface
method pathInfo (line 12) | public function pathInfo();
method put (line 19) | public function put();
method getResult (line 26) | public function getResult();
FILE: app/Services/Deployment/DeployerFileDirector.php
class DeployerFileDirector (line 5) | class DeployerFileDirector
method __construct (line 9) | public function __construct(DeployerFileBuilderInterface $fileBuilder)
method construct (line 19) | public function construct()
FILE: app/Services/Deployment/DeployerRecipeFileBuilder.php
class DeployerRecipeFileBuilder (line 9) | class DeployerRecipeFileBuilder implements DeployerFileBuilderInterface
method __construct (line 17) | public function __construct(FilesystemInterface $fs, DeployerFile $dep...
method __destruct (line 23) | public function __destruct()
method pathInfo (line 33) | public function pathInfo()
method put (line 51) | public function put()
method getResult (line 66) | public function getResult()
method setRecipe (line 77) | public function setRecipe(Model $recipe)
FILE: app/Services/Deployment/DeployerServerListFileBuilder.php
class DeployerServerListFileBuilder (line 11) | class DeployerServerListFileBuilder implements DeployerFileBuilderInterface
method __construct (line 25) | public function __construct(FilesystemInterface $fs, DeployerFile $dep...
method __destruct (line 33) | public function __destruct()
method pathInfo (line 43) | public function pathInfo()
method put (line 61) | public function put()
method getResult (line 88) | public function getResult()
method setServer (line 99) | public function setServer(Model $server)
method setProject (line 112) | public function setProject(Model $project)
FILE: app/Services/Deployment/QueueDeployCommander.php
class QueueDeployCommander (line 10) | class QueueDeployCommander implements DeployCommanderInterface
method __construct (line 14) | public function __construct(Dispatcher $dispatcher)
method deploy (line 25) | public function deploy($deployment)
method rollback (line 38) | public function rollback($deployment)
FILE: app/Services/Deployment/StorageDeployCommander.php
class StorageDeployCommander (line 7) | class StorageDeployCommander implements DeployCommanderInterface
method deploy (line 15) | public function deploy($deployment)
method rollback (line 30) | public function rollback($deployment)
FILE: app/Services/Filesystem/FilesystemInterface.php
type FilesystemInterface (line 5) | interface FilesystemInterface
method put (line 14) | public function put($path, $contents);
method get (line 22) | public function get($path);
FILE: app/Services/Filesystem/LaravelFilesystem.php
class LaravelFilesystem (line 9) | class LaravelFilesystem implements FilesystemInterface
method __construct (line 13) | public function __construct(Filesystem $fs)
method put (line 25) | public function put($path, $contents)
method get (line 36) | public function get($path)
method delete (line 47) | public function delete($path)
FILE: app/Services/Form/Deployment/DeploymentForm.php
class DeploymentForm (line 10) | class DeploymentForm
method __construct (line 26) | public function __construct(ValidableInterface $validator, ProjectInte...
method save (line 39) | public function save(array $input)
method errors (line 73) | public function errors()
method valid (line 83) | protected function valid(array $input)
FILE: app/Services/Form/Deployment/DeploymentFormLaravelValidator.php
class DeploymentFormLaravelValidator (line 7) | class DeploymentFormLaravelValidator extends AbstractLaravelValidator
FILE: app/Services/Form/Project/ProjectForm.php
class ProjectForm (line 9) | class ProjectForm
method __construct (line 22) | public function __construct(ValidableInterface $validator, ProjectInte...
method save (line 34) | public function save(array $input)
method update (line 70) | public function update(array $input)
method errors (line 106) | public function errors()
method valid (line 116) | protected function valid(array $input)
FILE: app/Services/Form/Project/ProjectFormLaravelValidator.php
class ProjectFormLaravelValidator (line 7) | class ProjectFormLaravelValidator extends AbstractLaravelValidator
method rules (line 23) | protected function rules()
FILE: app/Services/Form/Recipe/RecipeForm.php
class RecipeForm (line 8) | class RecipeForm
method __construct (line 21) | public function __construct(ValidableInterface $validator, RecipeInter...
method save (line 33) | public function save(array $input)
method update (line 48) | public function update(array $input)
method errors (line 62) | public function errors()
method valid (line 72) | protected function valid(array $input)
FILE: app/Services/Form/Recipe/RecipeFormLaravelValidator.php
class RecipeFormLaravelValidator (line 7) | class RecipeFormLaravelValidator extends AbstractLaravelValidator
FILE: app/Services/Form/Server/ServerForm.php
class ServerForm (line 8) | class ServerForm
method __construct (line 21) | public function __construct(ValidableInterface $validator, ServerInter...
method save (line 33) | public function save(array $input)
method update (line 48) | public function update(array $input)
method errors (line 62) | public function errors()
method valid (line 72) | protected function valid(array $input)
FILE: app/Services/Form/Server/ServerFormLaravelValidator.php
class ServerFormLaravelValidator (line 7) | class ServerFormLaravelValidator extends AbstractLaravelValidator
FILE: app/Services/Form/Setting/MailSettingForm.php
class MailSettingForm (line 8) | class MailSettingForm
method __construct (line 21) | public function __construct(ValidableInterface $validator, SettingInte...
method update (line 33) | public function update(array $input)
method errors (line 71) | public function errors()
method valid (line 81) | protected function valid(array $input)
FILE: app/Services/Form/Setting/MailSettingFormLaravelValidator.php
class MailSettingFormLaravelValidator (line 7) | class MailSettingFormLaravelValidator extends AbstractLaravelValidator
FILE: app/Services/Form/User/UserForm.php
class UserForm (line 10) | class UserForm
method __construct (line 23) | public function __construct(ValidableInterface $validator, UserInterfa...
method save (line 35) | public function save(array $input)
method update (line 64) | public function update(array $input)
method updatePassword (line 83) | public function updatePassword(array $input)
method updateRole (line 100) | public function updateRole(array $input)
method regenerateApiToken (line 123) | public function regenerateApiToken(array $input)
method errors (line 137) | public function errors()
method valid (line 147) | protected function valid(array $input)
FILE: app/Services/Form/User/UserFormLaravelValidator.php
class UserFormLaravelValidator (line 7) | class UserFormLaravelValidator extends AbstractLaravelValidator
method rules (line 15) | protected function rules()
FILE: app/Services/Notification/MailNotifier.php
class MailNotifier (line 7) | class MailNotifier implements NotifierInterface
method to (line 29) | public function to($to)
method from (line 42) | public function from($from)
method notify (line 56) | public function notify($subject, $message)
FILE: app/Services/Notification/NotifierInterface.php
type NotifierInterface (line 5) | interface NotifierInterface
method to (line 12) | public function to($to);
method from (line 20) | public function from($from);
method notify (line 29) | public function notify($subject, $message);
FILE: app/Services/Validation/AbstractLaravelValidator.php
class AbstractLaravelValidator (line 7) | abstract class AbstractLaravelValidator implements ValidableInterface
method __construct (line 23) | public function __construct(Factory $validator)
method with (line 34) | public function with(array $data)
method passes (line 46) | public function passes()
method errors (line 66) | public function errors()
method rules (line 76) | protected function rules()
FILE: app/Services/Validation/ValidableInterface.php
type ValidableInterface (line 5) | interface ValidableInterface
method with (line 13) | public function with(array $input);
method passes (line 20) | public function passes();
method errors (line 27) | public function errors();
FILE: app/Specifications/DeploymentSpecification.php
class DeploymentSpecification (line 7) | class DeploymentSpecification
method satisfyingElementsFrom (line 15) | public function satisfyingElementsFrom(Model $project)
FILE: app/Specifications/OldDeploymentSpecification.php
class OldDeploymentSpecification (line 8) | class OldDeploymentSpecification extends DeploymentSpecification
method __construct (line 12) | public function __construct(DateTime $currentDate)
method satisfyingElementsFrom (line 23) | public function satisfyingElementsFrom(Model $project)
FILE: app/Traits/RestExceptionHandlerTrait.php
type RestExceptionHandlerTrait (line 9) | trait RestExceptionHandlerTrait
method getJsonResponseForException (line 18) | protected function getJsonResponseForException(Request $request, Excep...
method badRequest (line 42) | protected function badRequest($message = 'Bad request', $statusCode = ...
method unauthorized (line 54) | protected function unauthorized($message = 'Unauthorized', $statusCode...
method notFound (line 66) | protected function notFound($message = 'Not found', $statusCode = 404)
method internalError (line 78) | protected function internalError($message = 'Internal error', $statusC...
method jsonResponse (line 90) | protected function jsonResponse(array $payload = null, $statusCode = 404)
FILE: database/migrations/2014_10_12_000000_create_users_table.php
class CreateUsersTable (line 6) | class CreateUsersTable extends Migration
method up (line 13) | public function up()
method down (line 31) | public function down()
FILE: database/migrations/2014_10_12_100000_create_password_resets_table.php
class CreatePasswordResetsTable (line 6) | class CreatePasswordResetsTable extends Migration
method up (line 13) | public function up()
method down (line 27) | public function down()
FILE: database/migrations/2015_02_07_172606_create_roles_table.php
class CreateRolesTable (line 6) | class CreateRolesTable extends Migration
method up (line 13) | public function up()
method down (line 29) | public function down()
FILE: database/migrations/2015_02_07_172633_create_role_user_table.php
class CreateRoleUserTable (line 6) | class CreateRoleUserTable extends Migration
method up (line 13) | public function up()
method down (line 30) | public function down()
FILE: database/migrations/2015_02_07_172649_create_permissions_table.php
class CreatePermissionsTable (line 6) | class CreatePermissionsTable extends Migration
method up (line 13) | public function up()
method down (line 31) | public function down()
FILE: database/migrations/2015_02_07_172657_create_permission_role_table.php
class CreatePermissionRoleTable (line 6) | class CreatePermissionRoleTable extends Migration
method up (line 13) | public function up()
method down (line 30) | public function down()
FILE: database/migrations/2015_02_17_152439_create_permission_user_table.php
class CreatePermissionUserTable (line 6) | class CreatePermissionUserTable extends Migration
method up (line 13) | public function up()
method down (line 30) | public function down()
FILE: database/migrations/2015_02_22_123238_create_recipes_table.php
class CreateRecipesTable (line 6) | class CreateRecipesTable extends Migration
method up (line 13) | public function up()
method down (line 29) | public function down()
FILE: database/migrations/2015_02_23_123238_create_servers_table.php
class CreateServersTable (line 6) | class CreateServersTable extends Migration
method up (line 13) | public function up()
method down (line 29) | public function down()
FILE: database/migrations/2015_02_28_164641_create_projects_table.php
class CreateProjectsTable (line 6) | class CreateProjectsTable extends Migration
method up (line 13) | public function up()
method down (line 45) | public function down()
FILE: database/migrations/2015_03_01_084552_create_deployments_table.php
class CreateDeploymentsTable (line 6) | class CreateDeploymentsTable extends Migration
method up (line 13) | public function up()
method down (line 39) | public function down()
FILE: database/migrations/2015_05_28_132914_create_max_deployments_table.php
class CreateMaxDeploymentsTable (line 6) | class CreateMaxDeploymentsTable extends Migration
method up (line 13) | public function up()
method down (line 35) | public function down()
FILE: database/migrations/2015_06_16_143119_create_jobs_table.php
class CreateJobsTable (line 6) | class CreateJobsTable extends Migration
method up (line 13) | public function up()
method down (line 32) | public function down()
FILE: database/migrations/2015_08_10_143119_create_project_recipe_table.php
class CreateProjectRecipeTable (line 6) | class CreateProjectRecipeTable extends Migration
method up (line 13) | public function up()
method down (line 39) | public function down()
FILE: database/migrations/2016_08_24_041250_create_settings_table.php
class CreateSettingsTable (line 6) | class CreateSettingsTable extends Migration
method up (line 13) | public function up()
method down (line 28) | public function down()
FILE: database/seeds/DatabaseSeeder.php
class DatabaseSeeder (line 6) | class DatabaseSeeder extends Seeder
method run (line 13) | public function run()
FILE: database/seeds/PermissionRoleTableSeeder.php
class PermissionRoleTableSeeder (line 6) | class PermissionRoleTableSeeder extends Seeder
method run (line 8) | public function run()
FILE: database/seeds/PermissionTableSeeder.php
class PermissionTableSeeder (line 6) | class PermissionTableSeeder extends Seeder
method run (line 8) | public function run()
FILE: database/seeds/RecipeTableSeeder.php
class RecipeTableSeeder (line 6) | class RecipeTableSeeder extends Seeder
method run (line 8) | public function run()
FILE: database/seeds/RoleTableSeeder.php
class RoleTableSeeder (line 6) | class RoleTableSeeder extends Seeder
method run (line 8) | public function run()
FILE: database/seeds/RoleUserTableSeeder.php
class RoleUserTableSeeder (line 7) | class RoleUserTableSeeder extends Seeder
method run (line 9) | public function run()
FILE: database/seeds/UserTableSeeder.php
class UserTableSeeder (line 6) | class UserTableSeeder extends Seeder
method run (line 8) | public function run()
FILE: tests/Entities/Setting/AppSettingEntityTest.php
class AppSettingEntityTest (line 5) | class AppSettingEntityTest extends TestCase
method test_Should_SetAndGetUrl (line 7) | public function test_Should_SetAndGetUrl()
FILE: tests/Entities/Setting/DbSettingEntityTest.php
class DbSettingEntityTest (line 5) | class DbSettingEntityTest extends TestCase
method test_Should_SetAndGetDriver (line 7) | public function test_Should_SetAndGetDriver()
method test_Should_SetAndGetHost (line 18) | public function test_Should_SetAndGetHost()
method test_Should_SetAndGetDatabase (line 29) | public function test_Should_SetAndGetDatabase()
method test_Should_SetAndGetUsername (line 40) | public function test_Should_SetAndGetUsername()
method test_Should_SetAndGetPassword (line 51) | public function test_Should_SetAndGetPassword()
FILE: tests/Entities/Setting/MailSettingEntityTest.php
class MailSettingEntityTest (line 5) | class MailSettingEntityTest extends TestCase
method test_Should_SetAndGetDriver (line 7) | public function test_Should_SetAndGetDriver()
method test_Should_SetAndGetFrom (line 18) | public function test_Should_SetAndGetFrom()
method test_Should_SetAndGetSmtpHost (line 32) | public function test_Should_SetAndGetSmtpHost()
method test_Should_SetAndGetSmtpPort (line 43) | public function test_Should_SetAndGetSmtpPort()
method test_Should_SetAndGetSmtpEncryption (line 54) | public function test_Should_SetAndGetSmtpEncryption()
method test_Should_SetAndGetSmtpUsername (line 65) | public function test_Should_SetAndGetSmtpUsername()
method test_Should_SetAndGetSmtpPassword (line 76) | public function test_Should_SetAndGetSmtpPassword()
method test_Should_SetAndGetSendmailPath (line 87) | public function test_Should_SetAndGetSendmailPath()
FILE: tests/Http/Controllers/DeploymentsControllerTest.php
class DeploymentsControllerTest (line 6) | class DeploymentsControllerTest extends TestCase
method setUp (line 20) | public function setUp()
method test_Should_DisplayIndexPage_When_IndexPageIsRequested (line 39) | public function test_Should_DisplayIndexPage_When_IndexPageIsRequested()
method test_Should_RedirectToIndexPage_When_StoreProcessSucceeds (line 67) | public function test_Should_RedirectToIndexPage_When_StoreProcessSucce...
method test_Should_RedirectToIndexPage_When_StoreProcessFails (line 95) | public function test_Should_RedirectToIndexPage_When_StoreProcessFails()
method test_Should_DisplayShowPage_When_ShowPageIsRequestedAndResourceIsFound (line 130) | public function test_Should_DisplayShowPage_When_ShowPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_ShowPageIsRequestedAndResourceIsNotFound (line 160) | public function test_Should_DisplayNotFoundPage_When_ShowPageIsRequest...
FILE: tests/Http/Controllers/ProjectsControllerTest.php
class ProjectsControllerTest (line 6) | class ProjectsControllerTest extends TestCase
method setUp (line 26) | public function setUp()
method test_Should_DisplayIndexPage_When_IndexPageIsRequested (line 48) | public function test_Should_DisplayIndexPage_When_IndexPageIsRequested()
method test_Should_DisplayCreatePage_When_CreatePageIsRequested (line 73) | public function test_Should_DisplayCreatePage_When_CreatePageIsRequest...
method test_Should_RedirectToIndexPage_When_StoreProcessSucceeds (line 95) | public function test_Should_RedirectToIndexPage_When_StoreProcessSucce...
method test_Should_RedirectToCreatePage_When_StoreProcessFails (line 107) | public function test_Should_RedirectToCreatePage_When_StoreProcessFails()
method test_Should_DisplayShowPage_When_ShowPageIsRequestedAndResourceIsFound (line 125) | public function test_Should_DisplayShowPage_When_ShowPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_ShowPageIsRequestedAndResourceIsNotFound (line 167) | public function test_Should_DisplayNotFoundPage_When_ShowPageIsRequest...
method test_Should_DisplayEditPage_When_EditPageIsRequestedAndResourceIsFound (line 179) | public function test_Should_DisplayEditPage_When_EditPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_EditPageIsRequestedAndResourceIsNotFound (line 220) | public function test_Should_DisplayNotFoundPage_When_EditPageIsRequest...
method test_Should_RedirectToIndexPage_When_UpdateProcessSucceeds (line 232) | public function test_Should_RedirectToIndexPage_When_UpdateProcessSucc...
method test_Should_RedirectToEditPage_When_UpdateProcessFails (line 256) | public function test_Should_RedirectToEditPage_When_UpdateProcessFails()
method test_Should_DisplayNotFoundPage_When_UpdateProcessIsRequestedAndResourceIsNotFound (line 286) | public function test_Should_DisplayNotFoundPage_When_UpdateProcessIsRe...
method test_Should_RedirectToIndexPage_When_DestroyProcessIsRequestedAndDestroyProcessSucceeds (line 298) | public function test_Should_RedirectToIndexPage_When_DestroyProcessIsR...
method test_Should_DisplayNotFoundPage_When_DestroyProcessIsRequestedAndResourceIsNotFound (line 321) | public function test_Should_DisplayNotFoundPage_When_DestroyProcessIsR...
FILE: tests/Http/Controllers/RecipesControllerTest.php
class RecipesControllerTest (line 6) | class RecipesControllerTest extends TestCase
method setUp (line 16) | public function setUp()
method test_Should_DisplayIndexPage_When_IndexPageIsRequested (line 34) | public function test_Should_DisplayIndexPage_When_IndexPageIsRequested()
method test_Should_DisplayCreatePage_When_CreatePageIsRequested (line 60) | public function test_Should_DisplayCreatePage_When_CreatePageIsRequest...
method test_Should_RedirectToIndexPage_When_StoreProcessSucceeds (line 67) | public function test_Should_RedirectToIndexPage_When_StoreProcessSucce...
method test_Should_RedirectToCreatePage_When_StoreProcessFails (line 79) | public function test_Should_RedirectToCreatePage_When_StoreProcessFails()
method test_Should_DisplayShowPage_When_ShowPageIsRequestedAndResourceIsFound (line 97) | public function test_Should_DisplayShowPage_When_ShowPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_ShowPageIsRequestedAndResourceIsNotFound (line 116) | public function test_Should_DisplayNotFoundPage_When_ShowPageIsRequest...
method test_Should_DisplayEditPage_When_EditPageIsRequestedAndResourceIsFound (line 128) | public function test_Should_DisplayEditPage_When_EditPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_EditPageIsRequestedAndResourceIsNotFound (line 150) | public function test_Should_DisplayNotFoundPage_When_EditPageIsRequest...
method test_Should_RedirectToIndexPage_When_UpdateProcessSucceeds (line 162) | public function test_Should_RedirectToIndexPage_When_UpdateProcessSucc...
method test_Should_RedirectToEditPage_When_UpdateProcessFails (line 188) | public function test_Should_RedirectToEditPage_When_UpdateProcessFails()
method test_Should_DisplayNotFoundPage_When_UpdateProcessIsRequestedAndResourceIsNotFound (line 220) | public function test_Should_DisplayNotFoundPage_When_UpdateProcessIsRe...
method test_Should_RedirectToIndexPage_When_DestroyProcessIsRequestedAndDestroyProcessSucceeds (line 232) | public function test_Should_RedirectToIndexPage_When_DestroyProcessIsR...
method test_Should_DisplayNotFoundPage_When_DestroyProcessIsRequestedAndResourceIsNotFound (line 257) | public function test_Should_DisplayNotFoundPage_When_DestroyProcessIsR...
FILE: tests/Http/Controllers/ServersControllerTest.php
class ServersControllerTest (line 6) | class ServersControllerTest extends TestCase
method setUp (line 16) | public function setUp()
method test_Should_DisplayIndexPage_When_IndexPageIsRequested (line 33) | public function test_Should_DisplayIndexPage_When_IndexPageIsRequested()
method test_Should_DisplayCreatePage_When_CreatePageIsRequested (line 54) | public function test_Should_DisplayCreatePage_When_CreatePageIsRequest...
method test_Should_RedirectToIndexPage_When_StoreProcessSucceeds (line 61) | public function test_Should_RedirectToIndexPage_When_StoreProcessSucce...
method test_Should_RedirectToCreatePage_When_StoreProcessFails (line 73) | public function test_Should_RedirectToCreatePage_When_StoreProcessFails()
method test_Should_DisplayShowPage_When_ShowPageIsRequestedAndResourceIsFound (line 91) | public function test_Should_DisplayShowPage_When_ShowPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_ShowPageIsRequestedAndResourceIsNotFound (line 113) | public function test_Should_DisplayNotFoundPage_When_ShowPageIsRequest...
method test_Should_DisplayEditPage_When_EditPageIsRequestedAndResourceIsFound (line 125) | public function test_Should_DisplayEditPage_When_EditPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_EditPageIsRequestedAndResourceIsNotFound (line 147) | public function test_Should_DisplayNotFoundPage_When_EditPageIsRequest...
method test_Should_RedirectToIndexPage_When_UpdateProcessSucceeds (line 159) | public function test_Should_RedirectToIndexPage_When_UpdateProcessSucc...
method test_Should_RedirectToEditPage_When_UpdateProcessFails (line 185) | public function test_Should_RedirectToEditPage_When_UpdateProcessFails()
method test_Should_DisplayNotFoundPage_When_UpdateProcessIsRequestedAndResourceIsNotFound (line 217) | public function test_Should_DisplayNotFoundPage_When_UpdateProcessIsRe...
method test_Should_RedirectToIndexPage_When_DestroyProcessIsRequestedAndDestroyProcessSucceeds (line 229) | public function test_Should_RedirectToIndexPage_When_DestroyProcessIsR...
method test_Should_DisplayNotFoundPage_When_DestroyProcessIsRequestedAndResourceIsNotFound (line 254) | public function test_Should_DisplayNotFoundPage_When_DestroyProcessIsR...
FILE: tests/Http/Controllers/SettingsControllerTest.php
class SettingsControllerTest (line 5) | class SettingsControllerTest extends TestCase
method setUp (line 17) | public function setUp()
method test_Should_DisplayEmailSettingPage (line 36) | public function test_Should_DisplayEmailSettingPage()
method test_Should_RedirectToEmailSettingPage_When_EmailSettingProcessIsRequestedAndEmailSettingProcessSucceeds (line 70) | public function test_Should_RedirectToEmailSettingPage_When_EmailSetti...
method test_Should_RedirectToEmailSettingPage_When_EmailSettingProcessIsRequestedAndEmailSettingProcessFails (line 82) | public function test_Should_RedirectToEmailSettingPage_When_EmailSetti...
FILE: tests/Http/Controllers/UsersControllerTest.php
class UsersControllerTest (line 6) | class UsersControllerTest extends TestCase
method setUp (line 18) | public function setUp()
method test_Should_DisplayIndexPage_When_IndexPageIsRequested (line 36) | public function test_Should_DisplayIndexPage_When_IndexPageIsRequested()
method test_Should_DisplayCreatePage_When_CreatePageIsRequested (line 57) | public function test_Should_DisplayCreatePage_When_CreatePageIsRequest...
method test_Should_RedirectToIndexPage_When_StoreProcessSucceeds (line 69) | public function test_Should_RedirectToIndexPage_When_StoreProcessSucce...
method test_Should_RedirectToCreatePage_When_StoreProcessFails (line 81) | public function test_Should_RedirectToCreatePage_When_StoreProcessFails()
method test_Should_RedirectToEditPage_When_ShowPageIsRequestedAndResourceIsFound (line 99) | public function test_Should_RedirectToEditPage_When_ShowPageIsRequeste...
method test_Should_DisplayNotFoundPage_When_ShowPageIsRequestedAndResourceIsNotFound (line 120) | public function test_Should_DisplayNotFoundPage_When_ShowPageIsRequest...
method test_Should_DisplayEditPage_When_EditPageIsRequestedAndResourceIsFound (line 132) | public function test_Should_DisplayEditPage_When_EditPageIsRequestedAn...
method test_Should_DisplayNotFoundPage_When_EditPageIsRequestedAndResourceIsNotFound (line 154) | public function test_Should_DisplayNotFoundPage_When_EditPageIsRequest...
method test_Should_RedirectToIndexPage_When_UpdateProcessSucceeds (line 166) | public function test_Should_RedirectToIndexPage_When_UpdateProcessSucc...
method test_Should_RedirectToEditPage_When_UpdateProcessFails (line 192) | public function test_Should_RedirectToEditPage_When_UpdateProcessFails()
method test_Should_DisplayNotFoundPage_When_UpdateProcessIsRequestedAndResourceIsNotFound (line 224) | public function test_Should_DisplayNotFoundPage_When_UpdateProcessIsRe...
method test_Should_DisplayPasswordChangePage_When_PasswordChangePageIsRequestedAndResourceIsFound (line 236) | public function test_Should_DisplayPasswordChangePage_When_PasswordCha...
method test_Should_DisplayNotFoundPage_When_PasswordChangePageIsRequestedAndResourceIsNotFound (line 258) | public function test_Should_DisplayNotFoundPage_When_PasswordChangePag...
method test_Should_RedirectToIndexPage_When_PasswordUpdateProcessSucceeds (line 270) | public function test_Should_RedirectToIndexPage_When_PasswordUpdatePro...
method test_Should_RedirectToPasswordChangePage_When_PasswordUpdateProcessFails (line 296) | public function test_Should_RedirectToPasswordChangePage_When_Password...
method test_Should_DisplayNotFoundPage_When_PasswordUpdateProcessIsRequestedAndResourceIsNotFound (line 328) | public function test_Should_DisplayNotFoundPage_When_PasswordUpdatePro...
method test_Should_DisplayEditRolePage_When_EditRolePageIsRequestedAndResourceIsFound (line 340) | public function test_Should_DisplayEditRolePage_When_EditRolePageIsReq...
method test_Should_DisplayNotFoundPage_When_EditRolePageIsRequestedAndResourceIsNotFound (line 367) | public function test_Should_DisplayNotFoundPage_When_EditRolePageIsReq...
method test_Should_RedirectToIndexPage_When_RoleUpdateProcessSucceeds (line 379) | public function test_Should_RedirectToIndexPage_When_RoleUpdateProcess...
method test_Should_RedirectToEditRolePage_When_EditUpdateProcessFails (line 405) | public function test_Should_RedirectToEditRolePage_When_EditUpdateProc...
method test_Should_DisplayNotFoundPage_When_RoleUpdateProcessIsRequestedAndResourceIsNotFound (line 437) | public function test_Should_DisplayNotFoundPage_When_RoleUpdateProcess...
method test_Should_RedirectToIndexPage_When_DestroyProcessIsRequestedAndDestroyProcessSucceeds (line 449) | public function test_Should_RedirectToIndexPage_When_DestroyProcessIsR...
method test_Should_DisplayNotFoundPage_When_DestroyProcessIsRequestedAndResourceIsNotFound (line 474) | public function test_Should_DisplayNotFoundPage_When_DestroyProcessIsR...
FILE: tests/Http/Controllers/Webhook/Github/V1/DeploymentsControllerTest.php
class DeploymentsControllerTest (line 8) | class DeploymentsControllerTest extends \TestCase
method setUp (line 22) | public function setUp()
method test_Should_ReturnStatusCode200_When_StoreProcessSucceeds (line 41) | public function test_Should_ReturnStatusCode200_When_StoreProcessSucce...
method test_Should_ReturnStatusCode400_When_StoreProcessFails (line 64) | public function test_Should_ReturnStatusCode400_When_StoreProcessFails()
FILE: tests/Jobs/DeployTest.php
class DeployTest (line 9) | class DeployTest extends \TestCase
method setUp (line 41) | public function setUp()
method test_Should_Work_When_DeployerIsNormalEnd (line 61) | public function test_Should_Work_When_DeployerIsNormalEnd()
method test_Should_Work_When_DeployerIsAbnormalEnd (line 175) | public function test_Should_Work_When_DeployerIsAbnormalEnd()
method test_Should_WorkAndSendNotification_When_DeployerIsNormalEndAndEmailNotificationRecipientIsSet (line 289) | public function test_Should_WorkAndSendNotification_When_DeployerIsNor...
method test_Should_WorkAndSendNotification_When_DeployerIsAbnormalEndAndEmailNotificationRecipientIsSet (line 454) | public function test_Should_WorkAndSendNotification_When_DeployerIsAbn...
FILE: tests/Jobs/RollbackTest.php
class RollbackTest (line 9) | class RollbackTest extends \TestCase
method setUp (line 41) | public function setUp()
method test_Should_Work_When_DeployerIsNormalEnd (line 61) | public function test_Should_Work_When_DeployerIsNormalEnd()
method test_Should_Work_When_DeployerIsAbnormalEnd (line 175) | public function test_Should_Work_When_DeployerIsAbnormalEnd()
method test_Should_WorkAndSendNotification_When_DeployerIsNormalEndAndEmailNotificationRecipientIsSet (line 289) | public function test_Should_WorkAndSendNotification_When_DeployerIsNor...
method test_Should_WorkAndSendNotification_When_DeployerIsAbnormalEndAndEmailNotificationRecipientIsSet (line 454) | public function test_Should_WorkAndSendNotification_When_DeployerIsAbn...
FILE: tests/Models/DeploymentPresenterTest.php
class DeploymentPresenterTest (line 8) | class DeploymentPresenterTest extends TestCase
method test_Should_ConvertStatusToHtmlSnippet_When_StatusIsOK (line 10) | public function test_Should_ConvertStatusToHtmlSnippet_When_StatusIsOK()
method test_Should_ConvertStatusToHtmlSnippet_When_StatusIsNg (line 32) | public function test_Should_ConvertStatusToHtmlSnippet_When_StatusIsNg()
method test_Should_ConvertStatusToHtmlSnippet_When_StatusIsUnknown (line 54) | public function test_Should_ConvertStatusToHtmlSnippet_When_StatusIsUn...
method test_Should_ConvertStatusToText_When_StatusIsOK (line 76) | public function test_Should_ConvertStatusToText_When_StatusIsOK()
method test_Should_ConvertStatusToText_When_StatusIsNg (line 98) | public function test_Should_ConvertStatusToText_When_StatusIsNg()
method test_Should_ConvertStatusToText_When_StatusIsNotDetermined (line 120) | public function test_Should_ConvertStatusToText_When_StatusIsNotDeterm...
method test_Should_ConvertMessageToHtmlSnippet (line 142) | public function test_Should_ConvertMessageToHtmlSnippet()
method test_Should_ConvertMessageToText (line 165) | public function test_Should_ConvertMessageToText()
FILE: tests/Models/ProjectTest.php
class ProjectTest (line 8) | class ProjectTest extends TestCase
method test_Should_GetDeploymentsWhereCreatedAtBefore (line 12) | public function test_Should_GetDeploymentsWhereCreatedAtBefore()
method test_Should_GetDeploymentsWhereNumberBefore (line 47) | public function test_Should_GetDeploymentsWhereNumberBefore()
FILE: tests/Repositories/Project/EloquentProjectTest.php
class EloquentProjectTest (line 7) | class EloquentProjectTest extends TestCase
method test_Should_GetProjectById (line 11) | public function test_Should_GetProjectById()
method test_Should_GetProjectsByPage (line 36) | public function test_Should_GetProjectsByPage()
method test_Should_CreateNewProject (line 61) | public function test_Should_CreateNewProject()
method test_Should_UpdateExistingProject (line 87) | public function test_Should_UpdateExistingProject()
method test_Should_DeleteExistingProject (line 135) | public function test_Should_DeleteExistingProject()
FILE: tests/Repositories/Recipe/EloquentRecipeTest.php
class EloquentRecipeTest (line 7) | class EloquentRecipeTest extends TestCase
method test_Should_GetRecipeById (line 11) | public function test_Should_GetRecipeById()
method test_Should_GetRecipesByPage (line 28) | public function test_Should_GetRecipesByPage()
method test_Should_CreateNewRecipe (line 45) | public function test_Should_CreateNewRecipe()
method test_Should_UpdateExistingRecipe (line 63) | public function test_Should_UpdateExistingRecipe()
method test_Should_DeleteExistingRecipe (line 88) | public function test_Should_DeleteExistingRecipe()
FILE: tests/Repositories/Role/EloquentRoleTest.php
class EloquentRoleTest (line 7) | class EloquentRoleTest extends TestCase
method test_Should_GetRoleById (line 11) | public function test_Should_GetRoleById()
method test_Should_GetRolesByPage (line 28) | public function test_Should_GetRolesByPage()
method test_Should_CreateNewRole (line 45) | public function test_Should_CreateNewRole()
method test_Should_UpdateExistingRole (line 63) | public function test_Should_UpdateExistingRole()
method test_Should_DeleteExistingRole (line 88) | public function test_Should_DeleteExistingRole()
FILE: tests/Repositories/Server/EloquentServerTest.php
class EloquentServerTest (line 7) | class EloquentServerTest extends TestCase
method test_Should_GetServerById (line 11) | public function test_Should_GetServerById()
method test_Should_GetServersByPage (line 28) | public function test_Should_GetServersByPage()
method test_Should_CreateNewServer (line 45) | public function test_Should_CreateNewServer()
method test_Should_UpdateExistingServer (line 63) | public function test_Should_UpdateExistingServer()
method test_Should_DeleteExistingServer (line 88) | public function test_Should_DeleteExistingServer()
FILE: tests/Repositories/Setting/ConfigAppSettingTest.php
class ConfigAppSettingTest (line 10) | class ConfigAppSettingTest extends TestCase
method setUp (line 14) | public function setUp()
method test_Should_GetAllAppSettings (line 21) | public function test_Should_GetAllAppSettings()
method test_Should_UpdateExistingAppSettings (line 49) | public function test_Should_UpdateExistingAppSettings()
FILE: tests/Repositories/Setting/ConfigDbSettingTest.php
class ConfigDbSettingTest (line 10) | class ConfigDbSettingTest extends TestCase
method setUp (line 14) | public function setUp()
method test_Should_GetAllDbSettings (line 21) | public function test_Should_GetAllDbSettings()
method test_Should_UpdateExistingDbSettings (line 57) | public function test_Should_UpdateExistingDbSettings()
FILE: tests/Repositories/Setting/ConfigMailSettingTest.php
class ConfigMailSettingTest (line 10) | class ConfigMailSettingTest extends TestCase
method setUp (line 14) | public function setUp()
method test_Should_GetAllMailSettings (line 21) | public function test_Should_GetAllMailSettings()
method test_Should_UpdateExistingMailSettings (line 65) | public function test_Should_UpdateExistingMailSettings()
FILE: tests/Repositories/User/EloquentUserTest.php
class EloquentUserTest (line 8) | class EloquentUserTest extends TestCase
method setUp (line 14) | public function setUp()
method test_Should_GetUserById (line 21) | public function test_Should_GetUserById()
method test_Should_GetUsersByPage (line 40) | public function test_Should_GetUsersByPage()
method test_Should_CreateNewUser (line 57) | public function test_Should_CreateNewUser()
method test_Should_UpdateExistingUser (line 77) | public function test_Should_UpdateExistingUser()
method test_Should_UpdateExistingUser_When_RoleIsSpecified (line 105) | public function test_Should_UpdateExistingUser_When_RoleIsSpecified()
method test_Should_UpdateExistingUser_When_RoleIsEmpty (line 141) | public function test_Should_UpdateExistingUser_When_RoleIsEmpty()
method test_Should_DeleteExistingUser (line 177) | public function test_Should_DeleteExistingUser()
FILE: tests/Services/Api/JsonRpcTest.php
class JsonRpcTest (line 5) | class JsonRpcTest extends TestCase
method setUp (line 19) | public function setUp()
method test_Should_NotThrowWException_When_DeployProcedureSucceeds (line 29) | public function test_Should_NotThrowWException_When_DeployProcedureSuc...
method test_Should_ThrowWException_When_DeployProcedureFails (line 66) | public function test_Should_ThrowWException_When_DeployProcedureFails()
method test_Should_NotThrowWException_When_RollbackProcedureSucceeds (line 93) | public function test_Should_NotThrowWException_When_RollbackProcedureS...
method test_Should_ThrowWException_When_RollbackProcedureFails (line 130) | public function test_Should_ThrowWException_When_RollbackProcedureFails()
FILE: tests/Services/Config/DotenvReaderTest.php
class DotenvReaderTest (line 8) | class DotenvReaderTest extends TestCase
method setUp (line 12) | public function setUp()
method test_Should_GetConfigValue_When_ConfigExistsAndValueIsNotEmpty (line 19) | public function test_Should_GetConfigValue_When_ConfigExistsAndValueIs...
method test_Should_GetConfigValue_When_ConfigExistsAndValueIsSingleQuoted (line 40) | public function test_Should_GetConfigValue_When_ConfigExistsAndValueIs...
method test_Should_GetConfigValue_When_ConfigExistsAndValueHasWhitespaces (line 61) | public function test_Should_GetConfigValue_When_ConfigExistsAndValueHa...
method test_Should_GetNull_When_ConfigExistsAndValueIsEmpty (line 82) | public function test_Should_GetNull_When_ConfigExistsAndValueIsEmpty()
method test_Should_GetNull_When_ConfigDoesNotExist (line 103) | public function test_Should_GetNull_When_ConfigDoesNotExist()
FILE: tests/Services/Config/DotenvWriterTest.php
class DotenvWriterTest (line 8) | class DotenvWriterTest extends TestCase
method setUp (line 12) | public function setUp()
method test_Should_UpdateExistingConfig_When_ConfigExists (line 19) | public function test_Should_UpdateExistingConfig_When_ConfigExists()
method test_Should_AddNewConfig_When_ConfigDoesNotExist (line 44) | public function test_Should_AddNewConfig_When_ConfigDoesNotExist()
FILE: tests/Services/Deployment/DeployerDeploymentFileBuilderTest.php
class DeployerDeploymentFileBuilderTest (line 7) | class DeployerDeploymentFileBuilderTest extends TestCase
method setUp (line 19) | public function setUp()
method test_Should_BuildDeployerDeploymentFile (line 29) | public function test_Should_BuildDeployerDeploymentFile()
FILE: tests/Services/Deployment/DeployerRecipeFileBuilderTest.php
class DeployerRecipeFileBuilderTest (line 7) | class DeployerRecipeFileBuilderTest extends TestCase
method setUp (line 15) | public function setUp()
method test_Should_BuildDeployerRecipeFile (line 23) | public function test_Should_BuildDeployerRecipeFile()
FILE: tests/Services/Deployment/DeployerServerListFileBuilderTest.php
class DeployerServerListFileBuilderTest (line 11) | class DeployerServerListFileBuilderTest extends TestCase
method setUp (line 31) | public function setUp()
method test_Should_BuildDeployerServerListFile (line 46) | public function test_Should_BuildDeployerServerListFile()
method test_Should_OverrideAttributeInDeployerServerListFile_When_ProjectAttributeIsSpecified (line 87) | public function test_Should_OverrideAttributeInDeployerServerListFile_...
method test_Should_OverrideAttributeInDeployerServerListFile_When_ProjectAttributeIsNotSpecified (line 141) | public function test_Should_OverrideAttributeInDeployerServerListFile_...
FILE: tests/Services/Deployment/StorageDeployCommanderTest.php
class StorageDeployCommanderTest (line 5) | class StorageDeployCommanderTest extends TestCase
method test_Should_ReturnTrue_When_DeployCommandSucceeds (line 7) | public function test_Should_ReturnTrue_When_DeployCommandSucceeds()
method test_Should_ReturnFalse_When_DeployCommandFails (line 19) | public function test_Should_ReturnFalse_When_DeployCommandFails()
method test_Should_ReturnTrue_When_RollbackCommandSucceeds (line 31) | public function test_Should_ReturnTrue_When_RollbackCommandSucceeds()
method test_Should_ReturnFalse_When_RollbackCommandFails (line 43) | public function test_Should_ReturnFalse_When_RollbackCommandFails()
FILE: tests/Services/Filesystem/LaravelFilesystemTest.php
class LaravelFilesystemTest (line 7) | class LaravelFilesystemTest extends TestCase
method setUp (line 11) | public function setUp()
method test_Should_WriteFile (line 18) | public function test_Should_WriteFile()
method test_Should_ReadFile (line 28) | public function test_Should_ReadFile()
method test_Should_DeleteFile (line 38) | public function test_Should_DeleteFile()
FILE: tests/Services/Form/Deployment/DeploymentFormLaravelValidatorTest.php
class DeploymentFormLaravelValidatorTest (line 7) | class DeploymentFormLaravelValidatorTest extends TestCase
method test_Should_FailToValidate_When_ProjectIdFieldIsMissing (line 11) | public function test_Should_FailToValidate_When_ProjectIdFieldIsMissing()
method test_Should_FailToValidate_When_ProjectIdFieldIsInvalid (line 32) | public function test_Should_FailToValidate_When_ProjectIdFieldIsInvalid()
method test_Should_FailToValidate_When_TaskFieldIsMissing (line 55) | public function test_Should_FailToValidate_When_TaskFieldIsMissing()
method test_Should_FailToValidate_When_TaskFieldIsInvalid (line 89) | public function test_Should_FailToValidate_When_TaskFieldIsInvalid()
method test_Should_FailToValidate_When_UserIdFieldIsMissing (line 124) | public function test_Should_FailToValidate_When_UserIdFieldIsMissing()
method test_Should_FailToValidate_When_UserIdFieldIsInvalid (line 151) | public function test_Should_FailToValidate_When_UserIdFieldIsInvalid()
method test_Should_PassToValidate_When_ProjectIdFieldAndTaskFieldAndUserIdFieldAreValid (line 180) | public function test_Should_PassToValidate_When_ProjectIdFieldAndTaskF...
FILE: tests/Services/Form/Deployment/DeploymentFormTest.php
class DeploymentFormTest (line 6) | class DeploymentFormTest extends TestCase
method setUp (line 18) | public function setUp()
method test_Should_SucceedToSave_When_ValidationPasses (line 28) | public function test_Should_SucceedToSave_When_ValidationPasses()
method test_Should_SucceedToSave_When_ValidationPassesAndSaveToDatabaseSucceeds (line 81) | public function test_Should_SucceedToSave_When_ValidationPassesAndSave...
method test_Should_FailToSave_When_ValidationPassesAndSaveToDatabaseFails (line 134) | public function test_Should_FailToSave_When_ValidationPassesAndSaveToD...
method test_Should_FailToSave_When_ValidationFails (line 182) | public function test_Should_FailToSave_When_ValidationFails()
method test_Should_GetValidationErrors (line 203) | public function test_Should_GetValidationErrors()
FILE: tests/Services/Form/Project/ProjectFormLaravelValidatorTest.php
class ProjectFormLaravelValidatorTest (line 7) | class ProjectFormLaravelValidatorTest extends TestCase
method test_Should_FailToValidate_When_RecipeIdFieldIsMissing (line 11) | public function test_Should_FailToValidate_When_RecipeIdFieldIsMissing()
method test_Should_FailToValidate_When_NameFieldIsMissing (line 34) | public function test_Should_FailToValidate_When_NameFieldIsMissing()
method test_Should_FailToValidate_When_ServerIdFieldIsMissing (line 64) | public function test_Should_FailToValidate_When_ServerIdFieldIsMissing()
method test_Should_FailToValidate_When_RepositoryFieldIsMissing (line 88) | public function test_Should_FailToValidate_When_RepositoryFieldIsMissi...
method test_Should_FailToValidate_When_RepositoryFieldIsInvalidUrl (line 118) | public function test_Should_FailToValidate_When_RepositoryFieldIsInval...
method test_Should_FailToValidate_When_StageFieldIsMissing (line 154) | public function test_Should_FailToValidate_When_StageFieldIsMissing()
method test_Should_PassToValidate_When_NameFieldAndRecipeIdFieldAndServerIdFieldAndRepositoryFieldAndStageFieldAreValid (line 184) | public function test_Should_PassToValidate_When_NameFieldAndRecipeIdFi...
FILE: tests/Services/Form/Project/ProjectFormTest.php
class ProjectFormTest (line 5) | class ProjectFormTest extends TestCase
method setUp (line 15) | public function setUp()
method test_Should_SucceedToSaveAndNotAddProjectAttribute_When_ValidationPassesAndDeployPathFieldIsNotSpecified (line 24) | public function test_Should_SucceedToSaveAndNotAddProjectAttribute_Whe...
method test_Should_SucceedToSaveAndAddProjectAttribute_When_ValidationPassesAndDeployPathFieldIsSpecified (line 57) | public function test_Should_SucceedToSaveAndAddProjectAttribute_When_V...
method test_Should_FailToSave_When_ValidationFails (line 90) | public function test_Should_FailToSave_When_ValidationFails()
method test_Should_SucceedToUpdateAndNotAddProjectAttribute_When_ValidationPassesAndDeployPathFieldIsNotSpecified (line 112) | public function test_Should_SucceedToUpdateAndNotAddProjectAttribute_W...
method test_Should_SucceedToUpdateAndAddProjectAttribute_When_ValidationPassesAndDeployPathFieldIsSpecified (line 148) | public function test_Should_SucceedToUpdateAndAddProjectAttribute_When...
method test_Should_FailToUpdate_When_ValidationFails (line 184) | public function test_Should_FailToUpdate_When_ValidationFails()
method test_Should_GetValidationErrors (line 206) | public function test_Should_GetValidationErrors()
FILE: tests/Services/Form/Recipe/RecipeFormLaravelValidatorTest.php
class RecipeFormLaravelValidatorTest (line 5) | class RecipeFormLaravelValidatorTest extends TestCase
method test_Should_FailToValidate_When_NameFieldIsMissing (line 7) | public function test_Should_FailToValidate_When_NameFieldIsMissing()
method test_Should_FailToValidate_When_BodyFieldIsMissing (line 22) | public function test_Should_FailToValidate_When_BodyFieldIsMissing()
method test_Should_PassToValidate_When_NameFieldAndBodyFieldAreValid (line 38) | public function test_Should_PassToValidate_When_NameFieldAndBodyFieldA...
FILE: tests/Services/Form/Recipe/RecipeFormTest.php
class RecipeFormTest (line 5) | class RecipeFormTest extends TestCase
method setUp (line 13) | public function setUp()
method test_Should_SucceedToSave_When_ValidationPasses (line 21) | public function test_Should_SucceedToSave_When_ValidationPasses()
method test_Should_FailToSave_When_ValidationFails (line 43) | public function test_Should_FailToSave_When_ValidationFails()
method test_Should_SucceedToUpdate_When_ValidationPasses (line 60) | public function test_Should_SucceedToUpdate_When_ValidationPasses()
method test_Should_FailToUpdate_When_ValidationFails (line 82) | public function test_Should_FailToUpdate_When_ValidationFails()
method test_Should_GetValidationErrors (line 99) | public function test_Should_GetValidationErrors()
FILE: tests/Services/Form/Server/ServerFormLaravelValidatorTest.php
class ServerFormLaravelValidatorTest (line 5) | class ServerFormLaravelValidatorTest extends TestCase
method test_Should_FailToValidate_When_NameFieldIsMissing (line 7) | public function test_Should_FailToValidate_When_NameFieldIsMissing()
method test_Should_FailToValidate_When_BodyFieldIsMissing (line 22) | public function test_Should_FailToValidate_When_BodyFieldIsMissing()
method test_Should_PassToValidate_When_NameFieldAndBodyFieldAreValid (line 38) | public function test_Should_PassToValidate_When_NameFieldAndBodyFieldA...
FILE: tests/Services/Form/Server/ServerFormTest.php
class ServerFormTest (line 5) | class ServerFormTest extends TestCase
method setUp (line 13) | public function setUp()
method test_Should_SucceedToSave_When_ValidationPasses (line 21) | public function test_Should_SucceedToSave_When_ValidationPasses()
method test_Should_FailToSave_When_ValidationFails (line 43) | public function test_Should_FailToSave_When_ValidationFails()
method test_Should_SucceedToUpdate_When_ValidationPasses (line 60) | public function test_Should_SucceedToUpdate_When_ValidationPasses()
method test_Should_FailToUpdate_When_ValidationFails (line 82) | public function test_Should_FailToUpdate_When_ValidationFails()
method test_Should_GetValidationErrors (line 99) | public function test_Should_GetValidationErrors()
FILE: tests/Services/Form/Setting/MailSettingFormLaravelValidatorTest.php
class MailSettingFormLaravelValidatorTest (line 5) | class MailSettingFormLaravelValidatorTest extends TestCase
method test_Should_PassToValidate_When_AllFieldsIsValid (line 7) | public function test_Should_PassToValidate_When_AllFieldsIsValid()
method test_Should_FailToValidate_When_DriverFieldIsMissing (line 30) | public function test_Should_FailToValidate_When_DriverFieldIsMissing()
method test_Should_FailToValidate_When_DriverFieldIsInvalid (line 52) | public function test_Should_FailToValidate_When_DriverFieldIsInvalid()
method test_Should_FailToValidate_When_FromAddressFieldIsMissing (line 75) | public function test_Should_FailToValidate_When_FromAddressFieldIsMiss...
method test_Should_FailToValidate_When_FromAddressFieldIsInvalid (line 97) | public function test_Should_FailToValidate_When_FromAddressFieldIsInva...
method test_Should_PassToValidate_When_SmtpPortFieldIsEqualToMin (line 120) | public function test_Should_PassToValidate_When_SmtpPortFieldIsEqualTo...
method test_Should_PassToValidate_When_SmtpPortFieldIsEqualToMax (line 143) | public function test_Should_PassToValidate_When_SmtpPortFieldIsEqualTo...
method test_Should_FailToValidate_When_SmtpPortFieldIsLessThanMin (line 166) | public function test_Should_FailToValidate_When_SmtpPortFieldIsLessTha...
method test_Should_FailToValidate_When_SmtpPortFieldIsGreaterThanMax (line 189) | public function test_Should_FailToValidate_When_SmtpPortFieldIsGreater...
method test_Should_FailToValidate_When_SmtpEncryptionFieldIsInvalid (line 212) | public function test_Should_FailToValidate_When_SmtpEncryptionFieldIsI...
FILE: tests/Services/Form/Setting/MailSettingFormTest.php
class MailSettingFormTest (line 5) | class MailSettingFormTest extends TestCase
method setUp (line 13) | public function setUp()
method test_Should_SucceedToUpdate_When_ValidationPasses (line 21) | public function test_Should_SucceedToUpdate_When_ValidationPasses()
method test_Should_FailToUpdate_When_ValidationFails (line 53) | public function test_Should_FailToUpdate_When_ValidationFails()
method test_Should_GetValidationErrors (line 70) | public function test_Should_GetValidationErrors()
FILE: tests/Services/Form/User/UserFormLaravelValidatorTest.php
class UserFormLaravelValidatorTest (line 7) | class UserFormLaravelValidatorTest extends TestCase
method test_Should_PassToValidate_When_NameFieldIsValid (line 11) | public function test_Should_PassToValidate_When_NameFieldIsValid()
method test_Should_PassToValidate_When_EmailFieldIsValid (line 26) | public function test_Should_PassToValidate_When_EmailFieldIsValid()
method test_Should_FailToValidate_When_EmailFieldIsInvalid (line 41) | public function test_Should_FailToValidate_When_EmailFieldIsInvalid()
method test_Should_PassToValidate_When_PasswordFieldAndPasswordConfirmationFieldAreValid (line 56) | public function test_Should_PassToValidate_When_PasswordFieldAndPasswo...
method test_Should_FailToValidate_When_PasswordFieldAndPasswordConfirmationFieldAreInvalid (line 72) | public function test_Should_FailToValidate_When_PasswordFieldAndPasswo...
method test_Should_FailToValidate_When_PasswordFieldAndPasswordConfirmationFieldAreDifferent (line 88) | public function test_Should_FailToValidate_When_PasswordFieldAndPasswo...
method test_Should_PassToValidate_When_RoleFieldIsValid (line 104) | public function test_Should_PassToValidate_When_RoleFieldIsValid()
method test_Should_FailToValidate_When_RoleFieldIsInvalid (line 131) | public function test_Should_FailToValidate_When_RoleFieldIsInvalid()
method test_Should_FailToValidate_When_EmailFieldIsNotUniqueAndIdFieldIsNotSpecified (line 146) | public function test_Should_FailToValidate_When_EmailFieldIsNotUniqueA...
method test_Should_PassToValidate_When_EmailFieldIsNotUniqueAndIdFieldIsSpecified (line 165) | public function test_Should_PassToValidate_When_EmailFieldIsNotUniqueA...
FILE: tests/Services/Form/User/UserFormTest.php
class UserFormTest (line 5) | class UserFormTest extends TestCase
method setUp (line 15) | public function setUp()
method test_Should_SucceedToSave_When_ValidationPassesAndRoleFieldIsNotSpecified (line 24) | public function test_Should_SucceedToSave_When_ValidationPassesAndRole...
method test_Should_SucceedToSave_When_ValidationPassesAndRoleFieldIsSpecified (line 45) | public function test_Should_SucceedToSave_When_ValidationPassesAndRole...
method test_Should_FailToSave_When_ValidationFails (line 71) | public function test_Should_FailToSave_When_ValidationFails()
method test_Should_SucceedToUpdate_When_ValidationPasses (line 88) | public function test_Should_SucceedToUpdate_When_ValidationPasses()
method test_Should_FailToUpdate_When_ValidationFails (line 110) | public function test_Should_FailToUpdate_When_ValidationFails()
method test_Should_SucceedToUpdatePassword_When_ValidationPasses (line 127) | public function test_Should_SucceedToUpdatePassword_When_ValidationPas...
method test_Should_FailToUpdatePassword_When_ValidationFails (line 149) | public function test_Should_FailToUpdatePassword_When_ValidationFails()
method test_Should_SucceedToUpdateRole_When_ValidationPasses (line 166) | public function test_Should_SucceedToUpdateRole_When_ValidationPasses()
method test_Should_FailToUpdateRole_When_ValidationFails (line 188) | public function test_Should_FailToUpdateRole_When_ValidationFails()
method test_Should_GetValidationErrors (line 205) | public function test_Should_GetValidationErrors()
FILE: tests/Services/Notification/MailNotifierTest.php
class MailNotifierTest (line 5) | class MailNotifierTest extends TestCase
method test_Should_SetFromAddressAndReturnThis (line 9) | public function test_Should_SetFromAddressAndReturnThis()
method test_Should_SetToAddressAndReturnThis (line 18) | public function test_Should_SetToAddressAndReturnThis()
method test_Should_SendEmailNotification_When_ToAddressIsSet (line 27) | public function test_Should_SendEmailNotification_When_ToAddressIsSet()
FILE: tests/Specifications/DeploymentSpecificationTest.php
class DeploymentSpecificationTest (line 5) | class DeploymentSpecificationTest extends TestCase
method setUp (line 11) | public function setUp()
method test_Should_GetSatisfyingElements (line 18) | public function test_Should_GetSatisfyingElements()
FILE: tests/Specifications/OldDeploymentSpecificationTest.php
class OldDeploymentSpecificationTest (line 5) | class OldDeploymentSpecificationTest extends TestCase
method setUp (line 11) | public function setUp()
method test_Should_GetSatisfyingElements_When_DaysToKeepDeploymentsIsSetAndKeepLastDeploymentIsFalseAndMaxNumberDeploymentsToKeepIsSet (line 18) | public function test_Should_GetSatisfyingElements_When_DaysToKeepDeplo...
method test_Should_GetSatisfyingElements_When_DaysToKeepDeploymentsIsNotSetAndKeepLastDeploymentIsFalseAndMaxNumberDeploymentsToKeepIsSet (line 75) | public function test_Should_GetSatisfyingElements_When_DaysToKeepDeplo...
method test_Should_GetSatisfyingElements_When_DaysToKeepDeploymentsIsSetAndKeepLastDeploymentIsFalseAndMaxNumberDeploymentsToKeepIsNotSet (line 124) | public function test_Should_GetSatisfyingElements_When_DaysToKeepDeplo...
method test_Should_GetSatisfyingElements_When_DaysToKeepDeploymentsIsSetAndKeepLastDeploymentIsTrueMaxNumberDeploymentsToKeepIsNotSet (line 162) | public function test_Should_GetSatisfyingElements_When_DaysToKeepDeplo...
method test_Should_GetSatisfyingElements_When_DaysToKeepDeploymentsIsNotSetAndKeepLastDeploymentIsFalseAndMaxNumberDeploymentsToKeepIsNotSet (line 202) | public function test_Should_GetSatisfyingElements_When_DaysToKeepDeplo...
method test_Should_GetSatisfyingElements_When_DeploymentsDoNotExists (line 231) | public function test_Should_GetSatisfyingElements_When_DeploymentsDoNo...
FILE: tests/TestCase.php
class TestCase (line 3) | class TestCase extends Illuminate\Foundation\Testing\TestCase
method createApplication (line 14) | public function createApplication()
method setUp (line 23) | public function setUp()
method tearDown (line 32) | public function tearDown()
FILE: tests/_helpers/ConsoleCommandTestHelper.php
type ConsoleCommandTestHelper (line 8) | trait ConsoleCommandTestHelper
method runConsoleCommand (line 10) | protected function runConsoleCommand(Command $command, $arguments = []...
FILE: tests/_helpers/ControllerTestHelper.php
type ControllerTestHelper (line 7) | trait ControllerTestHelper
method post (line 9) | public function post($uri, array $data = [], array $headers = [])
method put (line 18) | public function put($uri, array $data = [], array $headers = [])
method delete (line 27) | public function delete($uri, array $data = [], array $headers = [])
method auth (line 36) | protected function auth($obj = null, $data = [])
FILE: tests/_helpers/DummyMiddleware.php
class DummyMiddleware (line 7) | class DummyMiddleware
method handle (line 16) | public function handle($request, Closure $next)
FILE: tests/_helpers/Factory.php
class Factory (line 5) | class Factory
method build (line 7) | public static function build($class, $data = [])
method create (line 14) | public static function create($class, $data = [])
method buildList (line 23) | public static function buildList($class, $dataList = [])
method createList (line 32) | public static function createList($class, $dataList = [])
method getInstance (line 41) | protected function getInstance($class, $data = [])
FILE: tests/_helpers/MockeryHelper.php
type MockeryHelper (line 7) | trait MockeryHelper
method tearDown (line 9) | public function tearDown()
method mock (line 16) | protected function mock($class)
method mockPartial (line 25) | protected function mockPartial($class)
Condensed preview — 341 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (965K chars).
[
{
"path": ".coveralls.yml",
"chars": 24,
"preview": "service_name: travis-ci\n"
},
{
"path": ".gitattributes",
"chars": 61,
"preview": "* text=auto\n*.css linguist-vendored\n*.less linguist-vendored\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 591,
"preview": "# These are supported funding model platforms\n\ngithub: ngmy\npatreon: # Replace with a single Patreon username\nopen_colle"
},
{
"path": ".gitignore",
"chars": 33,
"preview": "/vendor\n/node_modules\n.env\n*.swp\n"
},
{
"path": ".travis.yml",
"chars": 384,
"preview": "language: php\n\nphp:\n - 5.6\n - 7.0\n - 7.1\n - 7.2\n - 7.3\n - 7.4\n\nservices:\n - mysql\n\nbefore_script:\n - curl -s htt"
},
{
"path": "LICENSE",
"chars": 1081,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Yuta Nagamiya\n\nPermission is hereby granted, free of charge, to any person obt"
},
{
"path": "README.md",
"chars": 4488,
"preview": "# Webloyer\n\n[](https://packagist.org/packages/ngm"
},
{
"path": "SCREENSHOTS.md",
"chars": 2509,
"preview": "# Screenshots\n\n## Login\n\n[ {\n $breadcrumbs->push('Projects', route('proje"
},
{
"path": "app/Http/routes.php",
"chars": 3620,
"preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Application Routes\n|------------"
},
{
"path": "app/Jobs/Deploy.php",
"chars": 6070,
"preview": "<?php\n\nnamespace App\\Jobs;\n\nuse App\\Jobs\\Job;\nuse App\\Repositories\\Project\\ProjectInterface;\nuse App\\Repositories\\Server"
},
{
"path": "app/Jobs/Job.php",
"chars": 535,
"preview": "<?php\n\nnamespace App\\Jobs;\n\nuse Illuminate\\Bus\\Queueable;\n\nabstract class Job\n{\n /*\n |----------------------------"
},
{
"path": "app/Jobs/Rollback.php",
"chars": 6074,
"preview": "<?php\n\nnamespace App\\Jobs;\n\nuse App\\Jobs\\Job;\nuse App\\Repositories\\Project\\ProjectInterface;\nuse App\\Repositories\\Server"
},
{
"path": "app/Listeners/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "app/Models/BaseModel.php",
"chars": 212,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass BaseModel extends Model\n{\n protected fun"
},
{
"path": "app/Models/Deployment.php",
"chars": 820,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Robbo\\Presenter\\PresentableInterface;\nuse SensioLabs\\AnsiConverter\\AnsiToHtmlConverter"
},
{
"path": "app/Models/DeploymentPresenter.php",
"chars": 1190,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Robbo\\Presenter\\Presenter;\n\nclass DeploymentPresenter extends Presenter\n{\n protecte"
},
{
"path": "app/Models/MaxDeployment.php",
"chars": 231,
"preview": "<?php\n\nnamespace App\\Models;\n\nclass MaxDeployment extends BaseModel\n{\n protected $table = 'max_deployments';\n\n pro"
},
{
"path": "app/Models/Project.php",
"chars": 5006,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse App\\Specifications\\DeploymentSpecification;\nuse Ngmy\\EloquentSerializedLob\\SerializedL"
},
{
"path": "app/Models/Recipe.php",
"chars": 439,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Recipe extends BaseModel\n{\n protected $t"
},
{
"path": "app/Models/Server.php",
"chars": 231,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass Server extends BaseModel\n{\n protected $t"
},
{
"path": "app/Models/Setting.php",
"chars": 664,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Ngmy\\EloquentSerializedLob\\SerializedLobTrait;\n\nclass Setting extends BaseModel\n{\n "
},
{
"path": "app/Models/User.php",
"chars": 1114,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Auth\\Authenticatable;\nuse Illuminate\\Auth\\Passwords\\CanResetPassword;\nuse I"
},
{
"path": "app/Policies/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "app/Providers/AppServiceProvider.php",
"chars": 6201,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse App\\Services\\Deployment\\QueueDeployCommander;\nuse App\\Services\\Deployment\\DeployerF"
},
{
"path": "app/Providers/AuthServiceProvider.php",
"chars": 693,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Contracts\\Auth\\Access\\Gate as GateContract;\nuse Illuminate\\Foundation\\Su"
},
{
"path": "app/Providers/EventServiceProvider.php",
"chars": 706,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Contracts\\Events\\Dispatcher as DispatcherContract;\nuse Illuminate\\Founda"
},
{
"path": "app/Providers/RepositoryServiceProvider.php",
"chars": 2406,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse App\\Models\\Project;\nuse App\\Models\\Recipe;\nuse App\\Models\\Server;\nuse App\\Models\\Se"
},
{
"path": "app/Providers/RouteServiceProvider.php",
"chars": 2783,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Routing\\Router;\nuse Illuminate\\Foundation\\Support\\Providers\\RouteService"
},
{
"path": "app/Repositories/AbstractConfigRepository.php",
"chars": 936,
"preview": "<?php\n\nnamespace App\\Repositories;\n\nuse App\\Services\\Config\\ConfigReaderInterface;\nuse App\\Services\\Config\\ConfigWriterI"
},
{
"path": "app/Repositories/AbstractEloquentRepository.php",
"chars": 1749,
"preview": "<?php\n\nnamespace App\\Repositories;\n\nabstract class AbstractEloquentRepository implements RepositoryInterface\n{\n prote"
},
{
"path": "app/Repositories/Project/EloquentProject.php",
"chars": 1006,
"preview": "<?php\n\nnamespace App\\Repositories\\Project;\n\nuse App\\Repositories\\AbstractEloquentRepository;\nuse Illuminate\\Database\\Elo"
},
{
"path": "app/Repositories/Project/ProjectInterface.php",
"chars": 146,
"preview": "<?php\n\nnamespace App\\Repositories\\Project;\n\nuse App\\Repositories\\RepositoryInterface;\n\ninterface ProjectInterface extend"
},
{
"path": "app/Repositories/Recipe/EloquentRecipe.php",
"chars": 893,
"preview": "<?php\n\nnamespace App\\Repositories\\Recipe;\n\nuse App\\Repositories\\AbstractEloquentRepository;\nuse Illuminate\\Database\\Eloq"
},
{
"path": "app/Repositories/Recipe/RecipeInterface.php",
"chars": 144,
"preview": "<?php\n\nnamespace App\\Repositories\\Recipe;\n\nuse App\\Repositories\\RepositoryInterface;\n\ninterface RecipeInterface extends "
},
{
"path": "app/Repositories/RepositoryInterface.php",
"chars": 983,
"preview": "<?php\n\nnamespace App\\Repositories;\n\ninterface RepositoryInterface\n{\n /**\n * Get a model by id.\n *\n * @par"
},
{
"path": "app/Repositories/Role/EloquentRole.php",
"chars": 873,
"preview": "<?php\n\nnamespace App\\Repositories\\Role;\n\nuse App\\Repositories\\AbstractEloquentRepository;\nuse Illuminate\\Database\\Eloque"
},
{
"path": "app/Repositories/Role/RoleInterface.php",
"chars": 140,
"preview": "<?php\n\nnamespace App\\Repositories\\Role;\n\nuse App\\Repositories\\RepositoryInterface;\n\ninterface RoleInterface extends Repo"
},
{
"path": "app/Repositories/Server/EloquentServer.php",
"chars": 893,
"preview": "<?php\n\nnamespace App\\Repositories\\Server;\n\nuse App\\Repositories\\AbstractEloquentRepository;\nuse Illuminate\\Database\\Eloq"
},
{
"path": "app/Repositories/Server/ServerInterface.php",
"chars": 144,
"preview": "<?php\n\nnamespace App\\Repositories\\Server;\n\nuse App\\Repositories\\RepositoryInterface;\n\ninterface ServerInterface extends "
},
{
"path": "app/Repositories/Setting/AppSettingInterface.php",
"chars": 152,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Repositories\\Setting\\SettingInterface;\n\ninterface AppSettingInterfac"
},
{
"path": "app/Repositories/Setting/ConfigAppSetting.php",
"chars": 703,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Services\\Config\\ConfigReaderInterface;\nuse App\\Services\\Config\\Confi"
},
{
"path": "app/Repositories/Setting/ConfigDbSetting.php",
"chars": 1363,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Services\\Config\\ConfigReaderInterface;\nuse App\\Services\\Config\\Confi"
},
{
"path": "app/Repositories/Setting/ConfigMailSetting.php",
"chars": 2318,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Services\\Config\\ConfigReaderInterface;\nuse App\\Services\\Config\\Confi"
},
{
"path": "app/Repositories/Setting/DbSettingInterface.php",
"chars": 151,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Repositories\\Setting\\SettingInterface;\n\ninterface DbSettingInterface"
},
{
"path": "app/Repositories/Setting/EloquentSetting.php",
"chars": 1889,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Repositories\\AbstractEloquentRepository;\nuse App\\Repositories\\Settin"
},
{
"path": "app/Repositories/Setting/MailSettingInterface.php",
"chars": 153,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Repositories\\Setting\\SettingInterface;\n\ninterface MailSettingInterfa"
},
{
"path": "app/Repositories/Setting/SettingInterface.php",
"chars": 146,
"preview": "<?php\n\nnamespace App\\Repositories\\Setting;\n\nuse App\\Repositories\\RepositoryInterface;\n\ninterface SettingInterface extend"
},
{
"path": "app/Repositories/User/EloquentUser.php",
"chars": 873,
"preview": "<?php\n\nnamespace App\\Repositories\\User;\n\nuse App\\Repositories\\AbstractEloquentRepository;\nuse Illuminate\\Database\\Eloque"
},
{
"path": "app/Repositories/User/UserInterface.php",
"chars": 140,
"preview": "<?php\n\nnamespace App\\Repositories\\User;\n\nuse App\\Repositories\\RepositoryInterface;\n\ninterface UserInterface extends Repo"
},
{
"path": "app/Services/Api/JsonRpc.php",
"chars": 2105,
"preview": "<?php\n\nnamespace App\\Services\\Api;\n\nuse App\\Repositories\\Project\\ProjectInterface;\nuse App\\Services\\Form\\Deployment\\Depl"
},
{
"path": "app/Services/Api/Middleware/Authenticate.php",
"chars": 618,
"preview": "<?php\n\nnamespace App\\Services\\Api\\Middleware;\n\nuse JsonRPC\\MiddlewareInterface;\nuse JsonRPC\\Exception\\AuthenticationFail"
},
{
"path": "app/Services/Config/ConfigReaderInterface.php",
"chars": 230,
"preview": "<?php\n\nnamespace App\\Services\\Config;\n\ninterface ConfigReaderInterface\n{\n /**\n * Get configuration.\n *\n *"
},
{
"path": "app/Services/Config/ConfigWriterInterface.php",
"chars": 286,
"preview": "<?php\n\nnamespace App\\Services\\Config;\n\ninterface ConfigWriterInterface\n{\n /**\n * Set configuration.\n *\n *"
},
{
"path": "app/Services/Config/DotenvReader.php",
"chars": 940,
"preview": "<?php\n\nnamespace App\\Services\\Config;\n\nuse App\\Services\\Config\\ConfigReaderInterface;\nuse App\\Services\\Filesystem\\Filesy"
},
{
"path": "app/Services/Config/DotenvWriter.php",
"chars": 922,
"preview": "<?php\n\nnamespace App\\Services\\Config;\n\nuse App\\Services\\Config\\ConfigWriterInterface;\nuse App\\Services\\Filesystem\\Filesy"
},
{
"path": "app/Services/Deployment/DeployCommanderInterface.php",
"chars": 393,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\ninterface DeployCommanderInterface\n{\n /**\n * Give the command to deplo"
},
{
"path": "app/Services/Deployment/DeployerDeploymentFileBuilder.php",
"chars": 3089,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\nuse App\\Services\\Deployment\\DeployerFile;\nuse App\\Services\\Filesystem\\Filesys"
},
{
"path": "app/Services/Deployment/DeployerFile.php",
"chars": 919,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\nclass DeployerFile\n{\n protected $baseName;\n\n protected $fullPath;\n\n "
},
{
"path": "app/Services/Deployment/DeployerFileBuilderInterface.php",
"chars": 555,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\ninterface DeployerFileBuilderInterface\n{\n /**\n * Set a deployer file p"
},
{
"path": "app/Services/Deployment/DeployerFileDirector.php",
"chars": 521,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\nclass DeployerFileDirector\n{\n protected $fileBuilder;\n\n public function"
},
{
"path": "app/Services/Deployment/DeployerRecipeFileBuilder.php",
"chars": 1869,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\nuse App\\Services\\Deployment\\DeployerFile;\nuse App\\Services\\Filesystem\\Filesys"
},
{
"path": "app/Services/Deployment/DeployerServerListFileBuilder.php",
"chars": 3004,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\nuse App\\Services\\Deployment\\DeployerFile;\nuse App\\Services\\Filesystem\\Filesys"
},
{
"path": "app/Services/Deployment/QueueDeployCommander.php",
"chars": 838,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\nuse App\\Jobs\\Deploy;\nuse App\\Jobs\\Rollback;\n\nuse Illuminate\\Contracts\\Bus\\Dis"
},
{
"path": "app/Services/Deployment/StorageDeployCommander.php",
"chars": 731,
"preview": "<?php\n\nnamespace App\\Services\\Deployment;\n\nuse Storage;\n\nclass StorageDeployCommander implements DeployCommanderInterfac"
},
{
"path": "app/Services/Filesystem/FilesystemInterface.php",
"chars": 426,
"preview": "<?php\n\nnamespace App\\Services\\Filesystem;\n\ninterface FilesystemInterface\n{\n /**\n * Write a file.\n *\n * @p"
},
{
"path": "app/Services/Filesystem/LaravelFilesystem.php",
"chars": 948,
"preview": "<?php\n\nnamespace App\\Services\\Filesystem;\n\nuse App\\Services\\Filesystem\\FilesystemInterface;\n\nuse Illuminate\\Filesystem\\F"
},
{
"path": "app/Services/Form/Deployment/DeploymentForm.php",
"chars": 2184,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Deployment;\n\nuse App\\Services\\Validation\\ValidableInterface;\nuse App\\Services\\Deploym"
},
{
"path": "app/Services/Form/Deployment/DeploymentFormLaravelValidator.php",
"chars": 371,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Deployment;\n\nuse App\\Services\\Validation\\AbstractLaravelValidator;\n\nclass DeploymentF"
},
{
"path": "app/Services/Form/Project/ProjectForm.php",
"chars": 3102,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Project;\n\nuse App\\Services\\Validation\\ValidableInterface;\nuse App\\Repositories\\Projec"
},
{
"path": "app/Services/Form/Project/ProjectFormLaravelValidator.php",
"chars": 1389,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Project;\n\nuse App\\Services\\Validation\\AbstractLaravelValidator;\n\nclass ProjectFormLar"
},
{
"path": "app/Services/Form/Recipe/RecipeForm.php",
"chars": 1572,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Recipe;\n\nuse App\\Services\\Validation\\ValidableInterface;\nuse App\\Repositories\\Recipe\\"
},
{
"path": "app/Services/Form/Recipe/RecipeFormLaravelValidator.php",
"chars": 261,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Recipe;\n\nuse App\\Services\\Validation\\AbstractLaravelValidator;\n\nclass RecipeFormLarav"
},
{
"path": "app/Services/Form/Server/ServerForm.php",
"chars": 1572,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Server;\n\nuse App\\Services\\Validation\\ValidableInterface;\nuse App\\Repositories\\Server\\"
},
{
"path": "app/Services/Form/Server/ServerFormLaravelValidator.php",
"chars": 261,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Server;\n\nuse App\\Services\\Validation\\AbstractLaravelValidator;\n\nclass ServerFormLarav"
},
{
"path": "app/Services/Form/Setting/MailSettingForm.php",
"chars": 2162,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Setting;\n\nuse App\\Services\\Validation\\ValidableInterface;\nuse App\\Repositories\\Settin"
},
{
"path": "app/Services/Form/Setting/MailSettingFormLaravelValidator.php",
"chars": 664,
"preview": "<?php\n\nnamespace App\\Services\\Form\\Setting;\n\nuse App\\Services\\Validation\\AbstractLaravelValidator;\n\nclass MailSettingFor"
},
{
"path": "app/Services/Form/User/UserForm.php",
"chars": 3200,
"preview": "<?php\n\nnamespace App\\Services\\Form\\User;\n\nuse DB;\nuse Hash;\nuse App\\Services\\Validation\\ValidableInterface;\nuse App\\Repo"
},
{
"path": "app/Services/Form/User/UserFormLaravelValidator.php",
"chars": 869,
"preview": "<?php\n\nnamespace App\\Services\\Form\\User;\n\nuse App\\Services\\Validation\\AbstractLaravelValidator;\n\nclass UserFormLaravelVa"
},
{
"path": "app/Services/Notification/MailNotifier.php",
"chars": 1214,
"preview": "<?php\n\nnamespace App\\Services\\Notification;\n\nuse Mail;\n\nclass MailNotifier implements NotifierInterface\n{\n /**\n *"
},
{
"path": "app/Services/Notification/NotifierInterface.php",
"chars": 630,
"preview": "<?php\n\nnamespace App\\Services\\Notification;\n\ninterface NotifierInterface\n{\n /**\n * Recipient of notification.\n "
},
{
"path": "app/Services/Validation/AbstractLaravelValidator.php",
"chars": 1456,
"preview": "<?php\n\nnamespace App\\Services\\Validation;\n\nuse Illuminate\\Validation\\Factory;\n\nabstract class AbstractLaravelValidator i"
},
{
"path": "app/Services/Validation/ValidableInterface.php",
"chars": 498,
"preview": "<?php\n\nnamespace App\\Services\\Validation;\n\ninterface ValidableInterface\n{\n /**\n * Add data to validation.\n *\n"
},
{
"path": "app/Specifications/DeploymentSpecification.php",
"chars": 407,
"preview": "<?php\n\nnamespace App\\Specifications;\n\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass DeploymentSpecification\n{\n /**\n "
},
{
"path": "app/Specifications/OldDeploymentSpecification.php",
"chars": 1771,
"preview": "<?php\n\nnamespace App\\Specifications;\n\nuse Illuminate\\Database\\Eloquent\\Model;\nuse DateTime;\n\nclass OldDeploymentSpecific"
},
{
"path": "app/Traits/RestExceptionHandlerTrait.php",
"chars": 2675,
"preview": "<?php\n\nnamespace App\\Traits;\n\nuse Exception;\nuse Illuminate\\Http\\Request;\nuse Symfony\\Component\\HttpKernel\\Exception\\Htt"
},
{
"path": "artisan",
"chars": 1641,
"preview": "#!/usr/bin/env php\n<?php\n\n/*\n|--------------------------------------------------------------------------\n| Register The "
},
{
"path": "bootstrap/app.php",
"chars": 1572,
"preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Create The Application\n|--------"
},
{
"path": "bootstrap/autoload.php",
"chars": 1079,
"preview": "<?php\n\ndefine('LARAVEL_START', microtime(true));\n\n/*\n|------------------------------------------------------------------"
},
{
"path": "bootstrap/cache/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "composer.json",
"chars": 3676,
"preview": "{\n \"name\": \"ngmy/webloyer\",\n \"description\": \"Webloyer is a Web UI for managing Deployer deployments\",\n \"keyword"
},
{
"path": "config/acl.php",
"chars": 634,
"preview": "<?php\n\nreturn [\n\n /**\n * Model definitions.\n * If you want to use your own model and extend it\n * to pack"
},
{
"path": "config/app.php",
"chars": 9019,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Applicatio"
},
{
"path": "config/auth.php",
"chars": 3532,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Authentica"
},
{
"path": "config/cache.php",
"chars": 2140,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Ca"
},
{
"path": "config/compile.php",
"chars": 1188,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Additional"
},
{
"path": "config/database.php",
"chars": 4074,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | PDO Fetch "
},
{
"path": "config/filesystems.php",
"chars": 2135,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Fi"
},
{
"path": "config/mail.php",
"chars": 3940,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Mail Drive"
},
{
"path": "config/queue.php",
"chars": 2630,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Qu"
},
{
"path": "config/services.php",
"chars": 831,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Third Part"
},
{
"path": "config/session.php",
"chars": 5303,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Se"
},
{
"path": "config/view.php",
"chars": 1021,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | View Stora"
},
{
"path": "database/.gitignore",
"chars": 9,
"preview": "*.sqlite\n"
},
{
"path": "database/migrations/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "database/migrations/2014_10_12_000000_create_users_table.php",
"chars": 758,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateUsersTable e"
},
{
"path": "database/migrations/2014_10_12_100000_create_password_resets_table.php",
"chars": 633,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreatePasswordRese"
},
{
"path": "database/migrations/2015_02_07_172606_create_roles_table.php",
"chars": 684,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateRolesTable e"
},
{
"path": "database/migrations/2015_02_07_172633_create_role_user_table.php",
"chars": 856,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateRoleUserTabl"
},
{
"path": "database/migrations/2015_02_07_172649_create_permissions_table.php",
"chars": 856,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreatePermissionsT"
},
{
"path": "database/migrations/2015_02_07_172657_create_permission_role_table.php",
"chars": 892,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreatePermissionRo"
},
{
"path": "database/migrations/2015_02_17_152439_create_permission_user_table.php",
"chars": 892,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreatePermissionUs"
},
{
"path": "database/migrations/2015_02_22_123238_create_recipes_table.php",
"chars": 656,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateRecipesTable"
},
{
"path": "database/migrations/2015_02_23_123238_create_servers_table.php",
"chars": 656,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateServersTable"
},
{
"path": "database/migrations/2015_02_28_164641_create_projects_table.php",
"chars": 1494,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateProjectsTabl"
},
{
"path": "database/migrations/2015_03_01_084552_create_deployments_table.php",
"chars": 1072,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateDeploymentsT"
},
{
"path": "database/migrations/2015_05_28_132914_create_max_deployments_table.php",
"chars": 879,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateMaxDeploymen"
},
{
"path": "database/migrations/2015_06_16_143119_create_jobs_table.php",
"chars": 861,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateJobsTable ex"
},
{
"path": "database/migrations/2015_08_10_143119_create_project_recipe_table.php",
"chars": 1072,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateProjectRecip"
},
{
"path": "database/migrations/2016_08_24_041250_create_settings_table.php",
"chars": 634,
"preview": "<?php\n\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateSettingsTabl"
},
{
"path": "database/seeds/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "database/seeds/DatabaseSeeder.php",
"chars": 521,
"preview": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass DatabaseSeeder extends Seeder\n{\n "
},
{
"path": "database/seeds/PermissionRoleTableSeeder.php",
"chars": 1227,
"preview": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse Kodeine\\Acl\\Models\\Eloquent\\Role;\n\nclass PermissionRoleTableSeeder extends Se"
},
{
"path": "database/seeds/PermissionTableSeeder.php",
"chars": 5786,
"preview": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse Kodeine\\Acl\\Models\\Eloquent\\Permission;\n\nclass PermissionTableSeeder extends "
},
{
"path": "database/seeds/RecipeTableSeeder.php",
"chars": 5361,
"preview": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse App\\Models\\Recipe;\n\nclass RecipeTableSeeder extends Seeder\n{\n public funct"
},
{
"path": "database/seeds/RoleTableSeeder.php",
"chars": 879,
"preview": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse Kodeine\\Acl\\Models\\Eloquent\\Role;\n\nclass RoleTableSeeder extends Seeder\n{\n "
},
{
"path": "database/seeds/RoleUserTableSeeder.php",
"chars": 341,
"preview": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse App\\Models\\User;\nuse Kodeine\\Acl\\Models\\Eloquent\\RoleUser;\n\nclass RoleUserTab"
},
{
"path": "database/seeds/UserTableSeeder.php",
"chars": 343,
"preview": "<?php\n\nuse Illuminate\\Database\\Seeder;\nuse App\\Models\\User;\n\nclass UserTableSeeder extends Seeder\n{\n public function "
},
{
"path": "gulpfile.js",
"chars": 503,
"preview": "var elixir = require('laravel-elixir');\n\n/*\n |--------------------------------------------------------------------------"
},
{
"path": "package.json",
"chars": 98,
"preview": "{\n \"private\": true,\n \"devDependencies\": {\n \"gulp\": \"^3.8.8\",\n \"laravel-elixir\": \"*\"\n }\n}\n"
},
{
"path": "phpspec.yml",
"chars": 87,
"preview": "suites:\n main:\n namespace: App\n psr4_prefix: App\n src_path: app"
},
{
"path": "phpunit.xml",
"chars": 2561,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit backupGlobals=\"false\"\n backupStaticAttributes=\"false\"\n b"
},
{
"path": "public/.gitignore",
"chars": 8,
"preview": "/vendor\n"
},
{
"path": "public/.htaccess",
"chars": 356,
"preview": "<IfModule mod_rewrite.c>\n <IfModule mod_negotiation.c>\n Options -MultiViews\n </IfModule>\n\n RewriteEngine"
},
{
"path": "public/css/app.css",
"chars": 131714,
"preview": "/*! normalize.css v3.0.2 | MIT License | git.io/normalize */\nhtml {\n font-family: sans-serif;\n -ms-text-size-adjust: 1"
},
{
"path": "public/index.php",
"chars": 1781,
"preview": "<?php\n\n/**\n * Laravel - A PHP Framework For Web Artisans\n *\n * @package Laravel\n * @author Taylor Otwell <taylorotwel"
},
{
"path": "public/js/.gitignore",
"chars": 8,
"preview": "/vendor\n"
},
{
"path": "public/robots.txt",
"chars": 24,
"preview": "User-agent: *\nDisallow:\n"
},
{
"path": "resources/assets/less/app.less",
"chars": 206,
"preview": "@import \"bootstrap/bootstrap\";\n@import \"webloyer/bootstrap\";\n\n@btn-font-weight: 300;\n@font-family-sans-serif: \"Roboto\", "
},
{
"path": "resources/assets/less/bootstrap/alerts.less",
"chars": 1513,
"preview": "//\n// Alerts\n// --------------------------------------------------\n\n\n// Base styles\n// -------------------------\n\n.alert"
},
{
"path": "resources/assets/less/bootstrap/badges.less",
"chars": 1171,
"preview": "//\n// Badges\n// --------------------------------------------------\n\n\n// Base class\n.badge {\n display: inline-block;\n m"
},
{
"path": "resources/assets/less/bootstrap/bootstrap.less",
"chars": 1121,
"preview": "// Core variables and mixins\n@import \"variables.less\";\n@import \"mixins.less\";\n\n// Reset and dependencies\n@import \"normal"
},
{
"path": "resources/assets/less/bootstrap/breadcrumbs.less",
"chars": 594,
"preview": "//\n// Breadcrumbs\n// --------------------------------------------------\n\n\n.breadcrumb {\n padding: @breadcrumb-padding-v"
},
{
"path": "resources/assets/less/bootstrap/button-groups.less",
"chars": 5624,
"preview": "//\n// Button groups\n// --------------------------------------------------\n\n// Make the div behave like a button\n.btn-gro"
},
{
"path": "resources/assets/less/bootstrap/buttons.less",
"chars": 3552,
"preview": "//\n// Buttons\n// --------------------------------------------------\n\n\n// Base styles\n// --------------------------------"
},
{
"path": "resources/assets/less/bootstrap/carousel.less",
"chars": 5318,
"preview": "//\n// Carousel\n// --------------------------------------------------\n\n\n// Wrapper for the slide container and indicators"
},
{
"path": "resources/assets/less/bootstrap/close.less",
"chars": 683,
"preview": "//\n// Close icons\n// --------------------------------------------------\n\n\n.close {\n float: right;\n font-size: (@font-s"
},
{
"path": "resources/assets/less/bootstrap/code.less",
"chars": 1401,
"preview": "//\n// Code (inline and block)\n// --------------------------------------------------\n\n\n// Inline and block code styles\nco"
},
{
"path": "resources/assets/less/bootstrap/component-animations.less",
"chars": 709,
"preview": "//\n// Component animations\n// --------------------------------------------------\n\n// Heads up!\n//\n// We don't use the `."
},
{
"path": "resources/assets/less/bootstrap/dropdowns.less",
"chars": 4754,
"preview": "//\n// Dropdown menus\n// --------------------------------------------------\n\n\n// Dropdown arrow/caret\n.caret {\n display:"
},
{
"path": "resources/assets/less/bootstrap/forms.less",
"chars": 13847,
"preview": "//\n// Forms\n// --------------------------------------------------\n\n\n// Normalize non-controls\n//\n// Restyle and baseline"
},
{
"path": "resources/assets/less/bootstrap/glyphicons.less",
"chars": 14948,
"preview": "//\n// Glyphicons for Bootstrap\n//\n// Since icons are fonts, they can be placed anywhere text is placed and are\n// thus a"
},
{
"path": "resources/assets/less/bootstrap/grid.less",
"chars": 1387,
"preview": "//\n// Grid system\n// --------------------------------------------------\n\n\n// Container widths\n//\n// Set the container wi"
},
{
"path": "resources/assets/less/bootstrap/input-groups.less",
"chars": 4215,
"preview": "//\n// Input groups\n// --------------------------------------------------\n\n// Base styles\n// -------------------------\n.i"
},
{
"path": "resources/assets/less/bootstrap/jumbotron.less",
"chars": 983,
"preview": "//\n// Jumbotron\n// --------------------------------------------------\n\n\n.jumbotron {\n padding: @jumbotron-padding (@jum"
},
{
"path": "resources/assets/less/bootstrap/labels.less",
"chars": 1079,
"preview": "//\n// Labels\n// --------------------------------------------------\n\n.label {\n display: inline;\n padding: .2em .6em .3e"
},
{
"path": "resources/assets/less/bootstrap/list-group.less",
"chars": 3022,
"preview": "//\n// List groups\n// --------------------------------------------------\n\n\n// Base class\n//\n// Easily usable on <ul>, <ol"
},
{
"path": "resources/assets/less/bootstrap/media.less",
"chars": 652,
"preview": ".media {\n // Proper spacing between instances of .media\n margin-top: 15px;\n\n &:first-child {\n margin-top: 0;\n }\n}"
},
{
"path": "resources/assets/less/bootstrap/mixins/alerts.less",
"chars": 257,
"preview": "// Alerts\n\n.alert-variant(@background; @border; @text-color) {\n background-color: @background;\n border-color: @border;"
},
{
"path": "resources/assets/less/bootstrap/mixins/background-variant.less",
"chars": 139,
"preview": "// Contextual backgrounds\n\n.bg-variant(@color) {\n background-color: @color;\n a&:hover {\n background-color: darken(@"
},
{
"path": "resources/assets/less/bootstrap/mixins/border-radius.less",
"chars": 468,
"preview": "// Single side border-radius\n\n.border-top-radius(@radius) {\n border-top-right-radius: @radius;\n border-top-left-radiu"
},
{
"path": "resources/assets/less/bootstrap/mixins/buttons.less",
"chars": 1080,
"preview": "// Button variants\n//\n// Easily pump out default styles, as well as :hover, :focus, :active,\n// and disabled options for"
},
{
"path": "resources/assets/less/bootstrap/mixins/center-block.less",
"chars": 120,
"preview": "// Center-align a block level element\n\n.center-block() {\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n"
},
{
"path": "resources/assets/less/bootstrap/mixins/clearfix.less",
"chars": 605,
"preview": "// Clearfix\n//\n// For modern browsers\n// 1. The space content is one way to avoid an Opera bug when the\n// contentedi"
},
{
"path": "resources/assets/less/bootstrap/mixins/forms.less",
"chars": 2641,
"preview": "// Form validation states\n//\n// Used in forms.less to generate the form validation CSS for warnings, errors,\n// and succ"
},
{
"path": "resources/assets/less/bootstrap/mixins/gradients.less",
"chars": 4388,
"preview": "// Gradients\n\n#gradient {\n\n // Horizontal gradient, from left to right\n //\n // Creates two color stops, start and end"
},
{
"path": "resources/assets/less/bootstrap/mixins/grid-framework.less",
"chars": 2784,
"preview": "// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any va"
},
{
"path": "resources/assets/less/bootstrap/mixins/grid.less",
"chars": 3094,
"preview": "// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n// Centered container element\n.container-fixed(@"
}
]
// ... and 141 more files (download for full content)
About this extraction
This page contains the full source code of the ngmy/webloyer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 341 files (879.7 KB), approximately 228.2k tokens, and a symbol index with 810 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.