|
| 1 | +Steps to implement after class certification Project. |
| 2 | + |
| 3 | +These are just suggestions to implement the project, you can use your own steps to execute the Certification project as per document provided by edureka. |
| 4 | + |
| 5 | +Steps that I suggest: |
| 6 | + |
| 7 | +Create 3 Linux/Ubuntu AWS instances |
| 8 | + |
| 9 | +Take 1 AWS instance and Install: |
| 10 | + |
| 11 | +GIT , JAVA, Maven, Jenkins & Ansible. |
| 12 | + |
| 13 | +making this machine as Ansible Controller Machine and Jenkins Master |
| 14 | + |
| 15 | +Consider the other 2 AWS machines as your Ansible Slaves. |
| 16 | + |
| 17 | +Steps to be executed in GIT: |
| 18 | + |
| 19 | +Create a Repository with following files: |
| 20 | + |
| 21 | +Playbook.yml |
| 22 | +inventory file |
| 23 | + |
| 24 | +************************* |
| 25 | + |
| 26 | +Inventory files: |
| 27 | +****************** |
| 28 | + |
| 29 | +Include private ip of both the Ansible slaves. |
| 30 | + |
| 31 | +Steps for creating a playbook: |
| 32 | +***************************** |
| 33 | +Write tasks in plabook for: |
| 34 | +Install docker on both slaves |
| 35 | +Start docker service |
| 36 | +Pull the image devopsedu/webapp given by edureka |
| 37 | +Run the image to create container, do port mapping to access the application from web |
| 38 | + |
| 39 | +If you want you can take the actaul code from git hub , build it using Jenkins(using ANT), create a docker file |
| 40 | +build an image , pusg the image to Docker hub. |
| 41 | + |
| 42 | + |
| 43 | +Steps in Jenkins: |
| 44 | + |
| 45 | +Create new job with pipeline template. |
| 46 | + |
| 47 | +Write code to create a piplelie with different stages: |
| 48 | + |
| 49 | +stage one -> clone the repo form git |
| 50 | +stage two -> Execute the playbook |
| 51 | + |
| 52 | +click on pipeline syntax |
| 53 | + |
| 54 | +Select step as ansible playbook : |
| 55 | + |
| 56 | +Ansible tool : myansible // will be there by default |
| 57 | + |
| 58 | +Playbook file path in workspace : playbook1.yml |
| 59 | +// filename of playbookfrom git |
| 60 | + |
| 61 | +Inventory file path in workspace: dev.inv |
| 62 | + |
| 63 | +SSH connection credentials : |
| 64 | + |
| 65 | +click on add-->jenkins |
| 66 | + |
| 67 | +select kind : SSH username with private key |
| 68 | + |
| 69 | +id: private-key |
| 70 | +Description: ansible |
| 71 | +Username: ec2-user |
| 72 | +privateKey : |
| 73 | + |
| 74 | +go to downloads folder.. go to the host pem key which is gittoday |
| 75 | +open it with notepad and copy the text |
| 76 | + |
| 77 | +go to jenkins |
| 78 | +click on add button and paste the text |
| 79 | + clcik on add key at bottom |
| 80 | + |
| 81 | +now at SSH connection credentials : select ec2-user from drop down |
| 82 | + |
| 83 | +Scroll down and check on |
| 84 | + Disable the host SSH key check |
| 85 | + |
| 86 | +Clcik on Generate pipeline script |
| 87 | + |
| 88 | +Copy the code and as to your pipeline script. |
| 89 | + |
| 90 | +Save and Build Now. |
| 91 | + |
| 92 | +PART 2: |
| 93 | + |
| 94 | +Once you run the application on the slaves |
| 95 | + |
| 96 | +Write selenium test cases for the deployed application and push the test cases in git repository. |
| 97 | + |
| 98 | +Go to jenkins master , create a job and run your test cases using maven surefire plugin. |
| 99 | + |
| 100 | +Thanks, |
| 101 | +Sonal |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
0 commit comments