xtraorange / jenkinize_laravel
Create an CI/CD pipeline in any Laravel project with fewer steps.
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Dockerfile
README
Jenkinize Laravel is a utility to facilitate the configuration of your Laravel environment and setup your deployment pipeline with Jenkins. It enables you to establish your development, staging, and production environments with just a few simple steps.
Getting Started
Follow these instructions to integrate "Jenkinize Laravel" into your existing or new Laravel project.
Prerequisites
Before you begin, make sure you have:
Pre-setup Steps
- Create MySQL volumes (
project_name_env_mysql
). - Create environment networks (
project_name_env_network
). - Set up the MySQL stack using the
mysql_portainer_custom_template.txt
provided in the repository. - Verify the configuration in your
Jenkinsfile
. - Push your code to the repository and let Jenkins handle the rest.
Installation
To install "Jenkinize Laravel", follow these steps:
-
Navigate to your Laravel project directory.
-
Require "Jenkinize Laravel" into your project using Composer:
composer require xtraorange/jenkinize-laravel
-
In Jenkins, create a new multi-branch pipeline.
-
Choose GitHub as the branch source and provide your GitHub credentials.
-
Add your repository URL and validate it.
-
Set "Discover branches" to "All Branches".
Next, you need to publish all the assets that you want to use. You can either publish all assets by running:
php artisan vendor:publish
Or publish specific assets by specifying their tags:
php artisan vendor:publish --tag=jenkinsfile
php artisan vendor:publish --tag=jenkinize-config
php artisan vendor:publish --tag=docker
php artisan vendor:publish --tag=docker-jenkins
Usage
Once "Jenkinize Laravel" is installed, you can set up your environments and deployment pipeline:
- Create a definition for each of your environments in the
jenkinize.config
file. - For each environment, create a corresponding
.env.[environment name]
file. Avoid storing sensitive information in this file. - For each environment, create a corresponding secret in Jenkins for sensitive environment variable values.
(Provide more detailed instructions here)
Contributing
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
TODO
- Explore Docker registry options in Jenkins.
- Specify Jenkins Docker deployment details.
- Implement automatic deployment of an appropriate database image (perhaps create a dedicated directory for Docker files?).
- Refine stage setups.
- Write setup instructions for Jenkins and other prerequisite components.