Skip to content

Developer Guide — New Project

Wait for DevOps handover before starting

DevOps will send you the GitHub repo link and staging site credentials first.


What DevOps Sends You

GitHub Repo:   https://github.com/ChamodTharuka/rocell-wordpress-theme
Branch:        staging

Staging Site:  https://rocell.dev.enfection.com
WP Admin:      https://rocell.dev.enfection.com/wp-admin
WP User:       admin
WP Password:   xxxxxxxx

Overview

Step 1: LocalWP  → Create local WordPress site
Step 2: Theme    → Create your custom theme folder
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. You cannot run both at the same time on port 80.


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:

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

Your theme folder now has DevOps files merged with your theme files. ✅


Step 4: Push Theme to Staging

# Check 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:

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

Verify staging site updated:

https://rocell.dev.enfection.com  ✅


Daily Workflow (After First Setup)

# 1. Edit theme files in your editor

# 2. Test locally
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 production or main — DevOps only
  • production branch = live client site — DevOps merges when client approves
  • main branch = safety backup only
  • DB or content changes → use All-in-One Migration plugin, not Git
  • Pipeline failed? Check Actions tab → click failed run → read logs