Z
Z
Zulusho2018-03-17 19:05:42
PHP
Zulusho, 2018-03-17 19:05:42

PHP CI/CD tools to support legacy code?

Hello, I really want to implement CI / CD in my project, but I never had any practical experience.
A mountain of articles read on this topic leads me to the answer "write your own", for which there are no resources.
Available:

  • Closed commercial project
  • Own debian server with SSH access
  • Project on phpBB 3.0.12 (no composer, no tests and little documentation in the code)
  • A mountain of code written on top and next to it (non-forum logic, no documentation, coding style and tests)
  • PHP 5.3 (upgrading to 5.4 breaks functionality and takes months to adapt the code)
  • HTML template engine passes PHP variables to JS via SCRIPT tags
  • In JS, the formation of html by concatenating strings and further input into innerHTML is too actively used
  • Test subdomain with its own database and code

Workflow now:
  1. The feature is described in its thread
  2. A pull request is created
  3. Another developer checks the code, style, documentation
  4. After the changes, the branch is merged into develop
  5. We get files from the develop branch using git diff --name-only
  6. We connect via FTP to the test subdomain, copy the files from it that we will change into a separate folder (observing the folder hierarchy)
  7. Overwriting new files from develop
  8. We change the version of the site with a SQL query (it is added to static files to “reset the cache”)
  9. We test the functionality on a limited number of users of the test subdomain
  10. After all the edits, upload the develop branch to master and repeat the same from point 5 for the main domain

Dream Workflow:
  1. The feature is described in its thread
  2. A pull request is created
  3. The server runs Code Coverage, PHPLint, PHPDCD, PHPMD, PHPCS and similar tests for HTML and JS only on the changed code (obviously, these tools will scold the code already in the changed files)
  4. After the changes, the branch is merged into develop
  5. The server reacts to the injection into develop and automatically changes the files on the test domain, changes the version of the site in the database
  6. After all the changes, we pour the code into master
  7. After all the edits, we upload the develop branch to master and the server does everything from point 5 for the main domain

Questions:
  • On the main domain, I would like to have "roll back to" buttons with a choice of stable versions, is this possible?
  • What tools might be suitable for changing the workflow? What is the best way to organize it?
  • What files should be submitted for verification by automatic tests, if the files should be on the main domain after processing by autoprefixer, mqpacker, csso/uglify/html-minify?

I hope you too have had tears in your eyes as you read the description of my current workflow and the state of the codebase.
I'm far from being a professional developer and I'm asking for the help of specialists.
The option to "rewrite everything to modern standards" is unacceptable due to lack of resources, but the development team tries to write all new code in step with the times.
I apologize for throwing too much information and side questions into one question.
Thank you very much in advance for the real advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-03-17
@Zulusho

rise to 5.4 breaks performance
My verdict: if you need a project - think: how to rewrite it ( plan ) NORMALLY and in PHP7.
And only then - start thinking about "rolling out" updates.
As it is now - switch to PHP7.
In parallel - install and configure a versioning system and write a control system for it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question