diff --git a/pipelines/candlepin.yml b/pipelines/candlepin.yml new file mode 100644 index 000000000..fcdcea316 --- /dev/null +++ b/pipelines/candlepin.yml @@ -0,0 +1,3 @@ +- import_playbook: candlepin/01-boxes.yml +- import_playbook: candlepin/02-install.yml +- import_playbook: candlepin/03-tests.yml diff --git a/pipelines/candlepin/01-boxes.yml b/pipelines/candlepin/01-boxes.yml new file mode 100644 index 000000000..2a2758787 --- /dev/null +++ b/pipelines/candlepin/01-boxes.yml @@ -0,0 +1,8 @@ +--- +- name: create vagrant boxes + hosts: localhost + become: False + vars_files: + - ../vars/forklift_candlepin.yml + roles: + - forklift diff --git a/pipelines/candlepin/02-install.yml b/pipelines/candlepin/02-install.yml new file mode 100644 index 000000000..600d8a980 --- /dev/null +++ b/pipelines/candlepin/02-install.yml @@ -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 diff --git a/pipelines/candlepin/03-tests.yml b/pipelines/candlepin/03-tests.yml new file mode 100644 index 000000000..b1bfdde29 --- /dev/null +++ b/pipelines/candlepin/03-tests.yml @@ -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 }}" diff --git a/pipelines/vars/forklift_candlepin.yml b/pipelines/vars/forklift_candlepin.yml new file mode 100644 index 000000000..df531f83e --- /dev/null +++ b/pipelines/vars/forklift_candlepin.yml @@ -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} }}"