Setup Jenkins
Last updated
Last updated
Jenkins is used to build, deploy and setup the infrastructure for Sunbird. Almost everything in Sunbird is automated using Jenkins pipelines which integrates with ansible and other tools.
SSH to the Jenkins server and enter the following commands -
Open Jenkins UI in a browser by visiting JENKINS_IP:8080
Enter the initial password and follow the on-screen instructions. Choose Install suggested plugin and create an admin user
Go to http://JENKINS_IP:8080/pluginManager/available -> Search for ‘Configuration as Code Plugin’ and install the plugin without restart.
Don’t run the following until above steps finished
Run the below commands on Jenkins server to install external plugins
Setup environment specific Jenkins jobs. Update the environment list as per your requirement in ascending order. For example, if you want to have dev, staging and production environments, follow the below instructions
Restart Jenkins
Configure Jenkins
Run the below commands on Jenkins server to establish connectivity between Jenkins to kubernetes cluster and servers -
Copy the contents of your server’s private key into /var/lib/jenkins/secrets/deployer_ssh_key
Copy the kubernetes config file contents into /var/lib/jenkins/secrets/k8s.yaml
Update /var/lib/jenkins/secrets/vault-pass
file with the ansible vault password which will be used to encrypt the ansible secrets file
Run sudo visudo
on jenkins server and add the below line -
Reboot the Jenkins VM (sudo reboot
)