amplify-hosting
amplify-hosting copied to clipboard
post-push.js is not executing anymore
Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the FAQ.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
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
- Add post-push.js to your hooks folder
- Push to your github branch that is connected to amplify
- Amplify builds and post-push.js runs
- Push another change to the same branch
- 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
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.
However, with the v10.0.0 of Amplify, there is another issue: https://github.com/aws-amplify/amplify-cli/issues/11021
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: https://github.com/aws-amplify/amplify-cli/issues/11021#issuecomment-1319321271.
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.
⚠️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.
This issue has been automatically locked.