This script creates a PR in the specified infrastructure repository, updating livingdocs-server and livingdocs-editor image in the specified environment.
To run it you need to get a GH token with access to the infrastructure repo (downstream release tokens are valid), then execute:
npx github:livingdocsIO/create-infrastructure-pr \
--owner livingdocsIO \
--repo infrastructure-onboarding \
--release-branch release-2024-11-16 \
--env stage \
--tag v4.20.11 \
--gh-token ${your-github-token}
There are two repositories(infrastructure-20min
and infrastructure-handelsblatt
) that require extra parameter (infrastructure-path
):
# For HMG
npx github:livingdocsIO/create-infrastructure-pr \
--owner livingdocsIO \
--repo infrastructure-handelsblatt \
--infrastructure-path handelsblatt \
--release-branch ${release-branch-name} \
--env ${environment} \
--tag v${tag-to-release} \
--gh-token ${your-github-token}
# For 20min
npx github:livingdocsIO/create-infrastructure-pr \
--owner livingdocsIO \
--repo infrastructure-20min \
--infrastructure-path 20min \
--release-branch ${release-branch-name} \
--env ${environment} \
--tag v${tag-to-release} \
--gh-token ${your-github-token}
There is some magic under the hood.
- If you define
--env prod
the script will set the stage image from any value tox.x.x
, if the value was alreadyx.x.x
there won’t be a diff in the commit there. - If you define
--env stage --tag v3.4.5
, any number valid tag would work, the script will automatically strip the last number (patch/fix) and replace it with anx
(latest). In the example herev3.4.5
would be updated in stage tov3.4.x
. This functionality only works forstage
- The script works with both
v1.2.3
or1.2.3
If you want to go back to latest (x.x.x
), for example running:
npx github:livingdocsIO/create-infrastructure-pr \
--owner livingdocsIO \
--repo infrastructure-onboarding \
--release-branch release-2024-11-16 \
--env stage \
--tag x.x.x \
--gh-token ${your-github-token}
This script won’t work. There is no logic to handle that case and since x.x.x
is not a valid semantic version, the script would fail.