Jenkins is the most widely-used open-source automation server. This guide sets up Jenkins with a basic deployment pipeline.
Install
sudo apt install openjdk-17-jre -y
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt update && sudo apt install jenkins -y
sudo systemctl enable jenkins --now
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Basic Deployment Pipeline
// Jenkinsfile
pipeline {
agent any
stages {
stage('Checkout') { steps { git 'https://github.com/org/repo.git' } }
stage('Deploy') {
steps {
sh 'rsync -avz ./ user@production:/var/www/app/'
}
}
}
}
Conclusion
Jenkins automates deployments and catches bugs early. Our team configures CI/CD pipelines for automated, reliable deployments.
Comments