keygen.sh 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. git_url_pki="ssh://git@git.sdsys.ru:8022/iru/openvpn-pki.git"
  3. git_url_ovpn="ssh://git@git.sdsys.ru:8022/iru/openvpn.git"
  4. git_dir_pki="openvpn-pki"
  5. git_dir_ovpn="openvpn"
  6. JENKINS_MAIL="jenkins.dev@sdsys.ru"
  7. cd /
  8. GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git clone ${git_url_pki}
  9. GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git clone ${git_url_ovpn}
  10. stonevpn -f $1 -n "$1" -z
  11. echo "Generate new key and cert for $1" > /tmp/commit.txt
  12. cd ${git_dir_pki}
  13. git add -A
  14. git config --global user.email "${JENKINS_MAIL}"
  15. git config --global user.name "Jenkins"
  16. git commit -F /tmp/commit.txt
  17. GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push origin master
  18. #cd ${git_dir_ovpn}
  19. #git add -A
  20. #git config --global user.email "${JENKINS_MAIL}"
  21. #git config --global user.name "Jenkins"
  22. #git commit -F /tmp/commit.txt
  23. #GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push origin master