From c73e74586f6f9d3cecb849989b655a0c75b85c01 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Sun, 12 Apr 2026 19:06:08 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20.woodpecker.yaml=209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker.yaml | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index ea168ae..22aa2e1 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -7,9 +7,9 @@ steps: image: alpine environment: MY_HOST: - from_secret: prod_ssh_host + from_secret: PROD_SSH_HOST MY_USER: - from_secret: prod_ssh_user + from_secret: PROD_SSH_USER commands: - echo "HOST = $MY_HOST" - echo "USER = $MY_USER" @@ -24,13 +24,13 @@ steps: image: alpine environment: SSH_KEY: - from_secret: prod_ssh_key + from_secret: PROD_SSH_KEY SSH_HOST: - from_secret: prod_ssh_host + from_secret: PROD_SSH_HOST SSH_USER: - from_secret: prod_ssh_user + from_secret: PROD_SSH_USER REMOTE_PATH: - from_secret: remote_path + from_secret: REMOTE_PATH commands: - apk add --no-cache rsync openssh-client - mkdir -p ~/.ssh @@ -51,18 +51,25 @@ steps: $SSH_USER@$SSH_HOST:$REMOTE_PATH/wp-content/ - name: flush-cache - image: appleboy/drone-ssh + image: alpine environment: - SSH_HOST: - from_secret: prod_ssh_host - SSH_USERNAME: - from_secret: prod_ssh_user SSH_KEY: - from_secret: prod_ssh_key + from_secret: PROD_SSH_KEY + SSH_HOST: + from_secret: PROD_SSH_HOST + SSH_USER: + from_secret: PROD_SSH_USER REMOTE_PATH: - from_secret: remote_path - settings: - script: - - cd $REMOTE_PATH - - if command -v wp > /dev/null 2>&1; then wp cache flush; fi - - touch wp-config.php + from_secret: REMOTE_PATH + commands: + - apk add --no-cache openssh-client + - mkdir -p ~/.ssh + - echo "$SSH_KEY" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts + - | + ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST " + cd $REMOTE_PATH + if command -v wp > /dev/null 2>&1; then wp cache flush; fi + touch wp-config.php + "