Sorry, I think I see the problem. Right in front of my nose. I’ll reply back if it works.
I have a
mix release-generated build that works on my workstation and I’m copying files one at a time to a google compute instance. Just trying to do one instance, manually.
It looks like I’m missing somethign that sets
RELEASE_VSN: I run
MIX_ENV=prod mix release beta1
then use gcloud to copy up all files (assets) into cloud
/var/oiv1/ and then
and I get
:/var/oiv1$ ./beta1 start
cut: /var/releases/start_erl.data: No such file or directory
./beta1: 14: .: Can't open /var/releases//env.sh
…which looks like there is an empty string where RELEASE_ENV should be.
I’m taking a wild guess: It needs to parse sh.eex into sh file, and I need to put these files in a different folder and/or create folders and set permissions for it to write.
Any links explain this?
p.s. my first elixir release build
SOLVED in the title, did you sort this out?
“Sort” of. I was tired and not paying attention to the obvious build output: Build generates a bunch of files, one of which is env.sh, and I was not copying these to the vm instance.
In the docs https://hexdocs.pm/mix/master/Mix.Tasks.Release.html, there is a section, “Directory structure,” which lists all the files. I was under the impression (from reading a Distillery tutorial) that the release was a single file.
So, I am working under the assumption now that all the files listed under “Directory structure” are necessary to run the app. What would be helpful, however, is a short description of the purpose of each file. Some of them are obvious (hits self on the head), but some are not.
(And the missing string for RELEASE_VSN is probably because the string is generated dynamically by default, from whatever child directory is in /releases, which I had not copied over. Guessing.)
There’s also the file permissions issues, but I’m guessing that only the /tmp folder needs write permissions.
Any advice welcomed.
At least in distillery the release is build with all it files in their folder structure and additionally there’s a .tar.gz file generated, which holds all the files as well, but as one bundled archive. Most often people refer to that .tar.gz archive as “the release”.