Hello DevOps
Simple test plugin deployed via GitHub Actions. Adds a shortcode [karim_devops_hello] that displays a hello message.
by Abdelkarim Mselmi · github.com/karim-devops/ci-cd-wordpress-plugin
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/karim-devops/ci-cd-wordpress-plugin/archive/refs/heads/main.zipA tiny WordPress plugin used to validate a CI/CD pipeline with GitHub Actions and rsync deployments.
It adds:
- A shortcode:
[karim_devops_hello] - An admin notice for administrators
Display:
Hello WordPress world, this is Karim DevOps
Repository Structure
Hello-DevOps/
├─ hello-devops.php # Main plugin file
├─ README.md # Readme
└─ .github/
└─ workflows/
└─ deploy.yml # GitHub Actions workflow for zero-downtime deploy
Why This Avoids Downtime
In a traditional “FTP upload” or simple rsync directly into wp-content/plugins/Hello-DevOps:
- Files can change while PHP is executing.
- You might have some files updated and others not yet.
- During that window, the plugin code can be incomplete → fatal errors / broken site.
With this zero-downtime approach:
-
A new release directory is created (e.g.
bloodhound-20251117_113500-ghi9abc). -
All plugin files are
rsynced into this new folder. -
Only when the folder is fully ready, the workflow runs:
ln -sfn "$NEW_RELEASE_PATH" "${CURRENT_LINK}"ln -sfnupdates the symlink atomically.- At the filesystem level, the pointer changes almost instantly.
- If a PHP request starts before the switch, it uses the old code.
- If it starts after, it uses the new code.
- There is no “in-between state”.
This is the core of zero-downtime: all code changes appear at once, and the live path is never half-updated.
Plugin Details
- Name: Hello DevOps
- Slug (directory):
hello-devops - Main file:
hello-devops.php - Version:
1.0.0
Features
- ✅ Simple “hello world” style plugin
- ✅ Shortcode to display a message on any page/post
- ✅ Admin dashboard notice (visible to admins only)
- ✅ Designed to work out-of-the-box with the provided
deploy.ymlworkflow - ✅ Suitable as a base for more advanced DevOps tests
Usage
1. Activate the Plugin
-
Copy the plugin folder
Hello-DevOpsto:wp-content/plugins/Hello-DevOps