• I’d like to explore the possibility of using Gitlab with our WordPress websites for version control and easier workflow from staging to deployment. Is this possible? If yes, what are requirements or where can I see some documentations

Viewing 5 replies - 1 through 5 (of 5 total)
  • I am not sure about how to integrate with Githlab, but as far as I know, it’s possible to control wordpress version using GitHub action.

    But you can check this official GitLab documentation

    Yes, this is very much possible and the agency I work at has hundreds of WordPress sites in Gitlab.

    I would strongly recommend using composer to manage it. This provides some hefty benefits, such as not needing to commit all the core WordPress files (which you don’t need in your repo) as well as easily updating the version.

    What you’ll do is commit the wp-content directory as these files are unique for you, but manage the rest via composer. This can also allow you to manage plugins, which also offers the same benefits of keeping your repo clean and easy to manage

    There are many guides on how to do this, and I don’t have any specific ones I know of and highly recommend, but the knowledge is out there with a fairly easy search.

    Just one tip, in case it doesn’t get mentioned – watch your wp-config file! It has particular information you do not want people seeing like database information that might land you in some hot water

    Thread Starter naninfa0

    (@naninfa0)

    @nickaccuweb Appreciate the quick guide. I’ll check on this and send an update once I am able to test it out on my end.

    Thread Starter naninfa0

    (@naninfa0)

    @bvbaked Composer? Do you mean this https://getcomposer.org/ ? So according to your comment, only the files under wp-content will be inside the repo? and the rest will be managed through our servers? Will it be possible to utilize Gitlab to update utilized plugins/themes/contents from staging pushed to prod?

    Hi @naninfa0

    Yes, that is the composer I referred to. You will have a composer.json file that needs to be committed as well that can control your WordPress install as well as other plugins if you wish.

    You can refer to this article on Gitlab pipelines for some reference on how they work. The setup I use in my work is WordPress and plugins managed via composer with a pipeline that will run the composer install and transfer files to the various environments (staging/production etc.) when they are committed to.

    An example: I create a feature branch, add some code, then commit and push. When I merge that branch into our development branch, the pipeline runs a composer install command which adds WordPress and plugins then transfers all those files to the development server for testing.

    That allows us to not commit plugins and core WordPress files to the repo which can be troublesome to update and manage

    • This reply was modified 4 months, 1 week ago by bvbaked.
Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.