tino415
Copying _build, deps and recompiling in different docker container (CI/CD)
Hello all,
today I had interesting problem in our CI/CD pipeline. We set up pipeline so in one container was run mix deps.get, MIX_ENV=test mix deps.compile and MIX_ENV=test mix compile then we copied _build and deps folder to other container and run mix test there. Problem was that after running migrations tests failed on error:
** (Mix) Could not start application ranch: exited in: :ranch_app.start(:normal, []) 00:06
744 ** (EXIT) an exception was raised: 00:06
745 ** (UndefinedFunctionError) function :ranch_app.start/2 is undefined (module :ranch_app is not available) 00:06
746 (ranch 1.8.0) :ranch_app.start(:normal, []) 00:06
747 (kernel 8.3.2.3) application_master.erl:293: :application_master.start_it_old/4
Which got resolved by running MIX_ENV=test mix deps.compile on testing machine. My question is why is that? Is that somehow avoidable? On localhost I never had to run MIX_ENV=test mix deps.compile or MIX_ENV=test mix compile to be able to run mix test and deps.compile takes a lot of time and noticeably slowing down our pipeline.
Most Liked
BradS2S
It isn’t best practices to copy the _buikd folder and move it. I’m not sure I follow you completely.







