Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Jenkins
Provision
- SSH to Jenkins server
git clone https://github.com/project-sunbird/sunbird-devops.git -b sunbird-bootcamp
cd sunbird-devops/deploy/jenkins
sudo bash jenkins-server-setup.sh ## This will install and setup Jenkins server
- After completion of the above script, open Jenkins in a browser by typing your domain name/Public IP:8080
- Enter the initial password and choose install suggested plugins.
- Create a admin user by filling all the details and choose the default Jenkins URL.
sudo bash jenkins-config-setup.sh ## This will configure build, provision and deployment jobs in jenkins as well as download m2 repo
Go to Manage Jenkins -> Manage Plugins -> Update Center -> Check restart after installation
- Create a jenkins vault password for private github account
- Goto
http://<jenkins_domain>/credentials/store/system/domain/_/newCredentials
- Select
username with password
- Give description as private repo and save
- Click the credential again and click update. Copy the ID.
- Goto
- Configuring Jenkins variables
- Goto
http://<jenkins_domain>/configure
Navigate to
Environment Variables section
and add the followingCode Block 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 8>10> private_repo_url = < Github private repo url > public_repo_branch = jenkins-pipeline
Go to
Pipeline libraries
section and add the followingCode Block 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 followingCode Block Markup Formatter: Safe HTML
Goto
http://<jenkins_domain>/computer and click master → configure → add the following
Code Block executors: 10 Labels: build-slave
- Goto
- Restart Jenkins
http://<jenkins_daomain>/reload
Info | ||
---|---|---|
| ||
Building maven projects may take time as it have to download lots of dependencies. To speed up the process, download the |
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
sudo chown jenkins:jenkins /run/secrets/ops_ssh_key && chmod 400 /run/secrets/*
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.
This page contains
Table of Contents |
---|