Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repo url to rhcs.conf, use url in rhcs_ci.py #45

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions etc/rhcs.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[global]
restraint_jobs = pki-tests/restraint
rhcs9_build_repo = https://idm-qe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/RHCS9%20Build%20Repo/ws/myrepo_0.repo

[dogtag-cert-cli-fedora20-x86_64-bkr-2-runtest]
job_name = cert-cli.xml
Expand Down
22 changes: 22 additions & 0 deletions projects/rhcs_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ def existing_nodes():
my_nodes = existing_nodes.identify_nodes()
return my_nodes

def wget_repo(my_nodes, job_name):
"""Wget the brew build repo in all the existing nodes"""

global_config = ConfigParser.SafeConfigParser()
global_config.read("etc/global.conf")
username = global_config.get('global', 'username')
password = global_config.get('global', 'password')

rhcs_config = ConfigParser.RawConfigParser()
rhcs_config.read("etc/rhcs.conf")
repo_url = rhcs_config.get('global','rhcs9_build_repo')
get_repo = ("wget --no-check-certificate %s -O /etc/yum.repos.d/myrepo_0.repo" % repo_url)
for node in my_nodes:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(node, username=username,password=password)
common.util.log.info("Executing command %s" % get_repo)
stdin, stdout, stderr = ssh.exec_command(get_repo)
for line in stdout.read().splitlines():
common.util.log.info('host: %s: %s' % (node, line))

def restraint_setup():

""" Configures restraint on beaker nodes """
Expand Down Expand Up @@ -103,6 +124,7 @@ def beaker_run():
""" Calls restraint and provides the junit file """
job_name = get_workspace()
my_nodes = existing_nodes()
wget_repo_file = wget_repo(my_nodes, job_name)
restraint_inst = restraint_setup()
restraint_loc = restraint_location()

Expand Down