Deploy PHP application using Jenkins Pipeline | Continuous Deployment

  Рет қаралды 14,554

Ranjit Swain

Ranjit Swain

Жыл бұрын

Aa step by step process of Jenkins Pipeline creation and automation. Continuous deployment of PHP application.
Writing Linux shell script form scratch.
Stay tuned & Subscribe for more Videos.
Pipeline Script for your reference:
pipeline{
agent any
environment{
staging_server="13.235.33.196"
}
stages{
stage('Deploy to Remote'){
steps{
sh '''
for fileName in `find ${WORKSPACE} -type f -mmin -10 | grep -v ".git" | grep -v "Jenkinsfile"`
do
fil=$(echo ${fileName} | sed 's/'"${JOB_NAME}"'/ /' | awk {'print $2'})
scp -r ${WORKSPACE}${fil} root@${staging_server}:/var/www/html/mbaquatech${fil}
done
'''
}
}
}
}
GitHub Repo URL: github.com/ranjit4github/My-J...

Пікірлер: 30
@rifatalom5420
@rifatalom5420 Жыл бұрын
So so simple way you did it, great Sir! Thank you very much to make may days. It will more great if you create docker + jenkins both with a php project like this. i'm subscribing this channel. Thank you again
@RanjitSwain
@RanjitSwain Жыл бұрын
Glad it was helpful. Thanks for your great suggestion, I will definitely make such project shortly.
@RanjitSwain
@RanjitSwain Жыл бұрын
Hi, here is the video created as per your suggestion. Jenkins+Docker+PHP
@rifatalom5420
@rifatalom5420 Жыл бұрын
@@RanjitSwain Thank you very much sir❤
@diptimankar35
@diptimankar35 Жыл бұрын
Thanks a lot🙏
@RanjitSwain
@RanjitSwain Жыл бұрын
Most welcome 😊
@akshayc4145
@akshayc4145 Жыл бұрын
for loop to copy modified files..why can't you simply use rsync
@RanjitSwain
@RanjitSwain Жыл бұрын
Thanks Akshay for your valuable comments. Yes, rsync can be used..
@hindidubbed2688
@hindidubbed2688 Жыл бұрын
hello . sir can u please share sample repository for php application for our practise. And Thank you for the video , i have understood the concept.
@RanjitSwain
@RanjitSwain Жыл бұрын
Glad you understood the concept. Here is the link for the Repo: github.com/ranjit4github/docker-php-apache-mysql.git
@deepakatariya6103
@deepakatariya6103 Жыл бұрын
Sir, I was testing the ssh command in Jenkins. ssh command prompt for a password. I can enter a password on the console but how would I manage this with Jenkins?
@RanjitSwain
@RanjitSwain Жыл бұрын
Hi Deepak, you can use the key file to connect securely with ssh command. Follow the below video for key based authentication: kzfaq.info/get/bejne/Zpl0g8KBkqeZmoE.html
@sruthintk1562
@sruthintk1562 Жыл бұрын
In azure CICD,how we can update the base image of CICD.can you make a video?
@RanjitSwain
@RanjitSwain Жыл бұрын
Hi Sruthin, thanks for your comment. Sure, I will try to make one shortly.
@saeedrahat984
@saeedrahat984 11 ай бұрын
Thanks for nice video. when i clicked your repo full source code didnt show due to private repo. Is it possible to share full source code for practice purpose.
@RanjitSwain
@RanjitSwain 10 ай бұрын
Hi @saeedrahat984 , thanks for your comment. The source code which was shown in the video is our company's code and unfortunately it can not be shared. I will make a sample project n PHP and share with you. Thanks.
@anmolsoni04
@anmolsoni04 4 ай бұрын
Sir I have cleared somany doubts after watching your this video! Thankyou somuch. Now I only want to ask that, I am working on a laravel project that is a framework of PHP , so may i use the same jenkins file that you have made in this video? please help me in the continuous deployment of My laravel project.
@RanjitSwain
@RanjitSwain 4 ай бұрын
Hi @anmolsoni04, Glad it helped you! Sure, I will try to make a such project setup soon.
@anmolsoni04
@anmolsoni04 4 ай бұрын
@@RanjitSwain Ya I'm waiting
@lakshmananecetnj56
@lakshmananecetnj56 Жыл бұрын
If we delete some of the files in repository, then how it will replicate into the server.
@RanjitSwain
@RanjitSwain Жыл бұрын
Hi Lakshmanan, thanks for your comment. This is just a demo to achieve the continuous deployment through Jenkins. For your questions it will not work in this script. For this you can use 'rsync' command to deploy the code in unix. Here is the code for the same. github.com/ranjit4github/My-Jenkins-SharedLibrary/blob/feature/lib1.1/vars/copy_PHP_HTML.groovy
@lakshmananecetnj56
@lakshmananecetnj56 Жыл бұрын
Thanks for your valuable information....
@dillinaresh3407
@dillinaresh3407 Жыл бұрын
@Ranjit swain Tqs for making this educational video. But i have a query in this method. While executing the pipeline im getting a "HOST KEY VERIFICATION FAILED" in my Jenkins console could you pls share your knowledge on that for us thanks in advance ....
@taylan5376
@taylan5376 7 ай бұрын
hahaha magically wwww become www :P probably took some time to see problem so cut from video
@RanjitSwain
@RanjitSwain 7 ай бұрын
Perfect finding 👍🏻 Thanks.
@skawtpedropm
@skawtpedropm Жыл бұрын
there still the same code in repo link shared?
@RanjitSwain
@RanjitSwain Жыл бұрын
Yes, still there the same code in the repo
@shashankchouksey2425
@shashankchouksey2425 Жыл бұрын
can you please make this repository public i want to use practical
@RanjitSwain
@RanjitSwain Жыл бұрын
Hi Shasank, thanks for your comment. The PHP project demonstrated in this video is an official project, I'm sorry it can't be shared. You can create or get any PHP project and do the demo. Here is the shared Library repo link. GitHub Repo URL: github.com/ranjit4github/My-Jenkins-SharedLibrary.git
@RanjitSwain
@RanjitSwain Жыл бұрын
Hi Shashank, here is a demo project you can use. kzfaq.info/get/bejne/jKtyp5uFuJOaYaM.html github.com/ranjit4github/docker-php-apache-mysql.git
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 7 МЛН
How to design a modern CI/CD Pipeline
9:59
DevOps Journey
Рет қаралды 105 М.
DEPLOY PHP APPLICATION INTO DOCKER CONTAINER USING JENKINS!
20:47
Ranjit Swain
Рет қаралды 3,9 М.
Deploy Dockerized Laravel Application using AWS ECS + AWS CodeBuild
1:00:10
Functional Programming with PHP | PHP Advanced Concepts
2:26:56
miss google
Рет қаралды 4,3 М.
What Is the Difference Between Scripted and Declarative Pipeline
5:25
Learn Jenkins! Complete Jenkins Course - Zero to Hero
1:08:28
DevOps Journey
Рет қаралды 747 М.
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 2,7 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 62 МЛН