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

Docs: .gitignore and secrets plus buggy npm. #53

Open
petelacey opened this issue Feb 13, 2020 · 3 comments
Open

Docs: .gitignore and secrets plus buggy npm. #53

petelacey opened this issue Feb 13, 2020 · 3 comments

Comments

@petelacey
Copy link
Contributor

First, awesome product! I hope to graduate out of the free tier in the next two months.

In the meantime, I just worked through my first deploy and hit a couple of snags that you may want to know about and maybe document.

One, the default .gitignore file that Github generates for a new Elixir project includes *.secret.exs. If someone (like me) is not paying attention, they may fail to actually commit the needed changes to prod.secret.exs. This causes the deploy to fail with remote: ** (Code.LoadError) could not load /tmp/build/config/prod.secret.exs.

Two, the latest version of node.js includes a buggy version of npm. I originally specified node_version=13.8.0 in my phoenix_static_buildpack.config file. I needed to downgrade to node_version=13.3.0 to get things to work. Without the downgrade, the error was remote: npm ERR! invalid bin entry for package @babel/parser@7.6.0. key=parser, value=bin/babel-parser.js. This is the npm issue.

Finally, there's a minor typo in the database migrations section where you have: "If you are using not using releases..."

Thanks again for the awesome product and documentation!

@jesseshieh
Copy link
Contributor

Thanks for the thoughtful feedback! This is the kind of stuff that really helps us improve the product so I really appreciate you spending the time to write this up!

Can I ask how you generated your elixir project? Usually, I use mix phx.new which generates the following .gitignore file.
https://github.com/phoenixframework/phoenix/blob/master/installer/templates/phx_single/gitignore

Thanks for the details about the npm issue. I had a few customers run into that one. For them, they said upgrading npm to 6.13.7 seemed to fix the issue. Perhaps you can still use the latest version of node if you upgrade npm also.

Typo fixed! Thanks again.

@petelacey
Copy link
Contributor Author

When you use Github's UI to generate a repo, it asks if you want a .gitignore file tailored to a chosen programming language. When you select Elixir, it generates this: https://github.com/petelacey/sample-elixir-project/blob/master/.gitignore. In my case, I too started with the .gitignore generated by mix phx.new, but then I supplemented it with the entries that were only in the Github version. Admittedly, not a lot of people would do this. Still, it's not hard to imagine others git-ignoring their secrets file.

@jesseshieh
Copy link
Contributor

Ah I see. Hm, I wonder what the right solution to this is. Perhaps, phoenix should move it's prod.secret.exs back into prod.exs since it doesn't actually contain any secrets anymore.
https://github.com/phoenixframework/phoenix/blob/master/installer/templates/phx_single/config/prod.secret.exs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants