Coder Social home page Coder Social logo

mix-edip's Introduction


Outdated/Deprecated - Please use mix-edib instead.


EDIP mix task

A mix task for EDIP (elixir docker image packager).

TOC

EDIP creates a docker image of your application release.

Install

Project dependency

In mix.exs:

defp deps do
  [
    {:exrm, "~> 0.19"},
    {:edip, "~> 0.4.3"}
  ]
end

Then run:

mix deps.get edip && mix deps.compile edip

mix archive

Just run this and confirm:

mix archive.install http://git.io/edip-0.4.3.ez

Adn don't forget to add exrm to your project:

defp deps do
  [
    {:exrm, "~> 0.19"}
  ]
end

Usage

mix edip

Help

mix help edip

Options

# Override the (repository) name of the docker image.
mix edip --name <NAME>
mix edip -n <NAME>

# Set a specific tag for the docker image.
mix edip --tag <TAG>
mix edip -t <TAG>

# Set only a specific prefix for the docker image name (default: local).
mix edip --prefix <PREFIX>
mix edip -p <PREFIX>

# Silence build output of EDIP (will be logged to `.edip.log` instead).
mix edip --silent
mix edip -s

If --name and --prefix are given, the name option takes precedence (prefix will be ignored).

# Map additional volumes for use while building the release
mix edip --mapping <FROM>:<TO>[:<OPTION>]
mix edip -m <FROM>:<TO>[:<OPTION>]

To pull dependencies stored in private github repositories you will need to make your SSH keys accessible from the container doing the build:

mix edip --mapping /path/to/home/.ssh:/root/ssh.

mix-edip's People

Contributors

asaaki avatar edgurgel avatar goneflyin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mix-edip's Issues

Config file .edip.exs

Provide possibility to use a config file, so people do not need to give command line arguments every time.

Format should be similar/identical to parsed arguments in lib/edip/config.ex (a dict).

Specify a different edip

I wonder if an option to override the edip repository would be accepted? I'm trying to find a potential bug in the building process but it's hard to use my fork as I would need to fork both projects.

Does this make sense?

Umbrella projects

This topic is not covered yet, and needs to be explored.

Is it a target for EDIP?
How can we achieve it?

Possible approach:

Since an umbrella project is just a collection of independent apps, each app can be packaged separately. This is what exrm is also doing, and therefore we should aim for the same goal.

This has 2 implications:

  1. When running in <umbrella_project>/apps/<app_project>, the ../../<something> paths needs to be resolved. Means: We can't just mount the current app directory into the container but have always to mount the umbrella root. This means we have to provide some switches in the packaging flow.
  2. When running from the umbrella root a specific app has to be given. And/or we also give the option to package all apps. (--app <app_dir_name>/--all). Currently this would need to trigger separate packaging builds for each app.

For 2 to evaluate: packaging of all apps in same EDIP run?
(multiple artifacts -> multiple artifact configurations -> multiple image imports)

Also keep in mind: The projects can still depend on each other.
{:my_local_dep, path: "../my_local_dep"}
(This is perhaps a real use case for umbrella projects.)


Links:

Mix task doesn't propagate the failure

Hey I noticed that when the make call fails the mix task still says that the image is ready.

/bin/sh: docker: not found
package/make-image.mk:18: recipe for target 'build' failed
make[1]: *** [build] Error 127
make: *** [image] Error 2
make[1]: Leaving directory '/build'
package/Makefile:24: recipe for target 'image' failed
Makefile:51: recipe for target 'build-package' failed
make[1]: *** [build-package] Error 2
==> The image is ready! You can check with docker images

I saw that there's a message for this case but apparently it's not being checked if do_cmd got back an :ok or error tuple

https://github.com/asaaki/mix-edip/blob/master/lib/edip/utils.ex#L27

I can send a PR for this case!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.