feat(artifact_proxy): add script to generate artifact_manifest.yaml (#374)

This commit is contained in:
Felix Angelov
2023-04-26 13:39:26 -05:00
committed by GitHub
parent 89cda78077
commit b4181c08fb
2 changed files with 61 additions and 6 deletions
+22 -6
View File
@@ -32,7 +32,9 @@ If run into 404s when fetching artifacts, you may need to update the artifact li
To do so, you will need to determine the artifact URLs. Follow these steps:
- Adjust shorebird_cli to point to http://localhost:8080 instead of https://download.shorebird.dev:
- packages\shorebird_cli\lib\src\shorebird_process.dart
```diff
Map<String, String> _environmentOverrides({
required String executable,
@@ -47,7 +49,9 @@ To do so, you will need to determine the artifact URLs. Follow these steps:
return {};
}
```
- Adjust third_party Flutter to point to http://localhost:8080 instead of https://download.shorebird.dev:
- third_party\flutter\bin\internal\shared.sh
```diff
@@ -63,10 +67,11 @@ To do so, you will need to determine the artifact URLs. Follow these steps:
SHOREBIRD_ENGINE_VERSION=`cat "$FLUTTER_PATH/bin/internal/engine.version"`
echo "Shorebird Engine • revision $SHOREBIRD_ENGINE_VERSION"
# Install Shorebird Flutter Artifacts
- FLUTTER_STORAGE_BASE_URL=https://download.shorebird.dev $FLUTTER_PATH/bin/flutter --version
+ FLUTTER_STORAGE_BASE_URL=http://localhost:8080 $FLUTTER_PATH/bin/flutter --version
- FLUTTER_STORAGE_BASE_URL=https://download.shorebird.dev $FLUTTER_PATH/bin/flutter --version
+ FLUTTER_STORAGE_BASE_URL=http://localhost:8080 $FLUTTER_PATH/bin/flutter --version
}
```
- Modify flutter_tool used by Shorebird to allow downloads from insecure URLs:
- shorebird\bin\cache\flutter\packages\flutter_tools\gradle\flutter.gradle
```diff
@@ -81,9 +86,20 @@ To do so, you will need to determine the artifact URLs. Follow these steps:
```
- Remove the flutter_tools snapshot
```bash
cd bin/cache/flutter/bin/cache
rm flutter_tools.s*
```
```bash
cd bin/cache/flutter/bin/cache
rm flutter_tools.s*
```
- Run a shorebird command (`shorebird run` works well)
- For each artifact that 404s, add a line to `packages\artifact_proxy\lib\config.dart`, following the conventions for capturing engine revisions and escaping relevant characters.
## Generating an `artifact_manifest.yaml`
To generate a new `artifact_manifest.yaml` for a specific flutter_revision use the following command:
```
./tools/generate_manifest.sh <flutter_engine_revision> > artifact_manifest.yaml
```
Then upload the `artifact_manifest.yaml` to `download.shorebird.dev/shorebird/<shorebird_engine_revision>/artifacts_manifest.yaml`
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
# This script outputs an artifact_manifest.yaml mapping
# a shorebird engine revision to a flutter engine revision.
# Usage:
# ./generate_manifest.sh <flutter_engine_revision> > artifact_manifest.yaml
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: ./generate_manifest.sh <flutter_engine_revision>"
exit 1
fi
FLUTTER_ENGINE_REVISION=$1
cat <<EOF
# This file is generated by shorebird/packages/artifact_proxy/tool/generate_manifest.sh
# Do not edit this file manually.
flutter_engine_revision: $FLUTTER_ENGINE_REVISION
storage_bucket: download.shorebird.dev
artifact_overrides:
# artifacts.zip
- flutter_infra_release/flutter/\$engine/android-arm-64-release/artifacts.zip
- flutter_infra_release/flutter/\$engine/android-arm-release/artifacts.zip
- flutter_infra_release/flutter/\$engine/android-x64-release/artifacts.zip
# embedding release
- download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-\$engine/flutter_embedding_release-1.0.0-\$engine.pom
- download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-\$engine/flutter_embedding_release-1.0.0-\$engine.jar
# arm64_v8a release
- download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-\$engine/arm64_v8a_release-1.0.0-\$engine.pom
- download.flutter.io/io/flutter/arm64_v8a_release/1.0.0-\$engine/arm64_v8a_release-1.0.0-\$engine.jar
# armeabi_v7a release
- download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-\$engine/armeabi_v7a_release-1.0.0-\$engine.pom
- download.flutter.io/io/flutter/armeabi_v7a_release/1.0.0-\$engine/armeabi_v7a_release-1.0.0-\$engine.jar
# x86_64 release
- download.flutter.io/io/flutter/x86_64_release/1.0.0-\$engine/x86_64_release-1.0.0-\$engine.pom
- download.flutter.io/io/flutter/x86_64_release/1.0.0-\$engine/x86_64_release-1.0.0-\$engine.jar