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

Remove backslash from Procfile created by vapor heroku init #380

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

e28eta
Copy link
Contributor

@e28eta e28eta commented Mar 8, 2022

Running vapor heroku init, and choosing to use the buildpack (vs docker), creates a Procfile with the following:

web: Run serve --env production --hostname 0.0.0.0 --port \$PORT

This works okay when deployed to heroku (note the --port \4386):

2022-03-08T07:07:33.775125+00:00 heroku[web.1]: Starting process with command `Run serve --env production --hostname 0.0.0.0 --port \4386`
2022-03-08T07:07:35.820116+00:00 app[web.1]: [ NOTICE ] Server starting on http://0.0.0.0:4386

However, it doesn't work when using the heroku local command:

$ heroku local
10:54:26 PM web.1 |  [1/1] Planning build
10:54:31 PM web.1 |  [0/0] Build complete!
10:54:31 PM web.1 |  [ WARNING ] Could not convert option for `port` to Int
10:54:31 PM web.1 |  Swift/ErrorType.swift:200: Fatal error: Error raised at top level: .invalidOptionType("port", type: Int)
[DONE] Killing all processes with signal  SIGILL
10:54:31 PM web.1 Exited with exit code SIGILL

This PR removes the backslash. The new Procfile contents are simply:

web: Run serve --env production --hostname 0.0.0.0 --port $PORT

I've verified this works with heroku remote & local.

2022-03-08T07:18:31.543631+00:00 heroku[web.1]: Starting process with command `Run serve --env production --hostname 0.0.0.0 --port 32664`
2022-03-08T07:18:32.671361+00:00 app[web.1]: [ NOTICE ] Server starting on http://0.0.0.0:32664
2022-03-08T07:18:33.310530+00:00 heroku[web.1]: State changed from starting to up
2022-03-08T07:19:57.000000+00:00 app[api]: Build succeeded

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
I'm not sure why it was originally there, but it works better without it
@0xTim 0xTim added the semver-patch Internal changes only. label Mar 9, 2022
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@0xTim 0xTim merged commit 1639da6 into vapor:main Mar 9, 2022
@VaporBot
Copy link

VaporBot commented Mar 9, 2022

These changes are now available in 18.3.6

@e28eta e28eta deleted the fix-port-heroku-local branch March 10, 2022 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Internal changes only.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants