From c825ec243e728de26029850c2431e4e6559a3756 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 24 Jan 2017 22:24:09 +0300 Subject: Add .gitlab-ci.yml with check for script getsrc. --- .ci/retry.sh | 15 +++++++++++++++ .ci/run.sh | 4 ++++ .gitlab-ci.yml | 19 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100755 .ci/retry.sh create mode 100755 .ci/run.sh create mode 100644 .gitlab-ci.yml diff --git a/.ci/retry.sh b/.ci/retry.sh new file mode 100755 index 0000000..aaa50e9 --- /dev/null +++ b/.ci/retry.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +n=0 + +while true; do + $* + if [ "$?" == 0 ]; then + exit 0 + fi + if [[ $n -ge 10 ]]; then + exit -1 + fi + sleep 5s + n=$((n+1)) +done diff --git a/.ci/run.sh b/.ci/run.sh new file mode 100755 index 0000000..443611d --- /dev/null +++ b/.ci/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cd scripts +../.ci/retry.sh $* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..57148cc --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +stages: + - test + +before_script: + - uname -a + +.job-artifacts: &job-artifacts + artifacts: + paths: + - logs + when: always + expire_in: 3 week + +test:getsrc: + stage: test + script: + - ./.ci/run.sh ./getsrc.sh zlib + image: debian:unstable + <<: *job-artifacts -- cgit v1.2.3-70-g09d2