Skip to content

Commit

Permalink
Add Molecule job for copy-containers
Browse files Browse the repository at this point in the history
It will help to test the copy-container golang binary
build process.

Depends-On: openstack-k8s-operators#999

Signed-off-by: Chandan Kumar <[email protected]>
  • Loading branch information
raukadah authored and openshift-merge-bot[bot] committed Jan 11, 2024
1 parent 4090cda commit e2803ac
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 0 deletions.
58 changes: 58 additions & 0 deletions roles/copy_container/molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


- name: Converge
hosts: all
tasks:
- name: Run copy-container role
ansible.builtin.include_role:
name: copy_container

- name: Deploy Local Registry
ansible.builtin.include_role:
name: registry_deploy

- name: Create copy-quay-config.yaml
vars:
_data: |
---
zuul_api: "https://review.rdoproject.org/zuul/api/"
pull_registry: "quay.rdoproject.org"
push_registry: "127.0.0.1:5001"
entries:
- name: "antelopecentos9"
release: "antelopecentos9"
job_name: "periodic-container-tcib-build-push-centos-9-antelope"
api_entry: "https://trunk.rdoproject.org/api-centos9-antelope"
from_namespace: "podified-antelope-centos9"
to_namespace: "podified-antelope-centos9"
ansible.builtin.copy:
dest: "/tmp/copy-quay-config.yaml"
content: "{{ _data }}"

- name: Copy containers from RDO quay to local registry
ansible.builtin.command:
cmd: >-
copy-quay --debug
--config /tmp/copy-quay-config.yaml
--release antelopecentos9 copy
args:
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/roles/copy_container/files/copy-quay"

- name: Curl local registry
ansible.builtin.uri:
url: http://localhost:5001
9 changes: 9 additions & 0 deletions roles/copy_container/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Mainly used to override the defaults set in .config/molecule/
# By default, it uses the "config_podman.yml" - in CI, it will use
# "config_local.yml".
log: true

provisioner:
name: ansible
log: true
21 changes: 21 additions & 0 deletions roles/copy_container/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


- name: Prepare
hosts: all
roles:
- role: test_deps
10 changes: 10 additions & 0 deletions zuul.d/molecule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@
parent: cifmw-molecule-base
vars:
TEST_RUN: cifmw_test_role
- job:
files:
- ^common-requirements.txt
- ^test-requirements.txt
- ^roles/copy_container/(?!meta|README).*
- ^ci/playbooks/molecule.*
name: cifmw-molecule-copy_container
parent: cifmw-molecule-base
vars:
TEST_RUN: copy_container
- job:
files:
- ^common-requirements.txt
Expand Down
1 change: 1 addition & 0 deletions zuul.d/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- cifmw-molecule-cifmw_cephadm
- cifmw-molecule-cifmw_create_admin
- cifmw-molecule-cifmw_test_role
- cifmw-molecule-copy_container
- cifmw-molecule-devscripts
- cifmw-molecule-discover_latest_image
- cifmw-molecule-dlrn_promote
Expand Down

0 comments on commit e2803ac

Please sign in to comment.