]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-iscsi-config-flake8: removed use of docker 1090/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 24 Jul 2018 16:50:34 +0000 (12:50 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 24 Jul 2018 17:34:59 +0000 (13:34 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
ceph-iscsi-config-flake8/build/build [changed mode: 0755->0644]
ceph-iscsi-config-flake8/config/definitions/ceph-iscsi-config-flake8.yml

old mode 100755 (executable)
new mode 100644 (file)
index 2653643..426bc9d
@@ -1,56 +1,9 @@
 #!/bin/bash
 
-set -e
-set -x
+# the following two methods exist in scripts/build_utils.sh
+pkgs=( "tox" )
+install_python_packages "pkgs[@]"
 
-function generate_filelist(){
-   if [[ "$pull_request_id" -eq "" || "${ghprbCommentBody:-}" = "jenkins flake8 all" ]]
-   then
-       find . -name '*.py'
-   else
-       curl -XGET "https://api.github.com/repos/ceph/ceph-iscsi-config/pulls/$pull_request_id/files" |
-       jq '.[].filename' |  # just the files please
-       tr -d '"' |  # remove the quoting from JSON
-       grep ".py$" # just the python
-   fi
+cd "$WORKSPACE/ceph-iscsi-config"
 
-}
-
-function check(){
-    local file
-    while read -r filename; do
-        pushd "$(dirname "$filename")"
-        file=$(basename "$filename")
-        sudo docker run --rm -v "$workspace"/ceph-iscsi-config/tox.ini:/tox.ini -v "$(pwd)"/"$file":/"$file" eeacms/flake8 /"$file"
-        popd
-    done
-    return $?
-}
-
-function main() {
-    # install some of our dependencies if running on a jenkins slave
-    if [[ -n "$HUDSON_URL" ]]
-    then
-        sudo yum -y install epel-release
-        sudo yum -y install docker jq
-        sudo systemctl start docker
-        pull_request_id=${ghprbPullId:-$2}
-        workspace=${WORKSPACE:-$1}
-    else
-        if ! command -v docker || ! command -v jq
-        then
-            echo "docker or jq is/are missing, install it/them"
-            exit 1
-        fi
-        pull_request_id=${ghprbPullId:-$2}
-        workspace=${WORKSPACE:-$1}
-    fi
-
-
-    pushd "$workspace/ceph-iscsi-config"
-    generate_filelist | check
-    popd
-    exit $?
-}
-
-main "$@"
+$VENV/tox -rv -e flake8
index 0185d355873b1913956fad4ac23e3fa5ed6a590c..83ecb7d9767b663f1e3e119e59edca1518058660 100644 (file)
@@ -9,20 +9,27 @@
           browser: auto
           timeout: 20
           skip-tag: true
-          wipe-workspace: false
+          wipe-workspace: true
           basedir: "ceph-iscsi-config"
 
 - job:
     name: ceph-iscsi-config-flake8
-    node: small && centos7
+    description: Runs Flake8 tests for ceph-iscsi-config on each GitHub PR
+    project-type: freestyle
+    node: python3
+    block-downstream: false
+    block-upstream: false
     defaults: global
-    display-name: 'ceph-iscsi-config-flake8'
+    display-name: 'ceph-iscsi-config: Flake8'
+    quiet-period: 5
+    retry-count: 3
+
     properties:
       - build-discarder:
           days-to-keep: 15
           num-to-keep: 30
-          artifact-days-to-keep: -1
-          artifact-num-to-keep: -1
+          artifact-days-to-keep: 15
+          artifact-num-to-keep: 15
       - github:
           url: https://github.com/ceph/ceph-iscsi-config/
 
           github-hooks: true
           permit-all: true
           auto-close-on-fail: false
-          status-context: "Testing: flake8"
-          started-status: "Running: flake8"
-          success-status: "OK"
-          failure-status: "FAIL - please clean up for merge"
 
     scm:
       - ceph-iscsi-config
@@ -53,5 +56,5 @@
     builders:
       - shell:
           !include-raw:
+            - ../../../scripts/build_utils.sh
             - ../../build/build
-