jenkins - Losing connection during continuous integration -
i'm using digitalocean droplets continuous integration.
every time pushes on our github repository, droplet created. jenkins (on separated droplet) connects through ssh newly created droplet , launch shell script build , test project.
github changes -> jenkins (on droplet a) -> build/tests (on new droplet x)
github changes -> jenkins (on droplet a) -> build/tests (on new droplet y)
github changes -> jenkins (on droplet a) -> build/tests (on new droplet z)
the problem randomly, newly created droplet losing connection whatever tried connect during build. example, 2/10 droplets same content fail during "git pull" command message :
"ssh: connect host github.com port 22: connection timed out"
or
"[composerdownloadertransportexception] "https://api.github.com/repos/symfony/symfony/zipball/d3646cc6875c214d211001e0673ec9e91b5f2da7" file not downloaded: failed open stream: connection timed out "
there no iptables rules , ufw not enabled on droplets. randomly block connection services ?
any suggestions ?
[edit]
to clarify
- it happened randomly during build, first 'git clone' command succeed 'git clone' failed 2 minutes after.
i facing same kind of issues git repos. created script try maximum 5 times if git command fails.
below script git_retry.
example:
git_retry clone <clone_url>
script:
#!/bin/bash max_retry_counter=5 retry_sleep=10 try_number=0 while ! git $@ if try_number=`expr $try_number + 1` && [ "$try_number" -lt $max_retry_counter ]; echo "warning: issue during git operation. try $try_number. retrying in $retry_sleep seconds..." sleep $retry_sleep echo else echo "error: issue during git operation. try $try_number..." echo exit 1 fi done
Comments
Post a Comment