lpvm

lpvm

Edeliver ssh different port and config options

I’m trying to setup edeliver and distillery to automate the deployment of my prototype to a VPS jail (running FreeBSD). That jail is configured to receive ssh in a different port than 22. This part is working fine as .ssh/config is setup.

The first thing I don’t understand is in .deliver/config.
In my local development box, the app is being built in ~/prog/elixir/orif/trunk.
As per the edeliver instructions,

  • BUILD_HOST : the host where to build the release
  • BUILD_USER : the local user at build host
  • BUILD_AT : the directory on build host where to build the release. must exist.

What is shown in a guide is that BUILD and PRODUCTION have same configs.

should BUILD_HOST have the name of my Linux box?
should BUILD_USER have the username I’m working with at my box?
should BUILD_AT be inside that ~/prog/elixir/orif/trunk directory or outside, for example in ~/prog/elixir/orif/build?

As for the ssh deployment. I’ve not been able to configure edeliver to mimic what I do at the command line, i.e., to ssh -i some_identity_file -p 22000 elixir@my_host. It always asks for my local user at the VPS at the standard 22 ssh port. How to do it?

Most Liked

aseigo

aseigo

The values of the BUILD_* vars reflect where you want to build. If you are building on your local machine, then indeed they can just be your local system and user. Where I work we have a couple of different production targets (OS / versions), and for each of those production environments we have a (or more) build and test server that mirrors those setups. This way, no matter what OS the developer is working on, they can build for the correct production target.

So we point the BUILD_* to the remote host, the build user (which all the devs have ssh access to on the build systems) and we put BUILD_AT somewhere under /tmp. Builds then happen remotely on the right build system. Similarly for staging/testing.

To get the port for ssh (we actually have one system that has a similar config to yours: the deploy goes over an ssh server listening on port 2200) we currently configure this in the developer’s local ~/.ssh/config:

Host sshalias
    HostName actual.domain.com
    Port 2200

And then the deploy host in the edeliver config is noted as sshalias (matching whatever value is in the ~/.ssh/config). I am not entirely happy with that solution, and I wish edeliver had a more straight-forward way of defining alternative ssh ports .. but so far we have not found it.

Last Post!

aseigo

aseigo

Your post motivated me to glance at the edeliver code in question and, for the curious, it seems that there are two functions in the shell script libexec/core: __sync_remote and __remote that initiate the ssh connections. They do not have a way to take a param for the ssh port, but were that to be added would allow setting the ssh port directly in the edeliver config if the usage of those two functions (only two scripts in libexec use them) were updated to pass on the relevant port #. So … not a tiny job, but not a big one either.

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement