-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Update Heroku generator for JHipster 8 #23971
Conversation
Co-authored-by: Marcelo Shima <marceloshima@gmail.com>
@mshima Do you have advice for making this work? |
@mshima I'm not sure I'm mocking
|
@mraible I did some adjusts. |
I hope random name is fixed now. |
It almost works:
I was able to reproduce it a couple of times. If I try again and use |
Do we need to remove |
I think it's a timeout issue. Can we wait a few seconds for the command to complete? |
@mshima I was able to fix the random name issue. I also added checks for the config (e.g. GRADLE_TASK) and buildpacks already being set. This is necessary because you can't add buildpacks twice so Other minor issues:
If the app already exists and you're deploying again, it prints the output from the checks. It'd be nice if the blank lines and output from the check commands could be suppressed.
If you update an existing app,
|
To stop printing to console, add a
|
Blank lines like |
this.log.verboseInfo(`No new ${addon} addon created`); | ||
const { stdout } = await this.spawnHeroku(['create', ...regionParams]); | ||
// Extract from "Created random-app-name-1234... done" | ||
this.herokuAppName = stdout.substring(stdout.lastIndexOf('/') + 1, stdout.indexOf('.git')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it’s not a git deployment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still seems to work OK for this part.
? The Heroku application "play-more" already exists! Use it anyways? No, generate a random name
INFO! Creating app...
INFO! done, evening-escarpment-92393
INFO!
INFO! https://evening-escarpment-92393-39f845122a90.herokuapp.com/ | https://git.heroku.com/evening-escarpment-92393.git
INFO!
INFO! set git remote heroku to https://git.heroku.com/evening-escarpment-92393.git
INFO!
Provisioning addons
However, there is a stacktrace further down:
Building application
ERROR! An error occured while running jhipster:heroku#productionBuild
ERROR! ERROR! Cannot read properties of null (reading 'on')
TypeError: Cannot read properties of null (reading 'on')
at HerokuGenerator.printChildOutput (file:///Users/mraible/dev/generator-jhipster/dist/generators/heroku/generator.mjs:521:16)
at HerokuGenerator.productionBuild (file:///Users/mraible/dev/generator-jhipster/dist/generators/heroku/generator.mjs:409:28)
at HerokuGenerator.executeTask (file:///Users/mraible/dev/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:241:26)
at env.queueTask.once (file:///Users/mraible/dev/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:215:56)
at runLoop.add.once (file:///Users/mraible/dev/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:381:23)
at Immediate.<anonymous> (/Users/mraible/dev/generator-jhipster/node_modules/grouped-queue/lib/subqueue.js:48:34)
at process.processImmediate (node:internal/timers:476:21)
> health-points@0.0.1-SNAPSHOT java:jar:prod
> npm run java:jar -- -Pprod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build finishes, but there's no deployment to Heroku that happens.
Let’s merge and we can handle any remaining adjusts later. |
Co-authored-by: Marcelo Shima <marceloshima@gmail.com>
Co-authored-by: Marcelo Shima <marceloshima@gmail.com>
@mshima I'm OK to merge. Some tests are failing though. |
Fixes #23686.
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.