Skip to content

Commit

Permalink
Parameterize SSHKEY Repository and keys for Ansible and pbench server…
Browse files Browse the repository at this point in the history
…. Fixes issue #72

updated description. Fixes issue #72
  • Loading branch information
piyushgupta1551 authored and chaitanyaenr committed Apr 30, 2020
1 parent 7a6f21d commit 1cfd764
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
28 changes: 22 additions & 6 deletions jjb/dynamic/scale-ci_baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
fi
# Re-enable logging
set -x
git clone https://${SSHKEY_TOKEN}@github.com/redhat-performance/perf-dept.git
export PUBLIC_KEY=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf.pub
export PRIVATE_KEY=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf
export PBENCH_SSH_PUBLIC_KEY_FILE=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf.pub
export PBENCH_SSH_PRIVATE_KEY_FILE=${WORKSPACE}/perf-dept/ssh_keys/id_rsa_perf
chmod 600 ${PRIVATE_KEY}
git clone https://${SSHKEY_TOKEN}@${SSHKEY_REPO}
if [ -f ${WORKSPACE}/${SSHKEY_REPOPATH_PUB} ] && [ -f ${WORKSPACE}/${SSHKEY_REPOPATH_PRIV} ]
then
export PUBLIC_KEY=${WORKSPACE}/${SSHKEY_REPOPATH_PUB}
export PRIVATE_KEY=${WORKSPACE}/${SSHKEY_REPOPATH_PRIV}
export PBENCH_SSH_PUBLIC_KEY_FILE=${WORKSPACE}/${SSHKEY_REPOPATH_PUB}
export PBENCH_SSH_PRIVATE_KEY_FILE=${WORKSPACE}/${SSHKEY_REPOPATH_PRIV}
chmod 600 ${PRIVATE_KEY}
fi
# Create inventory File:
echo "[orchestration]" > inventory
Expand Down Expand Up @@ -137,6 +140,19 @@
description: 'Duration to run'
name: BASELINE_WORKLOAD_DURATION
trim: 'false'
- string:
default: "github.com/redhat-performance/perf-dept.git"
description: 'Repository containing ssh keys for Ansible and pbench server'
name: SSHKEY_REPO
- string:
default: "perf-dept/ssh_keys/id_rsa_perf.pub"
description: 'path to public key file in ssh key repository'
name: SSHKEY_REPOPATH_PUB
- string:
default: "perf-dept/ssh_keys/id_rsa_perf"
description: 'path to private key file in ssh key repository'
name: SSHKEY_REPOPATH_PRIV

project-type: freestyle
properties:
- raw:
Expand Down
6 changes: 6 additions & 0 deletions pipeline-scripts/baseline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ stage ('baseline_scale_test') {
def cluster_password = baseline_properties['CLUSTER_PASSWORD']
def cluster_api_url = baseline_properties['CLUSTER_API_URL']
def sshkey_token = baseline_properties['SSHKEY_TOKEN']
def sshkey_repo = baseline_properties['SSHKEY_REPO']
def sshkey_repopath_pub = baseline_properties['SSHKEY_REPOPATH_PUB']
def sshkey_repopath_priv = baseline_properties['SSHKEY_REPOPATH_PRIV']
def orchestration_host = baseline_properties['ORCHESTRATION_HOST']
def orchestration_user = baseline_properties['ORCHESTRATION_USER']
def workload_image = baseline_properties['WORKLOAD_IMAGE']
Expand All @@ -49,6 +52,9 @@ stage ('baseline_scale_test') {
[$class: 'StringParameterValue', name: 'CLUSTER_PASSWORD', value: cluster_password ],
[$class: 'StringParameterValue', name: 'CLUSTER_API_URL', value: cluster_api_url ],
[$class: 'StringParameterValue', name: 'SSHKEY_TOKEN', value: sshkey_token ],
[$class: 'StringParameterValue', name: 'SSHKEY_REPO', value: sshkey_repo ],
[$class: 'StringParameterValue', name: 'SSHKEY_REPOPATH_PUB', value: sshkey_repopath_pub ],
[$class: 'StringParameterValue', name: 'SSHKEY_REPOPATH_PRIV', value: sshkey_repopath_priv ],
[$class: 'StringParameterValue', name: 'ORCHESTRATION_HOST', value: orchestration_host ],
[$class: 'StringParameterValue', name: 'ORCHESTRATION_USER', value: orchestration_user ],
[$class: 'StringParameterValue', name: 'WORKLOAD_IMAGE', value: workload_image ],
Expand Down
3 changes: 3 additions & 0 deletions properties-files/baseline.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ CLUSTER_USER=kubeadmin
CLUSTER_PASSWORD=
CLUSTER_API_URL=
SSHKEY_TOKEN=
SSHKEY_REPO=github.com/redhat-performance/perf-dept.git
SSHKEY_REPOPATH_PUB=perf-dept/ssh_keys/id_rsa_perf.pub
SSHKEY_REPOPATH_PRIV=perf-dept/ssh_keys/id_rsa_perf
ORCHESTRATION_HOST=localhost
ORCHESTRATION_USER=root
WORKLOAD_IMAGE=quay.io/openshift-scale/scale-ci-workload
Expand Down

0 comments on commit 1cfd764

Please sign in to comment.