Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Update Jenkins to the latest version available (2.238 at time of writing):

sed -i "s/2.192/\"2.238\"/" vars.yaml

Install Jenkins using Ansible playbook:

./install_ansible.sh
pip install -U ansible
ansible-playbook site_jenkins.yaml --extra-vars "@vars.yaml" -vvv

Basic Jenkins configuration using admin/admin credentials:

mkdir -p ~/.config/jenkins_jobs
cat << EOF | tee ~/.config/jenkins_jobs/jenkins_jobs.ini
[job_builder]
ignore_cache=True
keep_descriptions=False
recursive=True
retain_anchors=True
update=jobs

[jenkins]
user=admin
password=admin
url=http://localhost:8080
EOF

Access the web UI and add the jenkins-ssh credentials to communicate with Gerrit:.
Quick link: http://localhost:8080/credentials/store/system/domain/_/newCredentials.

HereThere, create a new credential of Kind "SSH Username with private key":.
Set the following fields as such:

  • Kind: "Global (...)"
  • ID: "jenkins-ssh"
  • Username: USERNAME
  • Private key: here, paste the private key respective to the public key that has been uploaded for USERNAME at Gerrit.

Since this documentation is for ICN, ICN Jenkins devs/maintainers should contact the ICN team to get the current private key.

There is a A second private/public keypair is needed. This one is for accessing multiple the nodes in the Kubernetes cluster.
The private key should be placed where it can be accessed by Jenkins. Ideally a fresh keypair should be created at this point.
The following creates a new/fresh keypair for the root user:

ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa

Info: this is the key that will later be assigned to CLUSTER_SSH_KEY -> , i.e CLUSTER_SSH_KEY=/var/lib/jenkins/jenkins-rsa

Copy the private key of (~/.ssh/id_rsa) of the keypair just created to/as /var/lib/jenkins/jenkins-rsa. Additionally make jenkins Jenkins the owner of this key:

cp ~/.ssh/id_rsa /var/lib/jenkins/jenkins-rsa
chown jenkins:jenkins /var/lib/jenkins/jenkins-rsa

In this guide, this This keypair is also going to be re- used for accessing the Gerrit Akraino and ONAP repositories as non-CI privileged accounts (for basic operations such as cloning a repository).
As such, the public key ~/.ssh/id_rsa.pub) just generated should be uploaded to the Gerrit Akraino and ONAP accounts to be used.

Set Nexus login credentials in order to upload Bluval logs (replace USERNAME/PASSWORD)

echo "machine nexus.akraino.org login USERNAME password PASSWORD" | tee /var/lib/jenkins/.netrc

Also needed to upload Bluval logs is the lftools python3 package, install it:
pip3 install lftools

...