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
upstream
andorigin
Create local repo
- [local] Parent of root folder (without creating the root folder),
git clone
theupstream
repo. 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 install
to install the vendor folder. - [local] Edit
.gitignore
file, 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 commit
all files to branchmaster
.master
has all the code to run OpenMage. - [local]
git push master
toorigin
.
Customization
Commit all custom code to master
. This is the production code.
Update OpenMage
Important: check versions compatibility: PHP, MySQL, OS
- [local] Switch to
main
branch and pull fromupstream
, hosted in GitHub. This will updatemain
, which has the latest code from the official repo. - [local] Switch to
master
branch and pull fromorigin
, hosted in BitBucket. - [local] Create a new branch based on
master
. We can name the branchom{ver}
. - [local] Merge
main
intoom{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 --all
andgit reset --hard origin/om{ver}
. - [dev server] Test.
- To test in staging, merge branch
om{ver}
into branchstaging
and deploy the code to staging server. - For production, merge branch
om{ver}
into branchmaster
and deploy the code to production server.
Posted by kiatng to OpenMage (2023-09-14 05:18)