Skip to content

Commit d66991a

Browse files
committed
Fixed setup-ssh.sh removing existing SSH keys on host env.
Signed-off-by: Alex Skrypnyk <alex@drevops.com>
1 parent 82d7eab commit d66991a

File tree

14 files changed

+175
-36
lines changed

14 files changed

+175
-36
lines changed

.circleci/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ aliases:
6767
TZ: "Australia/Melbourne"
6868
# Set runner terminal capabilities.
6969
TERM: xterm-256color
70+
# Disable strict host key checking for SSH connections.
71+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
72+
# Remove all SSH keys from the runner container.
73+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
7074
#;< !PROVISION_TYPE_PROFILE
7175
# How often to refresh the cache of the DB dump. Refer to `date` command.
7276
VORTEX_CI_DB_CACHE_TIMESTAMP: +%Y%m%d

.github/workflows/build-test-deploy.yml

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161
env:
6262
TZ: Australia/Melbourne
6363
TERM: xterm-256color
64+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
65+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
6466
VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
6567
VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
6668
VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
@@ -168,6 +170,9 @@ jobs:
168170
env:
169171
TZ: Australia/Melbourne
170172
TERM: xterm-256color
173+
# Disable strict host key checking for SSH connections.
174+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
175+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
171176
VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
172177
VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
173178
VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
@@ -362,6 +367,7 @@ jobs:
362367
env:
363368
TZ: Australia/Melbourne
364369
TERM: xterm-256color
370+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
365371
VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
366372

367373
steps:

.vortex/docs/content/workflows/variables.mdx

+16
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,14 @@ Default value: `UNDEFINED`
15691569

15701570
Defined in: `scripts/vortex/info.sh`
15711571

1572+
### `VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING`
1573+
1574+
Disable strict host key checking in SSH.
1575+
1576+
Default value: `0`
1577+
1578+
Defined in: `scripts/vortex/setup-ssh.sh`
1579+
15721580
### `VORTEX_SSH_FILE`
15731581

15741582
Default SSH key file.
@@ -1588,6 +1596,14 @@ Default value: `UNDEFINED`
15881596

15891597
Defined in: `scripts/vortex/setup-ssh.sh`
15901598

1599+
### `VORTEX_SSH_REMOVE_ALL_KEYS`
1600+
1601+
Remove all SSH keys from the SSH agent before loading the new one.
1602+
1603+
Default value: `0`
1604+
1605+
Defined in: `scripts/vortex/setup-ssh.sh`
1606+
15911607
### `VORTEX_TASK_COPY_DB_ACQUIA_DST`
15921608

15931609
Destination environment name to copy DB to.

.vortex/installer/tests/Fixtures/install/_baseline/.github/workflows/build-test-deploy.yml

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ jobs:
5555
env:
5656
TZ: Australia/Melbourne
5757
TERM: xterm-256color
58+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
59+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
5860
VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
5961
VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
6062
VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
@@ -159,6 +161,9 @@ jobs:
159161
env:
160162
TZ: Australia/Melbourne
161163
TERM: xterm-256color
164+
# Disable strict host key checking for SSH connections.
165+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
166+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
162167
VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
163168
VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
164169
VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
@@ -344,6 +349,7 @@ jobs:
344349
env:
345350
TZ: Australia/Melbourne
346351
TERM: xterm-256color
352+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
347353
VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
348354

349355
steps:

.vortex/installer/tests/Fixtures/install/ciprovider_circleci/.circleci/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ aliases:
5050
TZ: "Australia/Melbourne"
5151
# Set runner terminal capabilities.
5252
TERM: xterm-256color
53+
# Disable strict host key checking for SSH connections.
54+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
55+
# Remove all SSH keys from the runner container.
56+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
5357
# How often to refresh the cache of the DB dump. Refer to `date` command.
5458
VORTEX_CI_DB_CACHE_TIMESTAMP: +%Y%m%d
5559
# Use previous database caches on this branch as a fallback if the above cache

.vortex/installer/tests/Fixtures/install/deploy_type_all_circleci/.circleci/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ aliases:
5050
TZ: "Australia/Melbourne"
5151
# Set runner terminal capabilities.
5252
TERM: xterm-256color
53+
# Disable strict host key checking for SSH connections.
54+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
55+
# Remove all SSH keys from the runner container.
56+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
5357
# How often to refresh the cache of the DB dump. Refer to `date` command.
5458
VORTEX_CI_DB_CACHE_TIMESTAMP: +%Y%m%d
5559
# Use previous database caches on this branch as a fallback if the above cache

.vortex/installer/tests/Fixtures/install/deploy_type_none_circleci/.circleci/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ aliases:
5050
TZ: "Australia/Melbourne"
5151
# Set runner terminal capabilities.
5252
TERM: xterm-256color
53+
# Disable strict host key checking for SSH connections.
54+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
55+
# Remove all SSH keys from the runner container.
56+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
5357
# How often to refresh the cache of the DB dump. Refer to `date` command.
5458
VORTEX_CI_DB_CACHE_TIMESTAMP: +%Y%m%d
5559
# Use previous database caches on this branch as a fallback if the above cache

.vortex/installer/tests/Fixtures/install/deploy_type_none_gha/.github/workflows/build-test-deploy.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -334,58 +334,3 @@
1+
@@ -339,59 +339,3 @@
22
with:
33
detached: true
44

@@ -12,6 +12,7 @@
1212
- env:
1313
- TZ: Australia/Melbourne
1414
- TERM: xterm-256color
15+
- VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
1516
- VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
1617
-
1718
- steps:

.vortex/installer/tests/Fixtures/install/deps_updates_provider_ci_circleci/.circleci/config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ aliases:
5050
TZ: "Australia/Melbourne"
5151
# Set runner terminal capabilities.
5252
TERM: xterm-256color
53+
# Disable strict host key checking for SSH connections.
54+
VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
55+
# Remove all SSH keys from the runner container.
56+
VORTEX_SSH_REMOVE_ALL_KEYS: "1"
5357
# How often to refresh the cache of the DB dump. Refer to `date` command.
5458
VORTEX_CI_DB_CACHE_TIMESTAMP: +%Y%m%d
5559
# Use previous database caches on this branch as a fallback if the above cache

.vortex/installer/tests/Fixtures/install/provision_profile/.github/workflows/build-test-deploy.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
defaults:
99
run:
10-
@@ -46,107 +44,10 @@
10+
@@ -46,109 +44,10 @@
1111
shell: bash
1212

1313
jobs:
@@ -20,6 +20,8 @@
2020
- env:
2121
- TZ: Australia/Melbourne
2222
- TERM: xterm-256color
23+
- VORTEX_SSH_DISABLE_STRICT_HOST_KEY_CHECKING: "1"
24+
- VORTEX_SSH_REMOVE_ALL_KEYS: "1"
2325
- VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
2426
- VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
2527
- VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
@@ -115,7 +117,7 @@
115117

116118
strategy:
117119
matrix:
118-
@@ -162,14 +63,6 @@
120+
@@ -167,14 +66,6 @@
119121
VORTEX_CONTAINER_REGISTRY_USER: ${{ secrets.VORTEX_CONTAINER_REGISTRY_USER }}
120122
VORTEX_CONTAINER_REGISTRY_PASS: ${{ secrets.VORTEX_CONTAINER_REGISTRY_PASS }}
121123
VORTEX_DEBUG: ${{ vars.VORTEX_DEBUG }}
@@ -130,7 +132,7 @@
130132

131133
steps:
132134
- name: Preserve $HOME set in the container
133-
@@ -185,29 +78,6 @@
135+
@@ -190,29 +81,6 @@
134136
run: composer validate --strict
135137
continue-on-error: ${{ vars.VORTEX_CI_COMPOSER_VALIDATE_IGNORE_FAILURE == '1' }}
136138

@@ -160,7 +162,7 @@
160162
- name: Login to container registry
161163
run: ./scripts/vortex/login-container-registry.sh
162164

163-
@@ -337,7 +207,6 @@
165+
@@ -342,7 +210,6 @@
164166
deploy:
165167
runs-on: ubuntu-latest
166168
needs: build

.vortex/installer/tests/Fixtures/install/theme_absent/.github/workflows/build-test-deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -262,10 +262,6 @@
1+
@@ -267,10 +267,6 @@
22
run: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features
33
continue-on-error: ${{ vars.VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE == '1' }}
44

.vortex/tests/bats/_helper.bash

+3-3
Original file line numberDiff line numberDiff line change
@@ -1437,11 +1437,11 @@ setup_ssh_key_fixture() {
14371437
}
14381438

14391439
provision_default_ssh_key() {
1440-
ssh-keygen -t rsa -b 4096 -N "" -f "${SSH_KEY_FIXTURE_DIR}/id_rsa" >/dev/null
1441-
ssh-keygen -t rsa -b 4096 -N "" -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_TEST" >/dev/null
1440+
ssh-keygen -t rsa -b 4096 -C "" -N "" -f "${SSH_KEY_FIXTURE_DIR}/id_rsa" >/dev/null
1441+
ssh-keygen -t rsa -b 4096 -C "" -N "" -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_TEST" >/dev/null
14421442
}
14431443

14441444
provision_ssh_key_with_suffix() {
14451445
local suffix="${1:-TEST}"
1446-
ssh-keygen -t rsa -b 4096 -N "" -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" >/dev/null
1446+
ssh-keygen -t rsa -b 4096 -C "" -N "" -f "${SSH_KEY_FIXTURE_DIR}/id_rsa_${suffix}" >/dev/null
14471447
}

0 commit comments

Comments
 (0)