Continuous Deployment (CD) pipelines serve as the backbone of modern DevOps workflows by automatically building, testing, and deploying application code to target environments as soon as changes are committed to source control. In environments where external webhooks are restricted or unavailable, Jenkins SCM Polling (Poll SCM) periodically queries Git repositories for new commits and automatically triggers deployment tasks on designated target nodes.
In this challenge, we construct an automated Jenkins deployment job named datacenter-app-deployment that targets App Server 1 (stapp01). The job monitors a Git repository hosted on Gitea, automatically detects changes pushed to the master branch, and synchronizes the application files directly into Apache’s web document root (/var/www/html).
Key tasks accomplished:
App Server 1 (stapp01), upgrading the Java runtime environment from OpenJDK 11 to Java 17 (java-17-openjdk) to meet Jenkins Remoting requirements, and configuring stapp01 as an SSH Build Agent with remote root /var/www/html.datacenter-app-deployment, restricting build execution to label stapp01, configuring SCM with the Gitea repository (http://gitea:3000/sarah/web.git), and setting up Poll SCM (H/2 * * * *)./var/www/html.sarah owns /var/www/html, pushing a code update (Welcome to the xFusionCorp Industries) to the remote master branch, observing automated trigger execution, and confirming the updated app response.graph TD
subgraph SCM ["Gitea Source Control"]
GitRepo["Git Repository: sarah/web.git<br/>Branch: master"]
end
subgraph JenkinsController ["Jenkins Controller"]
PollTrigger["Poll SCM Scheduler<br/>Schedule: Every 2 Minutes"]
Job["Freestyle Job:<br/>datacenter-app-deployment"]
end
subgraph AppServer ["App Server 1: stapp01"]
Java17["Java 17 Runtime<br/>java-17-openjdk"]
Agent["Jenkins Agent Process<br/>Remote Root: /var/www/html"]
WebRoot["Apache Document Root<br/>/var/www/html - Owner: sarah"]
Apache["Apache Web Server<br/>Port 8091"]
end
PollTrigger -->|"1. Poll Git Repository Every 2 min"| GitRepo
GitRepo -->|"2. Detect New Commit Hash"| Job
Job -->|"3. Trigger Deployment on stapp01"| Agent
Agent -->|"4. Execute Shell: git pull origin master"| WebRoot
WebRoot -->|"5. Serve Updated Content"| Apache
Modern Jenkins agent remoting libraries (remoting.jar) require Java 17+ on agent nodes. When configuring an SSH Build Agent node:
java-17-openjdk and java-17-openjdk-headless via yum provides the compatible runtime required for stapp01.While webhooks push event notifications from Git servers to Jenkins instantaneously, Poll SCM operates on a pull model:
H/2 * * * *): Uses cron syntax with Jenkins hash distribution (H) to poll the Git repository every 2 minutes.master, it schedules a new build execution automatically.Deploying straight to Apache’s document root /var/www/html requires proper POSIX permissions:
stapp01 as SSH user sarah./var/www/html is owned by root or apache, user sarah cannot pull files or update working tree files. Setting ownership (sudo chown -R sarah:sarah /var/www/html) grants Jenkins necessary write permissions.8080admin / Adm!n321App Server 1 (stapp01)sarah (username & password)http://gitea:3000/sarah/web.gitSSH Build Agents, Git| Setting | Value |
|---|---|
| Node Name | App Server 1 |
| Node Label | stapp01 |
| Remote Root Directory | /var/www/html |
| Agent Launch Method | Launch agents via SSH |
| Host | stapp01 |
| Credentials | sarah |
| Jenkins Job Name | datacenter-app-deployment |
| Job Type | Freestyle Project |
| Restrict Where Project Runs | stapp01 |
| Repository URL | http://gitea:3000/sarah/web.git |
| Branch Specifier | */master |
| Build Trigger | Poll SCM (H/2 * * * *) |
| Build Action | Execute shell (cd /var/www/html && git pull origin master) |
adminAdm!n321

App Server 1jumphost and SSH into stapp01 as user sarah:ssh sarah@stapp01
java --version
Output:
openjdk 11.0.20.1 2023-08-24 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.20.1.1-2) (build 11.0.20.1+1-LTS)
yum:sudo yum install java-17-openjdk -y
java --version
Output:
openjdk 17.0.18 2026-01-20 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.18.0.8-2) (build 17.0.18+8-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.18.0.8-2) (build 17.0.18+8-LTS, mixed mode, sharing)
App Server 1 as an SSH Build Agent NodeApp Server 11 or 2/var/www/htmlstapp01stapp01sarah SSH credentials

datacenter-app-deployment.
stapp01.
http://gitea:3000/sarah/web.git (or configured Git URL).*/master.
H/2 * * * * (polls repository every 2 minutes).
cd /var/www/html
git pull origin master

stapp01 and verify ownership of /var/www/html:ls -ld /var/www/html
sarah, update permissions recursively:sudo chown -R sarah:sarah /var/www/html

stapp01, navigate to the local repository workspace /home/sarah/web and modify index.html:cd /home/sarah/web
echo "Welcome to the xFusionCorp Industries" > index.html
master:git add index.html
git commit -m "Testing jenkins deployment job"
git push origin master
Output:
[master 6ff653e] Testing jenkins deployment job
1 file changed, 1 insertion(+), 1 deletion(-)
To http://gitea:3000/sarah/web.git
4d0f926..6ff653e master -> master

datacenter-app-deployment.
Started by SCM change
Building remotely on App Server 1 (stapp01) in workspace /var/www/html
[html] $ /bin/sh -xe /tmp/jenkins123456.sh
+ cd /var/www/html
+ git pull origin master
From http://gitea:3000/sarah/web
* branch master -> FETCH_HEAD
Updating 4d0f926..6ff653e
Fast-forward
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Finished: SUCCESS
cat /var/www/html/index.html
curl http://localhost
Response:
Welcome to the xFusionCorp Industries

| Checkpoint | Expected Result | Status |
|---|---|---|
| Java 17 Version | java -version returns OpenJDK 17 on stapp01 |
PASS |
| SSH Agent Status | Node App Server 1 with label stapp01 is Online |
PASS |
| Directory Ownership | /var/www/html is owned by sarah:sarah |
PASS |
| Freestyle Node Binding | Job restricted to label stapp01 |
PASS |
| Poll SCM Trigger | Scheduled with H/2 * * * * and detects new commit |
PASS |
| Build Execution | git pull origin master completes with status SUCCESS |
PASS |
| Web App Verification | curl or browser returns updated index.html string |
PASS |
In this challenge, we successfully implemented an automated Continuous Deployment pipeline using Jenkins Poll SCM and an SSH Build Agent Node:
App Server 1 (stapp01) with Java 17 to meet Jenkins Remoting prerequisites.stapp01 as an agent with remote root directory set to /var/www/html.datacenter-app-deployment with Poll SCM (H/2 * * * *) to automatically detect Git updates on master branch and pull latest code straight to Apache’s document root.index.html in Gitea repository and verified seamless automated deployment and immediate application availability.