Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Making Cinch call external to linchpin since this was causing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypoulz committed Aug 27, 2018
1 parent 9c942f7 commit 8317775
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 39 deletions.
50 changes: 12 additions & 38 deletions src/com/redhat/multiarch/ci/provisioner/Provisioner.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ class Provisioner {
awk '/\\[master_node\\]/{getline; print}' ${host.inventory}
""").trim()

// Let's examine this inventory file
script.sh("cat ${host.inventory}")
script.echo(getExtraVars(host))
script.sh("""
. /home/jenkins/envs/provisioner/bin/activate
cinch ${host.inventory} --extra-vars='${getExtraVars(host)}'
""")

host.provisioned = true

if (config.runOnSlave) {
script.sh("""
. /home/jenkins/envs/provisioner/bin/activate
cinch ${host.inventory} --extra-vars='${getExtraVars(host)}'
""")
host.connectedToMaster = true

// We only care if the install ansible flag is set when we are running on the provisioned host
Expand Down Expand Up @@ -154,36 +150,14 @@ class Provisioner {
}

String getTemplateData(Host host) {
script.withCredentials([
script.usernamePassword(credentialsId: config.jenkinsSlaveCredentialId,
usernameVariable: 'JENKINS_SLAVE_USERNAME',
passwordVariable: 'JENKINS_SLAVE_PASSWORD')
]) {
// Build template data
def templateData = [:]
templateData.arch = host.arch
templateData.job_group = config.jobgroup
templateData.hostrequires = config.hostrequires
templateData.hooks = [postUp: [connectToMaster: config.runOnSlave]]
templateData.extra_vars = [
"rpm_key_imports":[],
"jenkins_master_repositories":[],
"jenkins_master_download_repositories":[],
"jslave_name":"${host.name}",
"jslave_label":"${host.name}",
"arch":"${host.arch}",
"jenkins_master_url":"${config.jenkinsMasterUrl}",
"jenkins_slave_username":"${script.JENKINS_SLAVE_USERNAME}",
"jenkins_slave_password":"${script.JENKINS_SLAVE_PASSWORD}",
"jswarm_version":"3.9",
"jswarm_filename":"swarm-client-{{ jswarm_version }}.jar",
"jswarm_extra_args":"${config.jswarmExtraArgs}",
"jenkins_slave_repositories":[["name":"epel","mirrorlist":"https://mirrors.fedoraproject.org/metalink?arch=\$basearch&repo=epel-7"]]
]

def templateDataJson = JsonOutput.toJson(templateData)
templateDataJson
}
// Build template data
def templateData = [:]
templateData.arch = host.arch
templateData.job_group = config.jobgroup
templateData.hostrequires = config.hostrequires

def templateDataJson = JsonOutput.toJson(templateData)
templateDataJson
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ProvisioningConfig {
// Provisioning repo url
String provisioningRepoUrl = 'https://github.com/RedHat-MultiArch-QE/multiarch-ci-test-template'
// Provisioning repo ref
String provisioningRepoRef = 'master'
String provisioningRepoRef = this.version
// Provisioning workspace location (needed for Linchpin)
// This can reference a relative path in the above repo
// or it can reference a relative path that already exists
Expand Down

0 comments on commit 8317775

Please sign in to comment.