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?

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.

2 Likes

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.