-
Notifications
You must be signed in to change notification settings - Fork 54
/
recipe.yaml
65 lines (64 loc) · 1.79 KB
/
recipe.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
- name: This is a recipe for how to cook with ogr
hosts: all
vars:
project_dir: /src
with_testing: false
tasks:
- ansible.builtin.set_fact:
project_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
when: zuul is defined
- name: Install all packages needed to hack on ogr.
ansible.builtin.dnf:
name:
- make
- python3-flexmock
- python3-pip
- python3-setuptools
- git-core
- python3-setuptools_scm
- python3-wheel # for bdist_wheel
- python3-pytest
- python3-tox
become: true
- name: Install latest twine for sake of check command
ansible.builtin.pip:
name:
- twine # we need newest twine, b/c of the check command
- readme_renderer[md]
state: latest
become: true
- name: Install requre
ansible.builtin.pip:
name:
- git+https://github.com/packit/requre
state: latest
become: true
- name: Install dependencies for git APIs
ansible.builtin.dnf:
name:
- python3-requests
- python3-pygithub
- python3-gitlab
state: present
become: true
- name: stat {{ project_dir }}
ansible.builtin.stat:
path: "{{ project_dir }}"
tags:
- no-cache
register: src_path
- name: Assert project_dir is present
ansible.builtin.assert:
that:
- src_path.stat.isdir
# this requires to have sources mounted inside at /src
- name: Install ogr from {{ project_dir }}
ansible.builtin.pip:
name: "{{ project_dir }}"
become: true
- name: Run tests
ansible.builtin.command: tox
args:
chdir: "{{ project_dir }}"
when: with_testing