| Version | Date | Notes | By |
|---|---|---|---|
| 0.1 | 2022-05-04 | Initial release | BRB |
Before starting the update in the client's side, you must first tag each module, including the backend and frontend. Before tagging backend, make sure that there are no translations that have not yet been merged into the backend.
cd /var/www/translations-back.wemake.pt
git status
git add translation_files
git commit -m "Updated translations"
git pull
git push
Tag backend, frontend and each module. You can follow the previous guide for module tagging.
After tagging everything, go to https://gitlab.wemake.pt/wemake/services/satis and run the pipeline in "CI/CD » Pipelines". This is important because it's what is going to be used by composer later in the client's side.
Go to frontend folder. Delete dist/ and export/ folders.
In the console, run the following command: gulp export.
In the file explorer, go to the frontend/export/ folder and zip everything except the env.js file.
cd /var/www/html/sgi-back.wemake.pt/
php artisan down
sudo supervisorctl
If the only services running are the ones related to the application: stop all
If there are services related to other applications: stop "services-names"
After that, exit supervisorctl: exit
If you have DBeaver configured with the client's database, you can back up the database with it. Otherwise, go to .env in the backend and get the database credentials.
After getting those credentials, use the following command:
mysqldump -u username -p DBname > filename.sql
Go to project folder (should show both backend and frontend folders).
zip -9r --symlinks sgi-yearmmdd.zip backend frontend
git status
If there's more files changed than just composer.json and composer.lock, check with colleagues (mainly FPA) to know why and whether it's okay to ignore those changes.
In case you don't already know what modules the client has and what to include in the composer require command, then you can check it by viewing the composer.json file.
git diff composer.json
Copy each wemake/sgi-module_name to somewhere like a .txt file.
git checkout composer.*
git pull
composer install
composer require wemake/sgi-module-name wemake/sgi-module2-name
In some cases, you may need to specify the path for composer or use a specific php version or even alter the memory limit to be able to install all the modules necessary. Here's an example:
php8.1 -d memory_limit=-1 /usr/local/bin/composer require wemake/sgi-module-name
.env and .env.example.Update the version field to the latest tag.
If the client does not yet have the Laravel Activity Logger, make sure to have the following line in .env like this:
ACTIVITY_LOGGER_ENABLED=false
php artisan clear-compiled
composer dumpautoload -o
Execute core migration and each module's migrations:
php artisan migrate
Execute translations' migrations.
php artisan reseed
php artisan clear-all
redis-cli flushall
export.zip to the client's server.Get the frontend export.zip from your frontend/export and send it to the client's server.
This can be done via Filezilla.
Most of the times, just keep the env.js file, but some clients may need to keep other files.
rm -rf !(env.js) -> removes all files and folders except env.js
cd /path/to/frontend
unzip /path/to/export.zip -d .
env.js and your latest env.example.js.Update the version field to the latest frontend tag.
cd /path/to/backend
php artisan up
sudo supervisorctl
start all
Test normal exports like PDF, Excel.
Test uploading files, usually you can do so while creating a document.
Test email by going to "Administration » General » Mail settings » Test". Put your own personal email and test it.
Finally, update the installation files and email the client to let them know that the update is concluded.