Commit 0466b323 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

CI: add before_script to manage ssh key. Modified script to remove lines from udev rule.

parent 79a0425b
Pipeline #4049 failed with stages
in 2 minutes and 53 seconds
image: docker.io/alopeziri/labrobotica
before_script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -p 2202 gitlab.iri.upc.edu >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- ssh -p 2202 git@gitlab.iri.upc.edu #test
stages:
- build
......@@ -30,3 +40,5 @@
- "ssh irilabo@147.83.76.226 -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh battery-monitor"
only:
- tags
\ No newline at end of file
......@@ -34,8 +34,10 @@ echo "Undo addition of udev rule so VENDOR:PRODUCT:SERIAL=${VENDOR}:${PRODUCT}:$
echo "Removing all lines containing SERIAL=${SERIAL} from file: ${FILE}"
LINE0=${SERIAL}
sudo sed -i "/${LINE0}/d" $FILE
sed -i -E "/idVendor.*$VENDOR.*idProduct.*$PRODUCT.*serial.*$SERIAL.*MODE.*0666\"/d" $FILE
sed -i -E "/idVendor.*$VENDOR.*idProduct.*$PRODUCT.*serial.*$SERIAL.*RUN.*ftdi_sio\/unbind/d" $FILE
sudo service udev restart
echo "Need to unplug-plug devices for changes to take effect"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment