I am trying to deploy Perfect 2.0 (which uses the swift package manager) on Heroku. A current build pack for Swift 3 and Perfect 2.0 exists and I have tested and pushed the below template with this buildpack to a heroku app successfully without build errors. In particular, I am trying to get Perfect's base template example--which runs fine locally--to deploy to heroku as a proof of concept. The problem, however, is that this build pack requires a top-level Procfile to inform heroku as to how to access the perfect server. In Perfect 1.0 this procfile was simply web: perfectserverhttp --port $PORT
, but with this new procfile perfectserverhttp
is not a recognized command. In my heroku logs it errors with bash: perfectserverhttp: command not found
. What is the appropriate way to handle this? i.e. how should I construct my procfile, and with what command do I access my server instance? I can get things to run locally by creating a procfile with web: .build/debug/<given_package.swift_name>
, but this does not translate to a deployment on heroku.
Asked
Active
Viewed 500 times
0

Ethan Kay
- 657
- 6
- 24
-
Do you have a pointer to the exact code you are trying to deploy? The code you point at is the top-level project, not an example project. – Daniel Dunbar Oct 07 '16 at 05:56
-
Fixed the link. Note that the only difference between that depository and what I tried to deployed is a Procfile added at the top level. – Ethan Kay Oct 07 '16 at 13:36
1 Answers
2
I've forked that project and made a Heroku Button deployable version here. In order to get that working, I checked out the sample app, and found that the build dumped the binary in .build/release/PerfectTemplate
, so your Procfile should be:
web: .build/release/PerfectTemplate --port $PORT
Note, you also want to set the $PORT
. If you've deployed but failed prior to this, you'll also want to make sure you scale up the web dyno: heroku ps:scale web=1
.

Jon Mountjoy
- 4,498
- 22
- 24