Skip to content

Commit

Permalink
Add Candlepin pipeline to run puppet-candlepin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Nov 29, 2023
1 parent d549673 commit e098f4e
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pipelines/candlepin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- import_playbook: candlepin/01-boxes.yml
- import_playbook: candlepin/02-install.yml
- import_playbook: candlepin/03-tests.yml
8 changes: 8 additions & 0 deletions pipelines/candlepin/01-boxes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: create vagrant boxes
hosts: localhost
become: False
vars_files:
- ../vars/forklift_candlepin.yml
roles:
- forklift
11 changes: 11 additions & 0 deletions pipelines/candlepin/02-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Setup git repo
become: True
hosts:
- "{{ forklift_name }}"
vars_files:
- ../vars/forklift_candlepin.yml
vars:
beaker_puppet_module: "puppet-candlepin"
roles:
- beaker
18 changes: 18 additions & 0 deletions pipelines/candlepin/03-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: run tests
become: True
hosts:
- "{{ forklift_name }}"
vars_files:
- ../vars/forklift_candlepin.yml
tasks:
- name: Run acceptance tests
command: bundle exec rake beaker
args:
chdir: /src/puppet-candlepin
environment:
BEAKER_HYPERVISOR: "docker"
BEAKER_provision: "yes"
BEAKER_setfile: "centos8-64{hostname=centos8-64.example.com}"
BEAKER_destroy: "no"
BEAKER_FACTER_CANDLEPIN_VERSION: "{{ pipeline_version }}"
8 changes: 8 additions & 0 deletions pipelines/vars/forklift_candlepin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
forklift_name: "pipe-candlepin-{{ pipeline_version }}-{{ pipeline_os }}"

server_box:
box: "{{ pipeline_os }}"
memory: 4680

forklift_boxes:
"{{ {forklift_name: server_box} }}"
39 changes: 39 additions & 0 deletions roles/beaker/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- name: Install podman-docker
package:
name: podman-docker
state: installed

- name: Start podman
service:
name: podman
state: started

- name: Install git
package:
name: git
state: installed

- name: Enable ruby 2.7 module
command: dnf module enable -y ruby:2.7

- name: Install Ruby
package:
state: installed
name:
- ruby
- ruby-devel
- rubygem-bundler
- gcc-c++
- make
- redhat-rpm-config

- name: Clone puppet module
ansible.builtin.git:
repo: "https://github.com/theforeman/{{ beaker_puppet_module }}.git"
dest: "/src/{{ beaker_puppet_module }}"

- name: Bundle install
command: bundle install
args:
chdir: "/src/{{ beaker_puppet_module }}"

0 comments on commit e098f4e

Please sign in to comment.