There are 3 machines:
- Local Computer Windows OS
- Development Server
- Production Server
There are 3 repositories
- upstream, a fork of OpenMage in GitHub, the default branch is
main - origin, the project repo in BitBucket, set default branch to
master - local, resides in local computer with remotes called
upstreamandorigin
Create local repo
- [local] Parent of root folder (without creating the root folder),
git clonetheupstreamrepo. At completion, root folder is created with all the source code from OM. The branch ismain, which should remain exactly asupstream. - [local] Switch to a new branch
master. All custom code and 3rd-party code, including vendor, go intomaster, which will be pull by production server. - [local] At the root folder, right-click and select Git Bash Here to launch the bash terminal.
composer installto install the vendor folder. - [local] Edit
.gitignorefile, comment out the vendor folder, add entry.github\*. We do not really want to git track vendor, what we want is to git commit it for easier update to servers. - [local]
git commitall files to branchmaster.masterhas all the code to run OpenMage. - [local]
git push mastertoorigin.
Customization
Commit all custom code to master. This is the production code.
Update OpenMage
Important: check versions compatibility: PHP, MySQL, OS
- [local] Switch to
mainbranch and pull fromupstream, hosted in GitHub. This will updatemain, which has the latest code from the official repo. - [local] Switch to
masterbranch and pull fromorigin, hosted in BitBucket. - [local] Create a new branch based on
master. We can name the branchom{ver}. - [local] Merge
mainintoom{ver}. - [local] Update all dependencies with composer:
composer update. - [local] Commit the updated code and push to
origin. - [dev server] Test the updated version. First get the updated code:
git fetch --allandgit reset --hard origin/om{ver}. - [dev server] Test.
- To test in staging, merge branch
om{ver}into branchstagingand deploy the code to staging server. - For production, merge branch
om{ver}into branchmasterand deploy the code to production server.
Posted by kiatng to OpenMage (2023-09-14 05:18)