12345678910111213141516171819202122 |
- #!/bin/bash
- #git_url="ssh://git@git.sdsys.ru:8022/iru/openvpn-pki.git"
- #git_dir_pki="openvpn-pki"
- JENKINS_MAIL="jenkins.dev@sdsys.ru"
- cd /
- GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git clone ${git_url}
- cd /${git_dir} && git checkout $2
- cname=$(echo $1|tr '[:upper:]' '[:lower:]')
- stonevpn -f ${cname} -n "${cname}" -z
- if [ $? != 0 ];then exit 1;fi
- echo "Generate new key and cert for $1" > /tmp/commit.txt
- cd /${git_dir}
- git add -A
- git config --global user.email "${JENKINS_MAIL}"
- git config --global user.name "Jenkins"
- git commit -F /tmp/commit.txt
- GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git push origin $2
|