{"id":718,"date":"2017-11-30T09:35:11","date_gmt":"2017-11-30T09:35:11","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=718"},"modified":"2020-01-09T08:09:18","modified_gmt":"2020-01-09T08:09:18","slug":"build-and-release-projects-b1","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/build-and-release-projects-b1\/","title":{"rendered":"Build And Release Projects &#8211; B1"},"content":{"rendered":"<p><strong>rajeshkumar created the topic: Build and Release Projects &#8211; B1<\/strong><br \/>\nProject1 (Shell Scripting)<br \/>\nWrite a script which can ask user to enter machinename\/hostname\/ipaddress and based on the entry do the following tasks.<br \/>\n1. Check if the machine name is valid or not, it its not valid, ask user to enter the machine name again. (Play with ping command)<br \/>\n2. if the machine name is valid, Print Name of the drives | total size | free size | used size ( Play with cut command)<br \/>\n3. Install jenkins and start the services<br \/>\n4. and send out an email to rajesh@scmgalaxy.com<\/p>\n<p>Project2 (Ant &amp; Git-Github)<br \/>\nWrite a Ant Script which will create a local repostory based on the user parameter passed(name of repos) and it should add numbers of files and commit.<br \/>\nthen it should set the required git config and push to the one particular git hub remote repos.<\/p>\n<p>Project3 (Maven)<br \/>\nWrite a 2 maven project and each one of these project will consist of three differnt projects<br \/>\n1. Java project<br \/>\n2. donet<br \/>\nNow write a master maven project and call above projects as a sub projects.<\/p>\n<p>Project4- Backup &amp; Restore<br \/>\nall the three projects should be live in 5 mins and I will destroyt these setup and you will restore it within 5 mins.<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>sribhavani_u replied the topic: Build and Release Projects &#8211; B1<\/strong><br \/>\nproject1<br \/>\n======<br \/>\n<code>#!\/bin\/bash<br \/>\n#script to ask user to enter machinename\/hostname\/ipaddress and check if they are valid or not<br \/>\njen_start()<br \/>\n{<br \/>\nwget -O \/etc\/yum.repos.d\/jenkins.repo pkg.jenkins-ci.org\/redhat-stable\/jenkins.repo<br \/>\nrpm --import jenkins-ci.org\/redhat\/jenkins-ci.org.key<br \/>\nyum install jenkins<br \/>\njava -version 1&gt;\/dev\/null 2&gt;\/dev\/null<br \/>\ni=$?<br \/>\nif [ $i -ne 0 ]; then<br \/>\nyum install java<br \/>\nelse<br \/>\nservice jenkins restart<br \/>\nchkconfig jenkins on<br \/>\nfi<br \/>\n}<br \/>\nwhile :<br \/>\ndo<br \/>\necho \"Please enter host you would like to ping(machinename\/hostname\/ipaddress):\"<br \/>\nread PING<br \/>\ncount=$( ping -c 1 $PING | grep icmp* | wc -l)<br \/>\nif [ $count -eq 0 ]<br \/>\nthen<br \/>\necho \"Given Host is invalid.give the valid host\"<br \/>\nelse<br \/>\necho \"Given host is valid\"<br \/>\ndf -Pk | awk ' { printf \"%30s %12s %12s %12s \\n\", $6, $2, $4, $3 } '<br \/>\necho \"starting jenkins server\"<br \/>\njen_start<br \/>\nservice jenkins status<br \/>\ni=$?<br \/>\nif [ $i -eq 0 ]; then<br \/>\necho \"jenkinsis up and running\" | mail sribhavani_u@yahoo.com<br \/>\nfi<br \/>\nexit<br \/>\nfi<br \/>\ndone<\/code><\/p>\n<p><strong>sribhavani_u replied the topic: Build and Release Projects &#8211; B1<\/strong><br \/>\nPROJECT#3<br \/>\n=========<\/p>\n<p>parent pom<br \/>\n<code><br \/>\n4.0.0<br \/>\ncom.sri<br \/>\nmyproject3<br \/>\njar<br \/>\n1.0-SNAPSHOT<br \/>\nmyproject3<\/code><\/p>\n<p>SampleApplication<br \/>\nwebapp<\/p>\n<p>maven.apache.org<\/p>\n<p>junit<br \/>\njunit<br \/>\n3.8.1<br \/>\ntest<\/p>\n<p>&nbsp;<\/p>\n<p>SampleApplication<br \/>\n<code><\/code><\/p>\n<p>myproject3<br \/>\ncom.sri<br \/>\n1.0-SNAPSHOT<br \/>\n4.0.0<br \/>\ncom.sri<br \/>\nSampleApplication<br \/>\njar<br \/>\n1.0-SNAPSHOT<br \/>\nSampleApplication<br \/>\nmaven.apache.org<\/p>\n<p>junit<br \/>\njunit<br \/>\n3.8.1<br \/>\ntest<\/p>\n<p>webapp<br \/>\n<code><\/code><\/p>\n<p>myproject3<br \/>\ncom.sri<br \/>\n1.0-SNAPSHOT<br \/>\n4.0.0<br \/>\ncom.sri<br \/>\nwebapp<br \/>\nwar<br \/>\n1.0-SNAPSHOT<br \/>\nwebapp Maven Webapp<br \/>\nmaven.apache.org<\/p>\n<p>junit<br \/>\njunit<br \/>\n3.8.1<br \/>\ntest<\/p>\n<p>webapp<\/p>\n<p>&nbsp;<\/p>\n<p><strong>navneet07 replied the topic: Build and Release Projects &#8211; B1<\/strong><br \/>\n<code>echo \"please enter ipaddress:\"<br \/>\nread ipaddress<br \/>\nif ping -c 1 $ipaddress &amp;&gt; \/dev\/null<br \/>\nthen<br \/>\necho \"Ip address is valid and Below is the filesystem of this machine $ipaddress \"<br \/>\ndf -h|cut -c1-43<br \/>\nelse<br \/>\necho \"Ip address is invalid,please enter the ip again:\"<br \/>\nread ipaddress<br \/>\necho \"New IP\" $ipaddress<br \/>\nfi<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>rajeshkumar created the topic: Build and Release Projects &#8211; B1 Project1 (Shell Scripting) Write a script which can ask user to enter machinename\/hostname\/ipaddress and based on the entry do the&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[49],"tags":[146],"class_list":["post-718","post","type-post","status-publish","format-standard","hentry","category-general","tag-build-and-release"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=718"}],"version-history":[{"count":5,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/718\/revisions"}],"predecessor-version":[{"id":759,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/718\/revisions\/759"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}