WP Manifestindependent plugin directory
manifest / developer / ci-cd-wordpress-plugin

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

0stars
0forks

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.zip

A 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:

  1. A new release directory is created (e.g. bloodhound-20251117_113500-ghi9abc).

  2. All plugin files are rsynced into this new folder.

  3. Only when the folder is fully ready, the workflow runs:

    ln -sfn "$NEW_RELEASE_PATH" "${CURRENT_LINK}"
    • ln -sfn updates 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.yml workflow
  • ✅ Suitable as a base for more advanced DevOps tests

Usage

1. Activate the Plugin

  1. Copy the plugin folder Hello-DevOps to:

    
    wp-content/plugins/Hello-DevOps