Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes CircleCI tests run by:
yes
which causes CircleCI to fail allowing to use existent key. -Additionally, upgraded CircleCI config to latest 2.1 version and added friendly names to the CI steps.
--
When attempting to run tests in CircleCI we observed several issues.
First, it seems CircleCI fails when we try using
yes
to pipe an yes-answer to a command (see https://discuss.circleci.com/t/failed-build-exit-code-141/26335). Thisyes
command was needed to be able to replaceid_rsa
key when it exists. To workaround this issue, I've modified the logic to only generateid_rsa
key when it does not exist - and hence not requiring a confirmation. Note that, attempting to remove~/.ssh
and allow the existent logic to generate all keys also causes failures.Second, when running tests in Docker, the container does not provide an SSH server where the tests can connect to - so all tests fail. I've made an attempt to install the OpenSSH server in the original docker image but was faced with the issue that APT servers for Debian 9 changed (too old version) which further required me to modify APT servers. Instead, I've done an attempt to use more modern convenient images as described in https://discuss.circleci.com/t/legacy-convenience-image-deprecation/41034 . I've made some progress by installing and starting OpenSSH server but there were several test failures. Also, the approach was a bit cumbersome because everytime the image started I would install OpenSSH (not benefitting from Docker image builds) and having to start the OpenSSH server before running the tests. Creating a custom Docker image forces us to publish it and make it public - create a dependency to an external registry and creating a image that is only specific for these tests. Instead, I've decided to use an "old-fashioned" VM linux and that made the trick.
As part of that change, I've used Ubuntu 20.04 (Focal Fossa) LTS as it's OpenSSL version already deprecates RSA keys schemas but it's not as modern as in later Ubuntu 22.04.
Non-necessary changes:
2.1
, but why not ensure we're at the latest version of what CircleCI updates