Edit .onedev-buildspec.yml
This commit is contained in:
@@ -9,8 +9,8 @@ jobs:
|
|||||||
interpreter:
|
interpreter:
|
||||||
type: DefaultInterpreter
|
type: DefaultInterpreter
|
||||||
commands: |
|
commands: |
|
||||||
# 1. Install SSH client in this temporary CI container
|
# 1. Install SSH client and IP routing tools
|
||||||
apt-get update && apt-get install -y openssh-client
|
apt-get update && apt-get install -y openssh-client iproute2
|
||||||
|
|
||||||
# 2. Setup the SSH key from OneDev secrets
|
# 2. Setup the SSH key from OneDev secrets
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
@@ -18,9 +18,12 @@ jobs:
|
|||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
echo "StrictHostKeyChecking no" > ~/.ssh/config
|
echo "StrictHostKeyChecking no" > ~/.ssh/config
|
||||||
|
|
||||||
# 3. SSH into the host machine to execute the deployment
|
# 3. Dynamically find the Host machine's IP address
|
||||||
# Replace YOUR_HOST_LAN_IP with your machine's actual IP address (e.g. 192.168.1.50)
|
HOST_IP=$(ip route | awk '/default/ { print $3 }')
|
||||||
ssh adipu@@172.17.0.1 << 'EOF'
|
echo "==> Detected Host IP: $HOST_IP"
|
||||||
|
|
||||||
|
# 4. SSH into the host machine to execute the deployment
|
||||||
|
ssh adipu@@$HOST_IP << 'EOF'
|
||||||
set -e
|
set -e
|
||||||
echo "==> Navigating to project directory..."
|
echo "==> Navigating to project directory..."
|
||||||
cd ~/LabWise
|
cd ~/LabWise
|
||||||
|
|||||||
Reference in New Issue
Block a user