kind: pipeline type: docker name: hcloud steps: - name: check requirements image: alpine commands: - '[ -n "$SERVER_ID" ]' - name: archinstall image: alpine environment: HCLOUD_TOKEN: from_secret: hcloud_token commands: - apk add -U openssh - 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 '' - ./hcloud ssh-key create --name drone --public-key-from-file /root/.ssh/id_ed25519.pub - ./hcloud server enable-rescue $SERVER_ID --ssh-key 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