Open scott-elgaard opened 3 days ago
Hi @scott-elgaard 👋 , thanks for reaching out. I observed that the AMPLIFY_MONOREPO_APP_ROOT
environment variable is set to ui/corvision
for the app d1gwep07t2uubt
. Thus, the commands that are present under the appRoot: ui/corvision
defined in the amplify.yml
file will be executed i.e. the frontend
build phase.
To ensure the backend
build phase is executed, you will need to update the amplify.yml
file as follows:
version: 1
applications:
- appRoot: ui/corvision
backend:
phases:
preBuild:
commands:
- echo "Backend preBuild step started"
- amplify --version
- echo "Backend preBuild step finished"
build:
commands:
- echo "Backend build step started"
- amplify status
- amplifyPush --simple
- amplify codegen models
- mkdir -p cloud/lib/amplify/lib
- amplify export --out cloud/lib/amplify/lib
- echo "Backend build step completed"
postBuild:
commands:
- echo "Custom postBuild step completed"
frontend:
phases:
preBuild:
commands:
- echo "Frontend preBuild step started"
- export FLUTTER_ROOT=$HOME/flutter
- mkdir -p $FLUTTER_ROOT
- curl -o flutter.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.2-stable.tar.xz
- tar xf flutter.tar.xz -C $HOME
- export PATH="$PATH:$FLUTTER_ROOT/bin"
- flutter precache
- flutter --version
- echo "Frontend preBuild step completed"
build:
commands:
- echo "Frontend build step started"
- flutter pub get
- flutter build web --release --verbose
- echo "Frontend build step completed"
artifacts:
baseDirectory: build/web
files:
- '**/*'
Please note that if your amplify
directory exists at the root, you can run cd
command to adjust/switch the directories.
You can learn more about the monorepo yaml syntax here: https://docs.aws.amazon.com/amplify/latest/userguide/monorepo-configuration.html#monorepo-yml-syntax.
Environment information
Describe the bug
When running a build in amplify my backend phase never triggers from this amplify.yml
Not sure if there is something wrong with my amplify.yml or what but I've tried a bunch of different commands and formats in the backend phase and none of them trigger/get called.
appID: d1gwep07t2uubt Region: use-east-2
Reproduction steps
try to deploy in amplify