Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit d4e7601

Browse files
Merge pull request #62 from jpopelka/close-mr
Sync to dist-git MR when source-git MR has been closed or reopened Test on staging - seems to work OK Fixes #35 #47 Merge after packit/packit-service#1492 packit/ogr#714 (probably won't wait for it since it's blocked on Pagure) Reviewed-by: Tomas Tomecek <[email protected]> Reviewed-by: Jiri Popelka <None>
2 parents ae94d7c + dda5e43 commit d4e7601

11 files changed

+140
-146
lines changed

Makefile

+18-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
.PHONY: hardly test-image
55

66
BASE_IMAGE ?= quay.io/packit/packit-worker
7+
# true|false
8+
PULL_BASE_IMAGE ?= true
79
HARDLY_IMAGE ?= quay.io/packit/hardly:dev
810
TEST_IMAGE ?= hardly-tests
911
TEST_TARGET ?= ./tests/
@@ -14,16 +16,29 @@ COV_REPORT ?= term-missing
1416
COLOR ?= yes
1517
SOURCE_BRANCH ?= $(shell git branch --show-current)
1618

19+
# The 'hardly' image is built FROM quay.io/packit/packit-worker
20+
# which is pulled/updated before the build.
21+
# If you want to build from your local worker image,
22+
# i.e. don't want to pull the base image,
23+
# set PULL_BASE_IMAGE=false
1724
hardly: files/recipe-hardly.yaml files/install-deps.yaml
18-
$(CONTAINER_ENGINE) pull $(BASE_IMAGE)
19-
$(CONTAINER_ENGINE) build --rm -t $(HARDLY_IMAGE) -f files/Containerfile --build-arg SOURCE_BRANCH=$(SOURCE_BRANCH) .
25+
$(CONTAINER_ENGINE) build --rm \
26+
--pull=$(PULL_BASE_IMAGE) \
27+
-t $(HARDLY_IMAGE) \
28+
-f files/Containerfile \
29+
--build-arg SOURCE_BRANCH=$(SOURCE_BRANCH) \
30+
.
2031

2132
check:
2233
find . -name "*.pyc" -exec rm {} \;
2334
PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --color=$(COLOR) --verbose --showlocals --cov=hardly --cov-report=$(COV_REPORT) $(TEST_TARGET)
2435

2536
test-image: files/recipe-tests.yaml
26-
$(CONTAINER_ENGINE) build --rm -t $(TEST_IMAGE) -f files/Containerfile.tests --build-arg SOURCE_BRANCH=$(SOURCE_BRANCH) .
37+
$(CONTAINER_ENGINE) build --rm \
38+
-t $(TEST_IMAGE) \
39+
-f files/Containerfile.tests \
40+
--build-arg SOURCE_BRANCH=$(SOURCE_BRANCH) \
41+
.
2742

2843
check-in-container:
2944
@# don't use -ti here in CI, TTY is not allocated in zuul

files/install-deps.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
tasks:
1010
# - import_tasks: tasks/process-source-branch.yaml
1111
- name: Install all RPM/python packages needed to run hardly
12-
dnf:
12+
ansible.builtin.dnf:
1313
name:
1414
- centpkg
1515
- tig # for debugging, can be removed later

files/recipe-hardly.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
hosts: all
77
tasks:
88
- name: Rename run_worker.sh
9-
command: mv /usr/bin/run_worker.sh /usr/bin/run_worker_.sh
9+
ansible.builtin.command: mv /usr/bin/run_worker.sh /usr/bin/run_worker_.sh
1010
- name: Install our run_worker.sh
11-
copy:
11+
ansible.builtin.copy:
1212
src: run_worker.sh
1313
dest: /usr/bin/
1414
mode: 0777

files/recipe-tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
hosts: all
77
tasks:
88
- name: Install test RPM dependencies
9-
dnf:
9+
ansible.builtin.dnf:
1010
name:
1111
- python3-flexmock
1212
- python3-pytest

files/tasks/common.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Tasks common to all images
55

66
- name: make packit home dir
7-
file:
7+
ansible.builtin.file:
88
state: directory
99
path: "{{ home_path }}"
1010
mode: 0776

files/tasks/install-ogr-deps.yaml

-27
This file was deleted.

files/tasks/install-packit-deps.yaml

-42
This file was deleted.

files/tasks/process-source-branch.yaml

-20
This file was deleted.

files/zuul-tests.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
hosts: all
88
tasks:
99
- name: Install podman
10-
dnf:
10+
ansible.builtin.dnf:
1111
name:
1212
- podman
1313
state: present
1414
become: true
1515
# Fix the SELinux context for podman
1616
- name: Create ~/.local/share/
17-
file:
17+
ansible.builtin.file:
1818
path: ~/.local/share/
1919
state: directory
20-
recurse: yes
20+
recurse: true
2121
setype: data_home_t
2222
- name: Build test image
23-
command: "make test-image"
23+
ansible.builtin.command: "make test-image"
2424
args:
2525
chdir: "{{ zuul.project.src_dir }}"
2626
- name: Run tests within a container
27-
command: "make check-in-container"
27+
ansible.builtin.command: "make check-in-container"
2828
args:
2929
chdir: "{{ zuul.project.src_dir }}"
3030
environment:

0 commit comments

Comments
 (0)