Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get backend deployment work native amplify cli #13631

Closed
3 tasks done
OperationalFallacy opened this issue Feb 28, 2024 · 6 comments
Closed
3 tasks done

Can't get backend deployment work native amplify cli #13631

OperationalFallacy opened this issue Feb 28, 2024 · 6 comments
Labels
hosting Issues tied to hosting category pending-response Issue is pending response from the issue author pending-triage Issue is pending triage transferred This issue was transferred from another Amplify project

Comments

@OperationalFallacy
Copy link

Before opening, please confirm:

Amplify Hosting feature

Deployments

Is your feature request related to a problem? Please describe:

version: 1
applications:
  - appRoot: xxx-website
    backend:
      phases:
        install:
          commands:
            - pwd
            - cd ../xxx-api
            - node --version
            - nvm use 18.17.0 || true
            - node --version
            - yarn global add tsc-alias typescript tsc
        build:
          commands:
            - yum install jq -y
            - pwd
            - cd ../xxx-api
            - which envCache
            - envCache --get stackInfo
            - export STACKINFO="$(envCache --get stackInfo)"
            - echo $STACKINFO
            - env
            - if [ "${USER_BRANCH}" = "dev" ]; then envCache --set stackInfo "$(amplify env get --json --name dev)"; fi
            - if [ "${USER_BRANCH}" = "prod" ]; then envCache --set stackInfo "$(amplify env get --json --name prod)"; fi
            - yarn install --production
            - export aid=$(envCache --get stackInfo | jq '.AmplifyAppId')
            - amplify --version
            - amplify status -v
            - amplify pull --appId ${aid} --envName ${USER_BRANCH}
            - amplify env list
            # - cat $(which amplifyPush) || true
            - amplify function build -y
            - amplify status
            - amplify push
            # - amplify push -y
            # - amplifyPush --simple
            - echo 'Build and push completed...'

Describe how you'd like this feature to work

I can't use amplifyPush --simple because it's not building and updating functions, probably because I've used some custom scripting. It works though in local dev environment.

And I can't get deployments with "amplify push" work in the cicd because it keeps failing with "Amplify backend project files detected within this folder" at amplify pull command...

2024-02-28T21:48:58.930Z [INFO]: 🛑 No Amplify backend project files detected within this folder.
2024-02-28T21:48:58.930Z [INFO]: Resolution:
                                 Either initialize a new Amplify project or pull an existing project.
                                 - "amplify init" to initialize a new Amplify project
                                 - "amplify pull <app-id>" to pull your existing Amplify project. Find the <app-id> in the AWS Console or Amplify Studio.
                                 Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

I need help figuring out what's going on. given that amplify status works - even though it says creating everything from scratch - why checking out env is such a pain?

@OperationalFallacy OperationalFallacy added the feature-request Request a new feature label Feb 28, 2024
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@Jay2113
Copy link
Contributor

Jay2113 commented Mar 4, 2024

@OperationalFallacy 👋 , thanks for reaching out. Does running amplify push -y throw a similar error? Can you try including a pwd command before running the push to analyze the path? Also, can you share your Amplify app id?

For better assistance, I am going to transfer this over to the amplify-cli repository.

@Jay2113 Jay2113 added pending-triage Issue is pending triage and removed feature-request Request a new feature labels Mar 4, 2024
@Jay2113 Jay2113 transferred this issue from aws-amplify/amplify-hosting Mar 4, 2024
@Jay2113 Jay2113 added the transferred This issue was transferred from another Amplify project label Mar 4, 2024
@OperationalFallacy
Copy link
Author

Here's app-id for dev: d2bgfp3zb4o7c8

@ykethan
Copy link
Member

ykethan commented Mar 8, 2024

Hey @OperationalFallacy, thank you for providing the app-id. On diving into the logs it appears the issue is occurring on the amplify status -v. To mitigate the issue i would suggest moving the command to after the pull command.
Additionally, noticed the pull command does not have a -y which may cause the cli to prompt for the profile selection.

@ykethan ykethan added hosting Issues tied to hosting category pending-response Issue is pending response from the issue author labels Mar 8, 2024
@ykethan
Copy link
Member

ykethan commented May 3, 2024

Closing the issue due to inactivity. Do reach out to us if you require any assistance.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Copy link

github-actions bot commented May 3, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hosting Issues tied to hosting category pending-response Issue is pending response from the issue author pending-triage Issue is pending triage transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

3 participants