Where is SSH_CONFIG_DIR set?

@FelicianoTech coming from Where is SSH_CONFIG_DIR set? · Issue #151 · CircleCI-Public/cimg-base · GitHub

I would like to know where the checkout script gets the SSH_CONFIG_DIR

Thanks, I’ll pass this question around.

@FelicianoTech can you ask them to share the source code to the checkout command please?

The source code to the checkout command is shown in the output screen under the ‘Checkout code’ step of the executed job on the Circleci web GUI.

@rit1010 It’s actually not the full source code. It’s missing the population of several environment variables, and has interpolated it the values of several other environment variables. You can guess what the original values might have been to try to replicate most of the checkout command (I literally just did yesterday), but there are still questions about hidden pieces that answer some questions like those of the OP.

That is a wider issue. The variables are coming from the actual circleci agent that is installed on the system. This is where the OP’s SSH_CONFIG_DIR value was coming from as it seems to be populated from a local call to a make temp directory API.

From what I can tell the result is that values can be injected by the pre-processor that processes the config.yml file or from the local agent (circleci-hosted or self-hosted) that executes on the machine instance. I do not believe that the code for these is public.

It seems that the agent is not exposing the SSH key variable to the job, so it seems to be impossible to use the SSH key passed by CircleCI from a VCS integration, unless the ‘official’ checkout step creates it first.

This is problematic for us, as we want to be able to replace the checkout command with our own, but then we don’t get the advantage of the VCS integration’s automatic SSH keys anymore, and instead have to manually generate keys and add them to contexts or project variables.

Yes, it is a bit of a monolith of a command and I guess it comes from when Circleci was first released. Sadly there is no way to direct it to just create the SSH environment in a known location without it also the checkout step.