Running Seeds After Edeliver Deploy

Success is neither magical nor mysterious. Success is the natural consequence of consistently applying basic fundamentals.
— E. James Rohn.

Hi guys, after deploying your application to production or staging server, have you ever wondered on how you can import your seed data. This post is specifically targeted to elixir web apps only.

Assuming you haven’t already started the migration process and migrated all the tables. Go to the built edeliver release folder and run ./bin/my_app_name remote_console to access iex console for this web OTP (Open Telecom Platform) app.

When you’re inside the iex console, enter this command:

:code.priv_dir(:my_app_name)
|> Path.join("repo/seeds.exs") 
|> Code.require_file()

The command above will be evaluated by the console interpreter and run the seeds file. This would access the file from priv directory and execute seeds.exs. After that, check your database if all the migrations has been executed.

That’s all there is to it guys, check my other post for some additional tips and tricks. Hope you enjoyed this article!

Comments

Popular posts from this blog

Top Three DNS Providers That Provides Good Service in SEA (Southeast Asia)

Sending Email Using MailKit in ASP.NET Core Web API

Dirty Logging With Serilog For ASP.NET 5