Skip to content

festin666/Yii2Build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2Build

Gradle plugin for build basic Yii2 projects

Yii2 PHP projects have many things when deploy - composer update, migrations for DB, tests rebuild, add default user, ... I forget something sometimes. Deploying from scratch like a hell for me.

Now, you can place into build.gradle this code:

plugins {
  id "com.github.festin666.yii2build" version "0.2-2"
}

yii2build {
	dotEnvEnabled = true
	rbacEnabled = true
	rbacMigrationsPath = '@app/vendor/yiisoft/yii2/rbac/migrations'
	commandCreatePermissions = 'perm/create-hierarchy'
	commandCreateAdmin = 'perm/create-admin'
}

And run gradle build for:

  • Install PHP dependencies by composer.
  • Roll up migrations by Yii2 internal system.
  • Roll up migrations for Yii2 RBAC.
  • Create RBAC permissions by your own command.
  • Create default user by your own command.

If you want to test your project, run gradle test for:

  • Roll up migrations by Yii2 internal system.
  • Roll up migrations for Yii2 RBAC.
  • Create RBAC permissions by your own command.
  • Create default user by your own command.
  • Run codeception unit tests.

All database operations in test task performs in test database (configured in tests/codeception/config/config.php).

You can only prepare test environment for usage (without running tests) by specifying -Ptesting for gradle: gradle build -Ptesting.

Config description:

About

Gradle plugin for build basic Yii2 projects

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages