Merge "shake-build: add shake build system job"
This commit is contained in:
commit
5b194d277e
@ -7,5 +7,6 @@ General Purpose Jobs
|
||||
.. zuul:autojob:: markdownlint
|
||||
.. zuul:autojob:: multinode
|
||||
.. zuul:autojob:: run-test-command
|
||||
.. zuul:autojob:: shake-build
|
||||
.. zuul:autojob:: upload-git-mirror
|
||||
.. zuul:autojob:: validate-zone-db
|
||||
|
@ -18,6 +18,7 @@ General Purpose Roles
|
||||
.. zuul:autorole:: ensure-dhall
|
||||
.. zuul:autorole:: ensure-dstat-graph
|
||||
.. zuul:autorole:: ensure-markdownlint
|
||||
.. zuul:autorole:: ensure-shake
|
||||
.. zuul:autorole:: fetch-markdownlint
|
||||
.. zuul:autorole:: git-prepare-nodecache
|
||||
.. zuul:autorole:: log-inventory
|
||||
@ -38,6 +39,7 @@ General Purpose Roles
|
||||
.. zuul:autorole:: remove-zuul-sshkey
|
||||
.. zuul:autorole:: revoke-sudo
|
||||
.. zuul:autorole:: run-dstat
|
||||
.. zuul:autorole:: shake-build
|
||||
.. zuul:autorole:: sign-artifacts
|
||||
.. zuul:autorole:: stage-output
|
||||
.. zuul:autorole:: start-zuul-console
|
||||
|
3
playbooks/shake/pre.yaml
Normal file
3
playbooks/shake/pre.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- ensure-shake
|
3
playbooks/shake/run.yaml
Normal file
3
playbooks/shake/run.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- shake-build
|
3
roles/ensure-shake/README.rst
Normal file
3
roles/ensure-shake/README.rst
Normal file
@ -0,0 +1,3 @@
|
||||
Ensure shake is installed
|
||||
|
||||
Installs the shake tool using the distro package.
|
31
roles/ensure-shake/tasks/main.yaml
Normal file
31
roles/ensure-shake/tasks/main.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
- name: Make sure the role is run on supported distro
|
||||
fail:
|
||||
msg: |
|
||||
This role supports Fedora only,
|
||||
Add your distro package to: {{ opendev_url }}/roles/ensure-shake/vars/
|
||||
when: "ansible_distribution != 'Fedora'"
|
||||
vars:
|
||||
opendev_url: https://opendev.org/zuul/zuul-jobs/src/branch/master/
|
||||
|
||||
- name: Check shake version
|
||||
command: shake --version
|
||||
failed_when: false
|
||||
register: _shake_version
|
||||
|
||||
- block:
|
||||
- name: Include OS-specific variables
|
||||
include_vars: "{{ zj_distro_os }}"
|
||||
loop_control:
|
||||
loop_var: zj_distro_os
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.{{ ansible_architecture }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
|
||||
- name: Install shake
|
||||
package:
|
||||
name: "{{ shake_packages }}"
|
||||
state: present
|
||||
become: yes
|
||||
when: "_shake_version.rc != 0"
|
3
roles/ensure-shake/vars/RedHat.yaml
Normal file
3
roles/ensure-shake/vars/RedHat.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
shake_packages:
|
||||
- shake
|
||||
- ghc-shake-devel
|
13
roles/shake-build/README.rst
Normal file
13
roles/shake-build/README.rst
Normal file
@ -0,0 +1,13 @@
|
||||
Run the shake build system command.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: shake_report_name
|
||||
:default: shake.html
|
||||
|
||||
The name of the report.
|
||||
|
||||
.. zuul:rolevar:: zuul_work_dir
|
||||
:default: {{ zuul.project.src_dir }}
|
||||
|
||||
Directory to run the shake command in.
|
3
roles/shake-build/defaults/main.yaml
Normal file
3
roles/shake-build/defaults/main.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
shake_report_name: "shake.html"
|
||||
|
||||
zuul_work_dir: "{{ zuul.project.src_dir }}"
|
16
roles/shake-build/tasks/main.yaml
Normal file
16
roles/shake-build/tasks/main.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
- block:
|
||||
- name: Run shake
|
||||
command: "shake --report={{ report_location }}"
|
||||
vars:
|
||||
report_location: "{{ ansible_user_dir }}/zuul-output/logs/{{ shake_report_name }}"
|
||||
args:
|
||||
chdir: "{{ zuul_work_dir }}"
|
||||
|
||||
always:
|
||||
- name: Return report to Zuul
|
||||
zuul_return:
|
||||
data:
|
||||
zuul:
|
||||
artifacts:
|
||||
- name: "Shake report"
|
||||
url: "{{ shake_report_name }}"
|
19
test-playbooks/shake/setup-project.yaml
Normal file
19
test-playbooks/shake/setup-project.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Setup shakefile
|
||||
copy:
|
||||
dest: "{{ zuul.project.src_dir }}/Shakefile.hs"
|
||||
content: |
|
||||
import Development.Shake
|
||||
|
||||
-- This Shakefile creates synthetic load using sha256sum on each .rst file
|
||||
main :: IO ()
|
||||
main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
|
||||
want [ "doc" ]
|
||||
|
||||
phony "doc" $ do
|
||||
files <- getDirectoryFiles "" ["//*.rst"]
|
||||
putNormal $ "Processing doc... with: " <> show files
|
||||
need files
|
||||
|
||||
"//**.rst" %> \rst_file -> cmd_ "sha256sum " [rst_file]
|
@ -692,6 +692,22 @@
|
||||
- ^roles/upload-git-mirror/.*
|
||||
- ^test-playbooks/upload-git-mirror.yaml
|
||||
|
||||
- job:
|
||||
name: zuul-jobs-test-shake-build
|
||||
description: Test the shake build job and roles
|
||||
parent: shake-build
|
||||
files:
|
||||
- playbooks/shake/.*
|
||||
- roles/ensure-shake/.*
|
||||
- roles/shake-build/.*
|
||||
- test-playbooks/shake/.*
|
||||
pre-run:
|
||||
- test-playbooks/shake/setup-project.yaml
|
||||
nodeset:
|
||||
nodes:
|
||||
- name: fedora-31
|
||||
label: fedora-31
|
||||
|
||||
# -* AUTOGENERATED *-
|
||||
# The following project section is autogenerated by
|
||||
# tox -e update-test-platforms
|
||||
@ -746,6 +762,7 @@
|
||||
- zuul-jobs-test-generate-zuul-manifest
|
||||
- zuul-jobs-test-upload-artifactory
|
||||
- zuul-jobs-test-upload-git-mirror
|
||||
- zuul-jobs-test-shake-build
|
||||
gate:
|
||||
jobs:
|
||||
- zuul-jobs-test-add-authorized-keys
|
||||
@ -790,3 +807,4 @@
|
||||
- zuul-jobs-test-generate-zuul-manifest
|
||||
- zuul-jobs-test-upload-artifactory
|
||||
- zuul-jobs-test-upload-git-mirror
|
||||
- zuul-jobs-test-shake-build
|
||||
|
@ -119,3 +119,12 @@
|
||||
|
||||
pre-run: playbooks/dhall/prepare.yaml
|
||||
run: playbooks/dhall/diff.yaml
|
||||
|
||||
- job:
|
||||
name: shake-build
|
||||
description: |
|
||||
Run the shake build system command.
|
||||
|
||||
This job produces a shake.html report.
|
||||
pre-run: playbooks/shake/pre.yaml
|
||||
run: playbooks/shake/run.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user