Skip to content

Developer Guide — New Project

Wait for DevOps handover message before starting.


What DevOps Sends You

GitHub Repo:   https://github.com/ChamodTharuka/rocell-wordpress-theme
Branch:        staging
Staging URL:   https://rocell.development.enfection.com
WP Admin:      https://rocell.development.enfection.com/wp-admin
WP User:       admin
WP Password:   xxxxxxxx

Overview

Step 1: LocalWP      → Create local WordPress site
Step 2: LocalWP      → Activate your custom theme
Step 3: Git Bash     → Connect theme folder to GitHub repo
Step 4: Git Bash     → Push theme → pipeline runs automatically
Step 5: Check        → Staging site updated with your theme

Step 1: LocalWP — Create Local Site

Open LocalWP → + (bottom left) → Create a new site

Site name:    Rocell Website
PHP version:  8.2
→ Create site

XAMPP conflict

Stop XAMPP Apache + MySQL before starting LocalWP site.


Step 2: Create Your Custom Theme

Go to your LocalWP theme folder:

C:\Users\[your-name]\Local Sites\rocell-website\app\public\wp-content\themes\

Create a new folder named rocell-theme. Add your theme files inside:

rocell-theme/
├── style.css        ← required
├── functions.php    ← required
├── index.php        ← required
└── ... (your other theme files)

Minimum style.css header:

/*
Theme Name: Rocell Theme
Version: 1.0
*/

Activate theme in LocalWP:

LocalWP → WP Admin → Appearance → Themes → Rocell Theme → Activate


Step 3: Connect Theme Folder to GitHub Repo

Open Git Bash and run these commands one by one:

# Go to your theme folder
cd "C:/Users/chamo/Local Sites/rocell-website/app/public/wp-content/themes/rocell-theme"
# Initialize git in this folder
git init
# Connect to the GitHub repo DevOps created
git remote add origin https://github.com/ChamodTharuka/rocell-wordpress-theme.git
# Download the DevOps files from repo (deploy.yml, sonar config, .gitignore)
git fetch origin
# Switch to staging branch
git checkout staging

Now your theme folder has the DevOps files (deploy.yml, sonar-project.properties, .gitignore) merged with your theme files.


Step 4: Push Theme to Staging

# See what files will be pushed
git status
# Stage all your theme files
git add .
# Commit with a message
git commit -m "feat: initial theme setup"
# Push to staging branch → triggers pipeline automatically
git push origin staging

Step 5: Check Pipeline & Verify Staging

Check GitHub Actions:

https://github.com/ChamodTharuka/rocell-wordpress-theme/actions

Wait for both jobs to complete:

✅ SonarQube Scan    (~1-2 min)   — code quality check
✅ Deploy to Staging (~30-40 sec) — theme pushed to server

Verify staging site updated:

https://rocell.development.enfection.com

Your custom theme should now be live on staging. ✅


Daily Workflow (After First Setup)

# 1. Edit theme files in your editor

# 2. Test locally at http://rocell-website.local

# 3. Push to staging
git add .
git commit -m "feat: describe your change"
git push origin staging

# ✅ Pipeline runs → staging updated automatically

Key Rules

  • Always push to staging branch only
  • Never push to main — that is DevOps / production
  • DB or content changes → use All-in-One Migration plugin, not Git
  • Pipeline failed? Check Actions tab → click failed run → read logs