From 7008ad9cb7c1334ab43dc85b57b9f2b560b1dd19 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 12 Sep 2016 03:20:07 +0300 Subject: Add basic ci script with pyflakes. --- .gitlab-ci.yml | 32 ++++++++++++++++++++++++++++++++ ci/install.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100755 ci/install.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8e9f634 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,32 @@ +stages: + - test + - success + - failure + +pyflakes2: + stage: test + script: + - ./ci/install.sh python2.7 pyflakes + - pyflakes . + image: debian:unstable + +.pyflakes3: + stage: test + script: + - ./ci/install.sh python3 pyflakes3 + - pyflakes3 . + image: debian:unstable + +success: + stage: success + script: + - echo "do nothing" + image: debian:stable + when: on_success + +failure: + stage: failure + script: + - echo "do nothing" + image: debian:stable + when: on_failure diff --git a/ci/install.sh b/ci/install.sh new file mode 100755 index 0000000..409ff81 --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +function aptget_update { + apt-get update + if [ "$?" != 0 ]; then + sleep 1s + apt-get update + if [ "$?" != 0 ]; then + sleep 1s + apt-get update + fi + fi +} + +function aptget_install { + apt-get -y -qq install $* + if [ "$?" != 0 ]; then + sleep 1s + apt-get -y -qq install $* + if [ "$?" != 0 ]; then + sleep 2s + apt-get -y -qq install $* + fi + fi +} + +aptget_update +aptget_install $* -- cgit v1.2.3-70-g09d2