Installing & Updating OpenMage with Git and Composer

Updated . Posted . Visible to the public.

There are 3 machines:

  1. Local Computer Windows OS
  2. Development Server
  3. Production Server

There are 3 repositories

  1. upstream, a fork of OpenMage in GitHub, the default branch is main
  2. origin, the project repo in BitBucket, set default branch to master
  3. local, resides in local computer with remotes called upstream and origin

Create local repo

  1. [local] Parent of root folder (without creating the root folder), git clone the upstream repo. At completion, root folder is created with all the source code from OM. The branch is main, which should remain exactly as upstream.
  2. [local] Switch to a new branch master. All custom code and 3rd-party code, including vendor, go into master, which will be pull by production server.
  3. [local] At the root folder, right-click and select Git Bash Here to launch the bash terminal. composer install to install the vendor folder.
  4. [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.
  5. [local] git commit all files to branch master. master has all the code to run OpenMage.
  6. [local] git push master to origin.

Customization

Commit all custom code to master. This is the production code.

Update OpenMage

Important: check versions compatibility: PHP, MySQL, OS

  1. [local] Switch to main branch and pull from upstream, hosted in GitHub. This will update main, which has the latest code from the official repo.
  2. [local] Switch to master branch and pull from origin, hosted in BitBucket.
  3. [local] Create a new branch based on master. We can name the branch om{ver}.
  4. [local] Merge main into om{ver}.
  5. [local] Update all dependencies with composer: composer update.
  6. [local] Commit the updated code and push to origin.
  7. [dev server] Test the updated version. First get the updated code: git fetch --all and git reset --hard origin/om{ver}.
  8. [dev server] Test.
  9. To test in staging, merge branch om{ver} into branch staging and deploy the code to staging server.
  10. For production, merge branch om{ver} into branch master and deploy the code to production server.
kiatng
Last edit
kiatng
Posted by kiatng to OpenMage (2023-09-14 05:18)