]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
adds a new job to do syntax checks on ceph-ansible pull requests 524/head
authorAndrew Schoen <aschoen@redhat.com>
Tue, 25 Oct 2016 20:48:35 +0000 (15:48 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 25 Oct 2016 20:48:35 +0000 (15:48 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-ansible-pr-syntax-check/build/build [new file with mode: 0644]
ceph-ansible-pr-syntax-check/config/definitions/ceph-ansible-pr-syntax-check.yml [new file with mode: 0644]

diff --git a/ceph-ansible-pr-syntax-check/build/build b/ceph-ansible-pr-syntax-check/build/build
new file mode 100644 (file)
index 0000000..2dd70c8
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+
+# the following two methods exist in scripts/build_utils.sh
+pkgs=( "ansible")
+install_python_packages "pkgs[@]"
+
+cd $WORKSPACE/ceph-ansible
+
+$VENV/ansible-playbook -i '127.0.0.1,' site.yml.sample --syntax-check --list-tasks -vv
+$VENV/ansible-playbook -i '127.0.0.1,' site-docker.yml.sample --syntax-check --list-tasks -vv
+
+# move roles and group_vars into the
+# infrastructure-playbooks directory for easier syntax checking
+cp -r roles infrastructure-playbooks/
+cp -r group_vars infrastructure-playbooks/
+mv infrastructure-playbooks/all.sample infrastructure-playbooks/all
+
+$VENV/ansible-playbook -i '127.0.0.1,' infrastructure-playbooks/*.yml --syntax-check --list-tasks -vv
diff --git a/ceph-ansible-pr-syntax-check/config/definitions/ceph-ansible-pr-syntax-check.yml b/ceph-ansible-pr-syntax-check/config/definitions/ceph-ansible-pr-syntax-check.yml
new file mode 100644 (file)
index 0000000..b81fc39
--- /dev/null
@@ -0,0 +1,62 @@
+- scm:
+    name: ceph-ansible
+    scm:
+      - git:
+          url: https://github.com/ceph/ceph-ansible.git
+          branches:
+            - ${sha1}
+          refspec: +refs/pull/*:refs/remotes/origin/pr/*
+          browser: auto
+          timeout: 20
+          skip-tag: true
+          wipe-workspace: false
+          basedir: "ceph-ansible"
+
+- job:
+    name: ceph-ansible-pr-syntax-check
+    node: centos7 || trusty
+    project-type: freestyle
+    defaults: global
+    concurrent: true
+    display-name: 'ceph-ansible: Pull Requests Syntax Check'
+    quiet-period: 5
+    block-downstream: false
+    block-upstream: false
+    retry-count: 3
+    properties:
+      - github:
+          url: https://github.com/ceph/ceph-build
+    logrotate:
+      daysToKeep: 15
+      numToKeep: 30
+      artifactDaysToKeep: -1
+      artifactNumToKeep: -1
+
+    parameters:
+      - string:
+          name: sha1
+          description: "A pull request ID, like 'origin/pr/72/head'"
+
+    triggers:
+      - github-pull-request:
+          allow-whitelist-orgs-as-admins: true
+          org-list:
+            - ceph
+          trigger-phrase: ''
+          only-trigger-phrase: false
+          github-hooks: true
+          permit-all: true
+          auto-close-on-fail: false
+          status-context: "Testing Playbook Syntax"
+          started-status: "Running syntax checks on all playbooks"
+          success-status: "OK - checks completed"
+          failure-status: "Syntax check failed with errors"
+
+    scm:
+      - ceph-ansible
+
+    builders:
+      - shell:
+          !include-raw:
+            - ../../../scripts/build_utils.sh
+            - ../../build/build