Click the credential again and click update. Copy the ID.
Configuring Jenkins variables
Goto http://<jenkins_domain>/configure
Navigate to Environment Variables section and add the following
ANSIBLE_FORCE_COLOR = true
ANSIBLE_HOST_KEY_CHECKING = false
ANSIBLE_STDOUT_CALLBACK = debug
hub_org = < docker hub organization eg: In sunbird/player image, sunbird is the hub_org>
private_repo_branch = < private repo branch where ansible hosts exist >
private_repo_credentials = <id created in step 10>
private_repo_url = < Github private repo url >
public_repo_branch = jenkins-pipeline
Go to Pipeline libraries section and add the following
Name: deploy-conf
Version: jenkins-shared
Modern SCM -> Git
Repo: https://github.com/project-sunbird/sunbird-devops.git
Go to Mangaer Jenkins - > global security section and add the following
Markup Formatter: Safe HTML
Goto http://<jenkins_domain>/computer and click master → configure → add the following
executors: 10
Labels: build-slave
Restart Jenkins
http://<jenkins_daomain>/reload
Notes
Building maven projects may take time as it have to download lots of dependencies.
To speed up the process, download the .m2 folder from Azure blob and keep it in /var/lib/jenkins/.m2
Bootstrap User
Create directory /run/secrets as root using mkdir -p /run/secrets
Copy the master user ssh-key (the one through which you can login to VM or which was generated while creating the VMs; In our case it was as named as ops user) to /run/secrets/ops_ssh_key
Keep the private key for deployer user in /run/secrets/deployer_ssh_key and chown jenkins:jenkins /run/secrets/deployer_ssh_key
Optional: Keep ansible vault password in /run/secrets/vault-pass if the secrets.yml is encrypted and chown jenkins:jenkins /run/secrets/vault-pass
Run OpsAdministration/<module>/Core/Bootstrap This will create deployer user(defined in ansible) with ssh_key(public_key defined in common.yml) which will be used for all jenkins jobs.