pschoffer / gitpress

GitPress - WordPress but on git instead of DB
2 stars 1 forks source link

Moving the plugin to mu-plugins #7

Closed forgondolin closed 4 years ago

forgondolin commented 4 years ago

Hello, I've made the changes and tested it. Don't know if the zip is the best option for storing the plugin files, but its seems fine

pschoffer commented 4 years ago

Hi @forgondolin, Sorry again about the lack of the description here. I don't just moving the zip file will work.

1) Right now we are doing this in Dockerfile: COPY plugins/* /usr/src/versionpress/ we need to move the mu-plugins instead.

2) And then mainly when installing it https://github.com/pschoffer/gitpress/blob/master/bin/gitpress_utils.sh - check installWP function.

So what needs to be done is to extract the plugin and commit extracted under mu-plugins/versionpress and possibly have some loader script for it. From my understanding, mu-plugins don't need activation and are loaded from the first level (that's why we might need a loader script that loads the rest of the plugin).

Also, how are you testing this? I guess a good test case is:

Something like this docker-compose file might help:

version: '3.1'

services:
  gitpress:
    build: <<Path to your working copy>>
    ports:
      - 80:80
    environment:
      GITPRESS_MODE: SEED
      WORDPRESS_URL: http://localhost/
      GIT_ORIGIN: <<some new repo to try it out>>
      <<other SEED params as needed>>
forgondolin commented 4 years ago

Okay. Yeah, you are right, it doesnt need to load, but in production you have to activate/deactivate it