start server into rescue and wait for it to come onlin
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
cbd5d76196
commit
91a9d19e9a
25
.drone.yml
25
.drone.yml
@ -8,21 +8,22 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- '[ -n "$SERVER_ID" ]'
|
- '[ -n "$SERVER_ID" ]'
|
||||||
|
|
||||||
- name: get hcloud
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- apk add -U curl
|
|
||||||
- curl -L https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz | tar zx
|
|
||||||
|
|
||||||
- name: hcloud
|
- name: hcloud
|
||||||
image: alpine
|
image: alpine
|
||||||
environment:
|
environment:
|
||||||
HCLOUD_TOKEN:
|
HCLOUD_TOKEN:
|
||||||
from_secret: hcloud_token
|
from_secret: hcloud_token
|
||||||
commands:
|
commands:
|
||||||
# - apk add openssh
|
- apk add -U openssh
|
||||||
- echo $SERVER_ID
|
- wget -O- https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz | tar zx
|
||||||
# - ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -q -N ''
|
- ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -q -N ''
|
||||||
# - ./hcloud ssh-key create --name drone --public-key-from-file /root/.ssh/id_ed25519.pub
|
- ./hcloud ssh-key create --name drone --public-key-from-file /root/.ssh/id_ed25519.pub
|
||||||
# - ./hcloud server list
|
- ./hcloud server enable-rescue $SERVER_ID --ssh-key drone
|
||||||
# - ./hcloud ssh-key delete drone
|
- ./hcloud server reset $SERVER_ID
|
||||||
|
- IP="$(hcloud server ip "$SERVER_ID")"
|
||||||
|
- until ping -c 1 "$IP"; do sleep 5; done
|
||||||
|
- until ssh-keyscan "$IP" > /root/.ssh/known_hosts; do sleep 5; done
|
||||||
|
- echo "ssh root@$IP \"\$@\"" > ssh
|
||||||
|
- chmod +x ssh
|
||||||
|
- ./ssh
|
||||||
|
- ./hcloud ssh-key delete drone
|
Loading…
x
Reference in New Issue
Block a user