Skip to content

Commit 029347d

Browse files
authored
Added documentation on how to build a new mirror release (#195)
1 parent 01e3cca commit 029347d

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,86 @@ Two things are required:
123123
docker build -t magece/mirror-repo-js .
124124
```
125125

126+
## Process of building a new mirror release
127+
128+
A new mirror release gets created when Magento releases a new version.
129+
The process is composed of a series of steps across 3 repositories of the mage-os organization.
130+
131+
### 0. Preliminary check
132+
133+
Before starting, make sure that the new tags are merged into every `mage-os/mirror-*` repository
134+
(eg: https://github.com/mage-os/mirror-magento2).
135+
In case it’s not, go to [mage-os/infrastructure](http://github.com/mage-os/infrastructure)
136+
and run [Sync magento/ org upstream repositories into mirrors for mage-os distribution](https://github.com/mage-os/infrastructure/actions/workflows/sync-upstream-magento.yml)
137+
action (check branch `main` when running it).
138+
139+
### 1. magento2-base-composer-json
140+
141+
- Fork and clone https://github.com/mage-os/magento2-base-composer-json,
142+
then create a new branch that you'll use to create a pull request.
143+
- Run the `add-release.sh` script for every release, eg:
144+
```sh
145+
./add-release.sh 2.4.7-p4
146+
./add-release.sh 2.4.6-p9
147+
./add-release.sh 2.4.5-p11
148+
./add-release.sh 2.4.4-p12
149+
```
150+
- Add, commit and push all the newly created files.
151+
152+
For a practical example [check this PR](https://github.com/mage-os/magento2-base-composer-json/pull/7).
153+
154+
### 2. github-actions
155+
156+
- Fork and clone https://github.com/mage-os/github-actions,
157+
then create a new branch that you'll use to create a pull request.
158+
- Update the supported versions matrix editing
159+
[src/versions/magento-open-source/individual.json](https://github.com/mage-os/github-actions/blob/main/supported-version/src/versions/magento-open-source/individual.json).
160+
Remember that, when inserting a new version like 2.4.6-p9, you´ll have to change the _end of life_
161+
date of the previous version (2.4.6-p8) to _one day earlier_ of the release date of the next version.
162+
[Check this example commit](https://github.com/mage-os/github-actions/pull/262/files#diff-0655b3d6263a5375945b0a6bbab191703f8ee83f9535a48e2871d8afec4cb2fc)
163+
and this screenshot to better understand what needs to be done:
164+
<img width=500 src="https://github.com/user-attachments/assets/2860e539-e76e-4c8f-89c6-a8c4f1331778" />
165+
- Check if `magento-open-source/composite.json` needs updating
166+
(it only happens when a new "non patch" release is published, like 2.4.8).
167+
- Now "build" the project with
168+
- In the root of the project: `npm install`
169+
- In the supported-version folder: `npm run build
170+
- Edit `src/kind/get-currently-supported.spec.ts`
171+
- Run `npm run test` and make sure that all tests are green.
172+
- Commit, push and open a PR on mage-os/github-actions.
173+
174+
For a practical example [check this PR](https://github.com/mage-os/github-actions/pull/262).
175+
176+
### 3. generate-mirror-repo-js
177+
178+
- Fork and clone https://github.com/mage-os/generate-mirror-repo-js,
179+
then create a new branch that you'll use to create a pull request.
180+
- Install latest magento version with
181+
`composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition`
182+
- "Build" the mirror with
183+
`rm -rf repositories; node src/make/mirror.js --outputDir=build`
184+
- Download all missing packages with
185+
`./bin/download-missing-packages-from-repo-magento-com.php project-community-edition/composer.lock build resource/additional-packages`
186+
- Commit and push the new files in `resource/additional-packages`.
187+
- Copy all the `composer.json` files for all releases with something like
188+
```sh
189+
cp ../mageos-magento2-base-composer-json/2.4.7-p4/magento2-base/composer.json resource/history/magento/magento2-base/2.4.7-p4.json
190+
cp ../mageos-magento2-base-composer-json/2.4.7-p4/product-community-edition/composer.json resource/history/magento/product-community-edition/2.4.7-p4.json
191+
cp ../mageos-magento2-base-composer-json/2.4.7-p4/project-community-edition/composer.json resource/history/magento/project-community-edition/2.4.7-p4.json
192+
```
193+
- Commit and push all the `composer.json` files.
194+
195+
When creating the PR on `generate-mirror-repo-js`, in order for all the checks to run,
196+
the PR will have to be merged on a development branch.
197+
Then go to the _actions_ for this repo: and run the
198+
[build, deploy & check mirror](https://github.com/mage-os/generate-mirror-repo-js/actions/workflows/build-upstream-mirror.yml)
199+
selecting the new dev branch and the rest of the parameters as shown in this image:
200+
<img width="323" src="https://github.com/user-attachments/assets/31eb1eaf-5c2a-4d0b-8475-9e9f7c9239a8" />
201+
202+
203+
For a practical example [check this PR](https://github.com/mage-os/generate-mirror-repo-js/pull/191)
204+
and [this second one to merge the temporary dev branch into `main`](https://github.com/mage-os/generate-mirror-repo-js/pull/194).
205+
126206
## Copyright 2022 Vinai Kopp, Mage-OS
127207

128208
Distributed under the terms of the 3-Clause BSD Licence.

0 commit comments

Comments
 (0)