
Build a production deployment workflow for a Laravel app by designing a CI/CD pipeline with GitLab and Jenkins, including local virtual machines and DigitalOcean cloud deployments.
Explore setting up virtual machines and configuring Laravel development with PHP. Build CI/CD pipelines using GitLab and Jenkins for deployment to staging and production.
Create and configure a virtual desktop by downloading ISO images from the Ubuntu website, selecting between Ubuntu desktop 22.04 LTS or 22.10, and downloading Ubuntu server 20.04 LTS.
We are going to install a virtual ubuntu desktop in this video
Learn to customize a virtual desktop by enabling full screen mode, inserting the guest additions CD image, and moving icons from the left to the bottom.
We will Install Virtual Server here
We will learn how to connect to the machines using SSH connection
Open the terminal and ssh the remote user at the server's ip address, for example 192.168.2.33, then enter the password to access the virtual server. Type exit to disconnect.
Explore how Digital Ocean provides droplets for hosting apps and databases, with a control panel and programming interface, data centers around the world, and a $200 credit for 60 days.
Create a Digital Ocean droplet by selecting a region and Ubuntu 22.04 LTS, choosing a size, and securing access with a password or SSH key, then use the web console.
Push your project to GitLab by verifying git is installed and configured, initializing the repo, staging and committing files, linking the remote origin, and pushing to GitLab.
Create and configure a dedicated deploy user for Laravel deployment, assign sudo privileges, and verify seamless login and deployment permissions on the production server.
Set up a lemp stack on the production server by installing linux, nginx, mysql, and php 8.1 with Laravel extensions, installing composer, removing apache, and verifying nginx serves default page.
Create and copy the deploy user's ssh key, add it to GitLab as an ssh key, enabling the deploy user to fetch code from the private repository.
Clone the project from GitLab to the production server using the SSH URL, stay logged in, then move the code from the deploy user's home directory to /var/www.
Install application dependencies and configure production environment variables using .env, apply 12-factor best practices, generate a secret key, set database credentials, run migrations, and prepare Nginx configuration.
Configure Nginx for a Laravel app by setting storage and bootstrap/cache ownership to www-data, adding the deploy user to the web group, and enabling the site configuration.
Install node.js on the production server, run npm install, and npm run build to generate production manifest.json in public/build, fixing the missing manifest caused by Git ignoring the build folder.
Discover Laravel's built-in testing with PHP unit, covering unit, feature, and browser tests; run via PHP artisan test and use an in-memory SQLite database for development.
Learn how to manually redeploy a Laravel app by preparing code, running tests, pulling updates on production, enabling maintenance mode, installing dependencies, migrating databases, building assets, and caching config.
Automate Laravel deployments by adding a deploy.sh script that runs maintenance mode, git pull, installs dependencies, migrates databases, caches config, compiles assets, and exits maintenance mode.
Update the login and register links to sign in and sign up, run automated tests, commit and push changes, and deploy to production with deploy script via its absolute path.
Create a custom alias in the deploy user's dot bash rc to shorten a long deployment command. Save, log out and back in, then run the alias to deploy.
Install Jenkins on ubuntu by setting up a virtual machine, java, and the debian repo. Open ip:8080, unlock with the initial admin password, install plugins, and create the admin user.
Configure Jenkins to send email notifications for pipeline failures using the email extension plugin and SMTP credentials, and test the setup with a sample email to verify real-time alerts.
Define a Jenkins pipeline with a Jenkinsfile stored in Git, using a declarative Groovy DSL to create build, test, and deploy stages, demonstrating a simple, readable CI/CD workflow.
Add the Jenkins user's SSH key to GitLab to enable Jenkins to fetch project code and support a CI/CD pipeline.
Explore the Jenkins workspace and home directory, where the pipeline stores source code and build artifacts, and observe the Laravel project code cloned from a remote repository.
Log into the Jenkins server, set up the project workspace, install dependencies with composer, run php artisan key:generate, build assets with npm, and run tests with php artisan test.
Configure the deploy stage to ssh into the production server as the deploy user and run the deploy script. Resolve host key verification and passwordless login for reliable Jenkins deployments.
Configure a webhook to trigger the Jenkins pipeline on GitLab push events, secure it with a secret token, and test the webhook to ensure automated builds on the master branch.
Demonstrate continuous integration and continuous deployment with a Jenkins pipeline, updating the remote code repository and deploying a new account page automatically.
Configure a Jenkinsfile to send email notifications when a pipeline fails by using the post section with a failure condition, pulling project name and build URL from environment variables.
Test the Jenkins pipeline with automated tests, learn how failures block production deployment, trigger email notifications, and how to fix a root page route in Laravel to resume deployment.
Extend your ci cd pipeline to continuous delivery by deploying changes to a staging server for testing before production, cloning an identical environment and preparing production on DigitalOcean.
Log into the droplet as admin and install php and required extensions, then purge apache. Install mysql, nginx, composer, and node.js with npm, and verify nginx in the browser.
Set up a MySQL database on the droplet with a dedicated user and strong password, grant full access, configure the Laravel app, set env vars, and generate a secret key.
Configure nginx on your droplet to serve the Laravel app by creating a virtual host, enabling it, testing syntax, installing npm dependencies, building assets, and running migrations.
Configure the Jenkins pipeline to deploy to staging by duplicating the deploy stage, then update for production while resolving ssh permission issues that block Jenkins from logging into the droplet.
Solve permission denied issues on a Jenkins CI/CD pipeline by configuring SSH access, exporting Jenkins public key to the production server, and testing a manual deployment step.
Configure a Jenkinsfile to require human input before deploying to production, pausing at staging for validation via an input message with abort or okay, then push changes to remote repository.
Create and set up a new user on a central virtual desktop for a second developer, then configure PHP, Composer, NodeJS, MySQL, Git, and GitLab access.
Submit a merge request from the feature branch to master, select the source and target branches, compare them, assign a reviewer, and provide a clear title and description.
Close a GitLab issue by selecting the issue, optionally adding a comment, and clicking the close button as part of collaborating on a GitLab project.
Continuous Integration Continuous Delivery/Deployment (CICD) is a very important part of modern-day software release processes. As a matter of fact, you can not survive as a DevOps Engineer without a good understanding of CICD.
This course is designed for web developers and beginner DevOps engineers who want to learn how to deploy a Laravel application to production, using the best practices of Continuous Integration and Continuous Deployment/Delivery (CICD).
The course covers the use of Git, GitLab, and Jenkins, to build and deploy a full-fledged laravel application. and to create a fully functional CICD pipeline.
By the end of this course, you will have learned
how to deploy a Laravel application to production and to any other environment,
How to redeploy the same application using deploy scripts, and how to design a functional CICD pipeline with Gitlab and Jenkins and later with GitLab CI.
How to collaborate on projects using GitLab. This a must-have skill if you want to work in an organization that has multiple developers, working on a project.
How to create and configure virtual machines on your personal computers, so you will be able to practice without the fear of being charged by a cloud service provider.
And more.
Everything we'll do will be hands-on and straight to the point.
If you are seeking a job as a Developer or a DevOps Engineer without any professional experience yet, this course is a must for you because, by the end of it, you will have moved from zero experience to at least a year of experience with the tools taught in the course.