Skip to content

Commit

Permalink
Testing WPCloud on a new test site for jetpackisbestpack.
Browse files Browse the repository at this point in the history
  • Loading branch information
zinigor committed Oct 7, 2024
1 parent 2ab2c4a commit 0d40db9
Showing 1 changed file with 8 additions and 35 deletions.
43 changes: 8 additions & 35 deletions .github/workflows/wpcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,42 +54,18 @@ jobs:
chmod -v 700 ~/.ssh
touch ~/.ssh/id_site
touch ~/.ssh/known_hosts
chmod 600 ~/.ssh/id_site
echo "$WPCLOUD_SSH_KEY" > ~/.ssh/id_site
chmod 600 ~/.ssh/known_hosts
echo "$SSH_KEY" > ~/.ssh/id_site
echo "wrote ~/.ssh/id_site"
touch ~/.ssh/askpass
chmod -v 700 ~/.ssh/askpass
cat >>~/.ssh/askpass <<END
#!/bin/bash
echo "\$WPCLOUD_SSH_KEY_PASSPHRASE"
END
echo "wrote ~/.ssh/askpass"
cat >>~/.ssh/config <<END
Host *
StrictHostKeyChecking no
END
echo "wrote ~/.ssh/config"
touch ~/.ssh/stdin
chmod -v 600 ~/.ssh/stdin
cat >>~/.ssh/stdin <<END
$WPCLOUD_STDIN
END
echo "wrote ~/.ssh/stdin"
export SSH_ASKPASS="$HOME/.ssh/askpass"
echo "exported SSH_ASKPASS"
export SSH_ASKPASS_REQUIRE="force"
echo "exported SSH_ASKPASS_REQUIRE"
export DISPLAY=":"
echo "exported DISPLAY"
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
echo "wrote ~/.ssh/known_hosts"
echo "::endgroup::"
echo "::group::execution"
cat ~/.ssh/stdin | setsid ssh -i ~/.ssh/id_site -l "$WPCLOUD_SSH_USER" ssh.atomicsites.net "$WPCLOUD_SSH_COMMAND" || CODE=$?
ssh -i ~/.ssh/id_site [email protected] "ls" || CODE=$?
echo "::endgroup::"
echo "::group::teardown"
Expand All @@ -98,8 +74,5 @@ jobs:
echo "Exiting with exit code $CODE"
exit $CODE
env:
WPCLOUD_SSH_KEY: ${{ secrets.WPCLOUD_SSH_KEY }}
WPCLOUD_SSH_KEY_PASSPHRASE: ${{ secrets.WPCLOUD_SSH_KEY_PASSPHRASE }}
WPCLOUD_SSH_USER: ${{ secrets.WPCLOUD_SSH_USER }}
WPCLOUD_SSH_COMMAND: ${{ secrets.WPCLOUD_SSH_COMMAND }}
WPCLOUD_STDIN: ${{ toJSON(github) }}
SSH_KEY: ${{ secrets.UPDATEJETPACKSTAGING_SSH_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.UPDATEJETPACKSTAGING_SSH_KNOWN_HOSTS }}

0 comments on commit 0d40db9

Please sign in to comment.