Jenkins Setup
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 -
Update the environment list as per your requirement in ascending order. For example, if you want to have dev, staging and production environments, your envOrder.txt will look like -
Run the below script on Jenkins server and provide input as required (case sensitive) -
Restart jenkins
Configure Jenkins
Run the below commands on Jenkins server -
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
If you have encrypted your
secrets.yml
usingansible-vault
, enter the password to decrypt into/var/lib/jenkins/secrets/vault-pass
. If you have not encrypted, then enter a random value like 12345Run
sudo visudo
on jenkins server and add the below line -
Reboot the Jenkins VM (
sudo reboot
)
Last updated