In a gitlab pipeline (gitlab-ci.yml), I am using SSHPASS to configure a linux based device through a temporary IP for automation purpose.
script:
- sshpass -p $TARGET_password ssh -o StrictHostKeyChecking=no $TARGET_username@$TARGET_IP 'bash -s' < $configfile
I am sending a script with a bunch of commands, the last one being configure the permanent IP. As soon as the script changes the IP, the job hangs and waits undefinitly for any return because it lost the session with the temporary IP.
Question:
- Is it possible to send the command that changes the IP and immediately disconnect not waiting for any return.
- Is there a gitlab-ci instruction to not wait for any return from 'script' section?
I know there is "on-success" and "on-failure" but these suppose wwe have a stdout or stderr retuen.