.gitpod.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. image:
  2. file: .gitpod.Dockerfile
  3. tasks:
  4. - init: |
  5. flutter upgrade
  6. flutter update-packages --force-upgrade
  7. flutter run -d web-server --no-resident
  8. tasks:
  9. - init: |
  10. flutter channel beta
  11. flutter upgrade
  12. flutter config --enable-web
  13. flutter config --android-sdk /home/gitpod/androidsdk
  14. echo y | flutter doctor --android-licenses
  15. flutter doctor
  16. flutter pub get
  17. # flutter build -v bundle
  18. # flutter build -v web
  19. # flutter build -v appbundle
  20. #flutter build -v apk
  21. - command: |
  22. # Gitpod is not able to run emulators within a worspace at this stage as
  23. # Google Kubernetes Engine does not support Nested Virtualization.
  24. #
  25. # If running Gitpod on your own infrastructure or via the Dockerfile locally
  26. # on infrastructure that exposes vmx or svm then this command will launch
  27. # the emulator.
  28. #
  29. # $ emulator -avd avd28 -no-audio -no-window
  30. #
  31. # Until this restriction is mitigated you can run native mobile apps in your
  32. # browser via https://appetize.io/
  33. if [[ -z "$APPETIZE_API_TOKEN" ]]; then
  34. echo "Appetize API token not set. Run:"
  35. echo ""
  36. echo " gp env APPETIZE_API_TOKEN=your_token"
  37. echo ""
  38. echo "and restart this workspace in order to get an app preview."
  39. echo ""
  40. echo "Request your token here: https://appetize.io/docs#request-api-token"
  41. else
  42. curl -sS --http1.1 "https://$APPETIZE_API_TOKEN@api.appetize.io/v1/apps/$APPETIZE_PUBLICKEY" \
  43. -F "file=@/workspace/template-flutter/build/app/outputs/flutter-apk/app.apk" \
  44. -F platform=android \
  45. -F "buttonText=Start App" \
  46. -F "postSessionButtonText=Start App" \
  47. > .appetize.json
  48. APPETIZE_PUBLICKEY=$(jq -r .publicKey .appetize.json)
  49. gp env "APPETIZE_PUBLICKEY=$APPETIZE_PUBLICKEY"
  50. export APPETIZE_PUBLICKEY
  51. python -m webbrowser "https://appetize.io/embed/$APPETIZE_PUBLICKEY?device=pixel4&autoplay=true"
  52. fi
  53. flutter devices
  54. flutter run --web-port 8080
  55. ports:
  56. - port: 5900
  57. onOpen: ignore
  58. # vnc
  59. - port: 6080
  60. onOpen: open-preview
  61. # flutter
  62. - port: 8080
  63. onOpen: open-preview
  64. vscode:
  65. extensions:
  66. - dart-code.flutter@3.9.1:Ef3b5HLzz0C/TIa0n9xSyA==