You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, let me express my appreciation for your amazing work on Shorebird π! We're all super excited that code push is finally possible on Flutter! π₯³
I wanted to share a solution I found for using Shorebird with the Codemagic Workflow Editor. As per your documentation, it is mentioned that Codemagic Workflow Editor doesn't support changing the build command, which is required for using Shorebird. I came up with a workaround that allows me to override the default flutter build command with Shorebird's command. I have tested this, and it works successfully on Codemagic.
Here's the setup π:
Create a bash script (let's call it setup_shorebird.sh) with the following content:
#!/bin/bash# π Install Shorebird
curl --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/shorebirdtech/install/main/install.sh -sSf | bash
echo PATH="/Users/builder/.shorebird/bin:$PATH">>$CM_ENVexport SHOREBIRD_TOKEN="$SHOREBIRD_TOKEN"# π οΈ Override the flutter command
cat > flutter_override.sh << 'EOF'#!/bin/bash# π§ Check if the first argument is "build"if [ "$1" == "build" ]; then # π― Run the modified command exec shorebird release android --force -- --dart-define=ENVIRONMENT_TYPE=productionelse # π Run the original command with the original arguments exec flutter "$@"fiEOF# π Make the script executable
chmod +x flutter_override.sh
# π Move the script to /usr/local/bin
sudo mv flutter_override.sh /usr/local/bin/flutter
# π Print a success messageecho"Flutter override script has been installed successfully."
This script downloads and sets up Shorebird, then overrides the default flutter build command.
In the Codemagic Workflow Editor, add the setup_shorebird.sh script to the "Pre-build script" section.
Add the SHOREBIRD_TOKEN environment variable in the "Environment variables" section of the Codemagic Workflow Editor.
Please note that I'm using the shorebird release android --force -- --dart-define=ENVIRONMENT_TYPE=production command to define environment variables. You can customize this as you wish or even make the script super-dynamic to accept any configuration set up in the workflow editor. π
I hope this workaround helps others who are looking to use Shorebird with Codemagic Workflow Editor π.
Once again, thank you for your fantastic work on Shorebird π!
The text was updated successfully, but these errors were encountered:
Hey Shorebird team! π
First of all, let me express my appreciation for your amazing work on Shorebird π! We're all super excited that code push is finally possible on Flutter! π₯³
I wanted to share a solution I found for using Shorebird with the Codemagic Workflow Editor. As per your documentation, it is mentioned that Codemagic Workflow Editor doesn't support changing the build command, which is required for using Shorebird. I came up with a workaround that allows me to override the default flutter build command with Shorebird's command. I have tested this, and it works successfully on Codemagic.
Here's the setup π:
setup_shorebird.sh
) with the following content:This script downloads and sets up Shorebird, then overrides the default flutter build command.
setup_shorebird.sh
script to the "Pre-build script" section.SHOREBIRD_TOKEN
environment variable in the "Environment variables" section of the Codemagic Workflow Editor.And voilΓ ! π©β¨ After completing these steps, the Codemagic build process should use Shorebird's command instead of the default
flutter build
.I hope this workaround helps others who are looking to use Shorebird with Codemagic Workflow Editor π.
Once again, thank you for your fantastic work on Shorebird π!
The text was updated successfully, but these errors were encountered: