From 609d92d95f2c8d30babb26a8eb8403f458a66bcc Mon Sep 17 00:00:00 2001 From: ITQ Date: Sat, 1 Mar 2025 02:19:36 +0300 Subject: [PATCH] well --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5cbbefe..9f443af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,9 +62,10 @@ deploy: - apk add --no-cache openssh-client script: - mkdir -p ~/.ssh && chmod 700 ~/.ssh - - printf "%s" "$SSH_PRIVATE_KEY_BASE64" | base64 -d -i > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts + - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config && chmod 600 ~/.ssh/config + - echo "$SSH_PRIVATE_KEY_BASE64" | base64 -d > ~/.ssh/id_rsa && chmod 400 ~/.ssh/id_rsa + - ssh-agent sh -c "ssh-add ~/.ssh/id_rsa" + - ssh-keyscan -H "$SSH_HOST" - scp -C -r infrastructure/ compose.yaml "$SSH_ADDRESS":~/deploy/ - ssh "$SSH_ADDRESS" << 'EOF' set -e