From 15a633c42bb512faf20179b947132b4c8a1c5668 Mon Sep 17 00:00:00 2001 From: Nihal Agazade <43378371+icarusdust@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:42:01 +0200 Subject: [PATCH] CodePush updates promoting downstream (#2866) * CodePush updates promoting downstream After testing an update against a deployment channel, it is possible to promote it to destination channels * Update codepush-integration.md * Update codepush-integration.md --- content/integrations/codepush-integration.md | 42 ++++++++++++-------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/content/integrations/codepush-integration.md b/content/integrations/codepush-integration.md index 19f827fd..4a6a9ab9 100644 --- a/content/integrations/codepush-integration.md +++ b/content/integrations/codepush-integration.md @@ -19,36 +19,38 @@ Codemagic offers a hosted and maintained CodePush server with a free license for For iOS, place the following key and its string in Info.plist: -``` +{{< highlight bash "style=paraiso-dark">}} CodePushServerURL https://codepush.codemagic.io/ -``` +{{< /highlight >}} For Android, add the following line in **strings.xml**: -``` +{{< highlight bash "style=paraiso-dark">}} https://codepush.codemagic.io/ -``` +{{< /highlight >}} + 4. While making changes in Info.plist and strings.xml files, add the Deployment keys: For iOS: -``` +{{< highlight bash "style=paraiso-dark">}} CodePushDeploymentKey YOUR_DEPLOYMENT_KEY -``` +{{< /highlight >}} For Android: -``` +{{< highlight bash "style=paraiso-dark">}} YOUR_DEPLOYMENT_KEY -``` +{{< /highlight >}} + **Note**: About how to find the deployment keys, please refer to step **7**. 5. After configuring all the above-mentioned steps, it is time to set up the Codemagic side configuration and authentication. For that, [contact Codemagic team](https://codemagic.io/contact/) for an access key. 6. Add the following lines in **codemagic.yaml**: -``` +{{< highlight bash "style=paraiso-dark">}} scripts: - name: Install CodePush cli tools script: | @@ -69,7 +71,7 @@ scripts: script: | code-push-standalone release-react APP_NAME_CREATED_ABOVE ios -d Staging# -d refers to the deployment name e.g. Production, Staging code-push-standalone release-react APP_NAME_CREATED_ABOVE android -d Staging # -d refers to the deployment name e.g. Production, Staging -``` +{{< /highlight >}} {{}} **Note**: **$CODEPUSH_TOKEN** for authentication will be provided by the Codemagic team and it needs to be added as an environment variable and then imported in **codemagic.yaml**. More info can be found [here](https://docs.codemagic.io/yaml-basic-configuration/configuring-environment-variables/) @@ -83,28 +85,36 @@ scripts: 7. In order to reveal the Deployment keys, run **code-push-standalone deployment ls YOUR_APP_NAME -k** 8. By default, you get two Deployment channels: Staging and Production. You can add new ones, rename or delete them by running the following commands: -``` +{{< highlight bash "style=paraiso-dark">}} To Add: code-push-standalone deployment add To Remove: code-push-standalone deployment rm To Rename: code-push-standalone deployment rename -``` +{{< /highlight >}} + 9. Likewise, apps can be added, renamed and deleted: -``` +{{< highlight bash "style=paraiso-dark">}} To Add: code-push-standalone app add To Rename: code-push-standalone app rename To Delete: code-push-standalone app rm -``` +{{< /highlight >}} + 10. If you need to patch releases e.g. you need to make a change in a previous release e.g. increase rollout percentage, a missed bug fix etc. you can achieve it by running **code-push-standalone patch ** 11. You cannot delete a deployment release history but you can roll it back in case any release was shipped with a broken feature or anything, by running **code-push-standalone rollback ** + +12. After testing an update against a deployment channel, it is possible to promote it by running the following command: + +{{< highlight bash "style=paraiso-dark">}} +code-push-standalone promote +{{< /highlight >}} ## Debugging notes If your project **Info.plist** file key **CFBundleShortVersionString** does not hold a semver string value, then it's highly likely you will see the following error when releasing an update: -``` +{{< highlight bash "style=paraiso-dark">}} [Error] The "CFBundleShortVersionString" key in the "ios/Codemagic_RN/Info.plist" file needs to specify a valid semver string, containing both a major and minor version (e.g. 1.3.2, 1.1). -``` +{{< /highlight >}} The solution is to either change the value in **Info.plist** file to a semver string value which is not recommended, or the best option is to add **--targetBinaryVersion** to the build/release command: **code-push-standalone release-react iOS ios --targetBinaryVersion 1.0.0**