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 Oct 6, 2023
1 parent 03a5635 commit bd4db35
Show file tree
Hide file tree
Showing 5 changed files with 81 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
46 changes: 46 additions & 0 deletions pipelines/candlepin/02-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
- name: Setup git repo
become: True
hosts:
- "{{ forklift_name }}"
vars_files:
- ../vars/forklift_candlepin.yml
tasks:
- 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:
name:
- ruby
- ruby-devel
- rubygem-bundler
- gcc-c++
- make
- redhat-rpm-config
state: installed

- name: Clone puppet-candlepin
ansible.builtin.git:
repo: https://github.com/theforeman/puppet-candlepin.git
dest: /src/puppet-candlepin

- name: Bundle install
command: bundle install
args:
chdir: /src/puppet-candlepin
16 changes: 16 additions & 0 deletions pipelines/candlepin/03-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- 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}
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} }}"

0 comments on commit bd4db35

Please sign in to comment.