
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.
Outline the system prerequisites for this course, including a 64-bit computer with virtualization and at least 8 gb of ram. Linux commands, git, and Laravel familiarity are useful.
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.
Download and install Oracle VirtualBox 7.0, run the installer, and launch VirtualBox Manager to build and configure a virtual Ubuntu desktop.
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
Connect to VirtualBox virtual machines via SSH by configuring network adapters, identifying IP addresses, and switching to a bridged adapter to enable internet access and local network connections.
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.
Log into a digital ocean droplet via ssh using the droplet's ip address, login as root, and prepare to create a non-root admin user.
Learn to secure a Linux server by creating a non-root admin user on your DO droplets, configuring sudo privileges, and performing safe updates.
Install PHP, the SQLite extension, Composer, MySQL, and Node.js on Ubuntu to run Laravel, verify versions, and enable automated testing.
Launch a fresh Laravel application using composer, install the Breeze starter kit with blade, configure the .env database, create the Lara demo database, run migrations, and start the dev server.
Explore GitLab as an open source web-based git repository manager with built-in CI/CD, issue tracking, project management, wiki, and API tools, enabling collaboration, code quality, and streamlined development.
Learn to enforce the 12-factor code base principle by using a single git version-controlled repository, set up a Laravel project on GitLab, and configure SSH keys for CI/CD readiness.
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.
Deploy a Laravel application to production by creating a VirtualBox virtual server, installing Ubuntu 22.04, and connecting via PuTTY over a bridged network.
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.
Set up a MySQL database for a Laravel production environment by creating the database Lara DB, adding a secure user, granting full access, and verifying access from the new user.
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.
Expose your local Jenkins instance to the internet with ngrok to receive webhooks and enable remote ci/cd workflows, exposing port 8080 via http and https urls.
Install and uninstall Jenkins plugins to extend functionality, manage plugins from the manage plugins page, search with blue ocean, and restart to apply changes.
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.
Log into your Jenkins instance as an admin to create and configure a new pipeline, selecting pipeline script from scm with git and configuring the repository URL from GitLab.
Verify Jenkins CI CD pipeline connects to GitLab and fetches code from the private repository. Run the first job in Blue Ocean to view build, test, and deploy stages.
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.
Install php and php extensions, composer, and node js on the Jenkins server to enable build and test stages for a Laravel application, using an in-memory sqlite database for testing.
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 a Jenkinsfile to automate building and testing your application in a continuous integration pipeline, using composer install, npm install, npm run build, and 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 passwordless SSH from the Jenkins server to the deploy user on production by sharing public keys and updating the pipeline to run the deploy script at /var/www/Lara demo/script/deploy.sh.
Test the pipeline manually by changing the header title, pushing changes to the remote code base, deploying with Jenkins, and reloading to see the new version live in minutes.
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.
Deploy the project to a digitalocean droplet by generating ssh keys for the deploy user, adding the public key to GitLab, cloning the repo, and moving code to www directory.
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.
demonstrate a continuous integration and delivery pipeline with Jenkins, showing code changes pushed to remote, tested in staging, and promoted to production after manual and automated checks.
Learn to add a contributor to a private GitLab project by inviting a second account as a developer, handling the invite notification, and optionally setting an expiration date.
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.
Navigate to the code directory and copy the env example into .env. Install dependencies with composer install, skip migrations, and run php artisan serve to view the app at localhost:8000.
Create and manage GitLab issues to track tasks, bugs, and feature requests, assign owners, add labels, and collaborate through comments and activity timelines.
Launch and manage new features using a feature branch off master, push to the remote repository, submit a merge request for review, trigger the CI/CD pipeline, and deploy to production.
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.
review code changes via the changes tab, approve or request more edits, merge feature into master, trigger Jenkins ci/cd, deploy to staging for tests, then promote to production.
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.