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

post-push.js is not executing anymore #2981

Closed
4 tasks done
danielhstahl opened this issue Sep 9, 2022 · 4 comments
Closed
4 tasks done

post-push.js is not executing anymore #2981

danielhstahl opened this issue Sep 9, 2022 · 4 comments
Assignees
Labels
archived This issue has been locked. backend-builds

Comments

@danielhstahl
Copy link

Before opening, please confirm:

App Id

dkn95cusc5c8

Region

us-west-2

Amplify Hosting feature

Backend builds

Describe the bug

We have a post-push.js script which runs on after every build. This has been working without fail for months. On Tuesday it stopped working for us on some of our existing branches. Today I created a new branch and post-push.js ran on it, but when redeploying post-push.js no longer runs. The post-push.js file exists in the app S3 bucket. When I pull the environment locally the post-push.js file exists. When I attempt to deploy locally it runs post-push.js locally.

Expected behavior

post-push.js should continue running after a build.

Reproduction steps

  1. Add post-push.js to your hooks folder
  2. Push to your github branch that is connected to amplify
  3. Amplify builds and post-push.js runs
  4. Push another change to the same branch
  5. Amplify builds but post-push.js does not run

Build Settings

version: 1
env:
  variables:
    NODE_OPTIONS: --max-old-space-size=6500
backend:
  phases:
    preBuild:
      commands:
        - yum install -y yum-utils
        - yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
        - yum install -y terraform
        - yum install -y python3

    build:
      commands:
        - update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 11
        - /usr/local/bin/pip3.8 install --user pipenv
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple

Additional information

No response

@hackmajoris
Copy link

hackmajoris commented Sep 17, 2022

It's due to the fact that the Amplify v10.0.0 changes how the Hooks are handled. Now you have to check-in them in the version control. The hooks folder isn't uploaded to S3 anymore.

I think, setting the version in the Amplify Console/You App/Build Settings/ to the previous version of Amplify: 9.2.1, will work for you.

Screenshot 2022-09-17 at 19 41 58

However, with the v10.0.0 of Amplify, there is another issue: aws-amplify/amplify-cli#11021

@ghost ghost self-assigned this Sep 29, 2022
@Jay2113 Jay2113 assigned Jay2113 and unassigned ghost Jun 16, 2023
@Jay2113
Copy link
Contributor

Jay2113 commented Jun 30, 2023

Hi everyone 👋 , thanks for reaching out to us and we apologize for the delayed response on this thread.

It seems that this issue was fixed with the release of Amplify CLI version 10.5.0 as confirmed here: aws-amplify/amplify-cli#11021 (comment).

I am going to close this thread but please feel free to open a new GitHub issue if you are experiencing issues with Amplify Hosting.

@Jay2113 Jay2113 closed this as completed Jun 30, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

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.

@github-actions
Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Jun 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. backend-builds
Projects
None yet
Development

No branches or pull requests

3 participants