From 057bdaf89570575c128ec335d013c13d5525ed7e Mon Sep 17 00:00:00 2001 From: AlinsRan Date: Tue, 30 Jan 2024 18:31:21 +0800 Subject: [PATCH] set ssh --- .github/workflows/publish-arm.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-arm.yml b/.github/workflows/publish-arm.yml index 1f6c4c07d..81d16ca26 100644 --- a/.github/workflows/publish-arm.yml +++ b/.github/workflows/publish-arm.yml @@ -1,4 +1,4 @@ -name: Build and Publish RPM Package +name: Build and Publish RPM Package ARM on: push: @@ -59,6 +59,8 @@ jobs: wget https://raw.githubusercontent.com/apache/apisix/${APISIX_TAG_VERSION}/.requirements source .requirements + exit 1 + # build apisix make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=7 make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=8 @@ -204,3 +206,28 @@ jobs: sudo -E ./utils/publish-rpm.sh repo_repodata_rebuild sudo -E ./utils/publish-rpm.sh repo_upload + - name: Start SSH via Ngrok + if: ${{ failure() }} + run: | + echo "### Install ngrok ###" + wget -q https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm64.tgz + sudo tar -xvzf ./ngrok-v3-stable-linux-arm64.tgz -C /usr/local/bin + + echo "### Update user: $USER password ###" + echo -e "$USER_PASS\n$USER_PASS" | sudo passwd "$USER" + + echo "### Start ngrok proxy for 22 port ###" + rm -f .ngrok.log + ngrok config add-authtoken 2bgGRKo9L8TwLcetZVr1q3vvk3a_7phTqpitr8EQsLiLXT81p + sudo ngrok config add-authtoken 2bgGRKo9L8TwLcetZVr1q3vvk3a_7phTqpitr8EQsLiLXT81p + sudo ngrok tcp 22 --log ".ngrok.log" > /dev/null & + + sleep 10 + + cat .ngrok.log + env: + USER_PASS: rong + + - name: Don't kill instace + if: ${{ failure() }} + run: sleep 1h \ No newline at end of file