diff --git a/.gitignore b/.gitignore
index 7a3e2fd..63fb63b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,8 @@
# Crash log files
crash.log
+
+
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
@@ -27,3 +29,34 @@ override.tf.json
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
+
+# Created by https://www.toptal.com/developers/gitignore/api/java
+# Edit at https://www.toptal.com/developers/gitignore?templates=java
+
+### Java ###
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+replay_pid*
+
+# End of https://www.toptal.com/developers/gitignore/api/java
diff --git a/.project b/.project
new file mode 100644
index 0000000..ded0d85
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+
+
+ my-app
+
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.m2e.core.maven2Nature
+
+
diff --git a/HelloWorld.class b/HelloWorld.class
new file mode 100644
index 0000000..57d2ca5
Binary files /dev/null and b/HelloWorld.class differ
diff --git a/HelloWorld.java b/HelloWorld.java
new file mode 100644
index 0000000..c204a95
--- /dev/null
+++ b/HelloWorld.java
@@ -0,0 +1,5 @@
+public class HelloWorld {
+ public static void main(String[] args) {
+ System.out.println("Hello, World From Varun Manik");
+ }
+}
diff --git a/README.md b/README.md
index a6b49c4..eb81aa1 100644
--- a/README.md
+++ b/README.md
@@ -1,87 +1,10 @@
-# Jenkins-cicd
-PG DO - CI/CD Pipeline with Jenkins Simplilearn
+# Java
-# AWS Ubuntu VM Provisioning steps
-- Step 1: Click on Launch Instance
-- Step 2 : Click on Software Image (AMI)
-- Select Ubuntu
-- Step 4: Key pair name – required
-- Click on Create new key pair
-- Put key pair name Jenkins-sl
-- & Download it
-- Step 5 : Click on Launch Instance
-- Step 6 : Select your VM and Click connect
-- Step 7 : You can see the terminal
-- Step: Showing Github example
+## Build
+## Simple Java command for linux terminal in Jenkins
-# Git Status
```
-git --version
-```
-## cretae Dir
-```
-mkdir demo
-cd demo
-```
-## GIT & Ubuntu SSH connection
-```
-ssh-keygen
-
-"Hit enter button 3 time"
-
-cat ~/.ssh/id_rsa.pub
-git clone git@github.com:manikcloud/Jenkins-cicd.git
-history
-history | cut -c 8-
-```
-
-# JENKINS INSTALLATION on UBUNTU 18.04, for Ubunt 22.04 please skip the step 3 & 4
-```
-sudo apt-get update
-sudo apt install openjdk-8-jdk
-sudo wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add
-sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
-sudo apt-get update
-sudo apt install jenkins
-sudo /etc/init.d/jenkins start
-service jenkins status
-sudo cat /var/lib/jenkins/secrets/initialAdminPassword
-history | cut -c 8-
-
-```
-# Jenkins URL with port 8080
-- http://x.x.x.x:8080/
-
-replace x with your ip
+javac HelloWorld.java
-# Change Security group rule for Jenkins
+java HelloWorld
```
-- Select your instance
-- Down below select your security tab
-- Click on the Security groups sg-0c51908b5fa4abf75 (launch-wizard-2)
-- Click on the action
-- Click on EDIT INBOUND RULE
-- Select custom TCP and put port 8080
-- Custom ip should be 0.0.0.0/0
-- Click on Save the rule
-```
-
-# common error
-
-```
-getting "E: Unable to locate package openjdk-8-jdk" message on java update
-```
-
-# Resolution
-Run this command
-
-```
-sudo apt update
-```
-# Plugin Installation
-dashboard>manage>jenkins>manage plugins>maven integration
-
-
-# References:
-1. https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
-2. https://maven.apache.org/download.cgi
diff --git a/history.txt b/history.txt
index 850e06e..f3ba590 100644
--- a/history.txt
+++ b/history.txt
@@ -1,170 +1,31 @@
- 1 clear
- 2 pwd
- 3 apt udate
- 4 apt update
- 5 sudo apt update
- 6 cat /etc/os-release
- 7 ping fb.com
- 8 mkdir demom
- 9 mkdir demo
- 10 cd demo
- 11 git
- 12 git -version
- 13 git --version
- 14 ls -a
- 15 ll -a
- 16 git init
- 17 ll -a
- 18 git status
- 19 vim index.html
- 20 git status
- 21 git add .
- 22 git status
- 23 git commit -am"first file"
- 24 git status
- 25 git log
- 26 vim index.html
- 27 cat index.html
- 28 git status
- 29 git add .
- 30 git status
- 31 git commit -am"first file 1"
- 32 git log
- 33 cd ..
- 34 ssh-keygen
- 35 cd ~/.ssh/
- 36 ll
- 37 cat id_rsa.pub
- 38 cd -
- 39 git clone git@github.com:manikcloud/Jenkins-cicd.git
- 40 cat ~/.ssh/id_rsa.pub
- 41 git clone git@github.com:manikcloud/Jenkins-cicd.git
- 42 history
- 43 history | cut -c 8-
- 44 cd Jenkins-cicd/
- 45 vim README.md
- 46 nano README.md
- 47 git status
- 48 git add . && git commit -am"adding readme" && git push
- 49 nano README.md
- 50 git add . && git commit -am"adding readme" && git push
- 51 ll ~/.ssh/
- 52 cat ~/.ssh/id_rsa.pub
- 53 ssh-keygen
- 54 ll ~/.ssh/
- 55 ll
- 56 rm varun *
- 57 rm varun*
- 58 ll
- 59 git pull
- 60 git status
- 61 git rm .
- 62 git status
- 63 git rm README.md
- 64 git status
- 65 git rm pom.xml
- 66 ll
- 67 git status
- 68 git restore --staged pom.xml
- 69 ll
- 70 cd ..
- 71 rm -rf Jenkins-cicd/
- 72 git clone git@github.com:manikcloud/Jenkins-cicd.git
- 73 cd Jenkins-cicd/
- 74 ll
- 75 vi index.html
- 76 git staus
- 77 git status
- 78 git add .
- 79 git status
- 80 git commit -am"adding index.html"
- 81 git push
- 82 vi README.md
- 83 git pull
- 84 vi README.md
- 85 sudo apt install openjdk-8-jdk
- 86 sudo wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add
- 87 sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
- 88 sudo apt-get update
- 89 sudo apt install jenkins
- 90 sudo /etc/init.d/jenkins start
- 91 service jenkins stgatus
- 92 service jenkins status
- 93 cat /var/lib/jenkins/secrets/initialAdminPassword
- 94 sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- 95 history | cut -c 8-
- 96 cd Jenkins-cicd/
- 97 vi README.md
- 98 git add . && git commit -am"adding jenkins installtion step in readme" && git push
- 99 vi README.md
- 100 git add . && git commit -am"adding jenkins installtion step in readme" && git push
- 101 git pull
- 102 vi README.md
- 103 ll -a
- 104 rm .README.md.swp
- 105 ll -a
- 106 vim README.md
- 107 git add . && git commit -am"adding jenkins installtion step in readme" && git push
- 108 vim README.md
- 109 git add . && git commit -am"adding jenkins installtion step in readme" && git push
- 110 sudo cat /var/lib/jenkins/secrets/initialAdminPassword
- 111 echo "varun"
- 112 vim README.md
- 113 git add . && git commit -am"adding jenkins installtion step in readme" && git push
- 114 git config --global --edit
- 115 git add . && git commit -am"adding jenkins installtion step in readme" && git push
- 116 git push
- 117 git pull
- 118 vim README.md
- 119 git add . && git commit -am"adding jenkins installtion step in readme" && git push
- 120 git pull
- 121 vim README.md
- 122 mvn --version
- 123 sudo apt install maven
- 124 apt install tree
- 125 sudo apt install tree
- 126 which mvn
- 127 mvn --version
- 128 cd ..
- 129 mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
- 130 ll
- 131 rm -rf my-app/
- 132 ll
- 133 mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
- 134 ll
- 135 cd my-app/
- 136 ll
- 137 tree
- 138 mvn ppackage
- 139 mvn package
- 140 ll
- 141 tree
- 142 ll
- 143 ll target/
- 144 java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
- 145 vim src/main/java/com/mycompany/app/App.java
- 146 java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
- 147 mvn clean install
- 148 java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
- 149 cd ..
- 150 ll
- 151 rm -rf Jenkins-cicd/
- 152 git clone git@github.com:manikcloud/Jenkins-cicd.git
- 153 cd Jenkins-cicd/
- 154 ll
- 155 whereis mvn
- 156 cd ..
- 157 wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
- 158 ll
- 159 tar -xvzf apache-maven-3.8.6-bin.tar.gz
- 160 ll
- 161 cd apache-maven-3.8.6/
- 162 ll
- 163 pwd
- 164 whereis java
- 165 whereis git
- 166 which git
- 167 which mvn
- 168 pwd
- 169 ll
- 170 history > ../Jenkins-cicd/history.txt
+1. JENKINS installation
+2. git integation with Jenkins
+3. java integration with Jenkins
+
+
+
+git clone https://github.com/manikcloud/Jenkins-cicd.git
+cd Jenkins-cicd/
+ll
+git switch create_ec2_tf
+chmod 755 jenkins-installation-ubuntu.sh
+sh jenkins-installation-ubuntu.sh
+
+cat jenkins-installation-ubuntu.sh
+sudo cat /var/lib/jenkins/secrets/initialAdminPassword
+
+
+sudo apt install maven
+mvn --version
+mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
+sudo apt install tree -y
+
+cd my-app/
+
+tree
+mvn install
+
+tree
+java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
+
+history | cut -c 8-
diff --git a/index.html b/index.html
deleted file mode 100644
index b14df64..0000000
--- a/index.html
+++ /dev/null
@@ -1 +0,0 @@
-Hi
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 8671f90..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
- 4.0.0
-
- com.mycompany.app
- my-app
- 1.0-SNAPSHOT
-
- my-app
-
- http://www.example.com
-
-
- UTF-8
- 1.7
- 1.7
-
-
-
-
- junit
- junit
- 4.11
- test
-
-
-
-
-
-
-
-
- maven-clean-plugin
- 3.1.0
-
-
-
- maven-resources-plugin
- 3.0.2
-
-
- maven-compiler-plugin
- 3.8.0
-
-
- maven-surefire-plugin
- 2.22.1
-
-
- maven-jar-plugin
- 3.0.2
-
-
- maven-install-plugin
- 2.5.2
-
-
- maven-deploy-plugin
- 2.8.2
-
-
-
- maven-site-plugin
- 3.7.1
-
-
- maven-project-info-reports-plugin
- 3.0.0
-
-
-
-
-
diff --git a/src/main/java/com/mycompany/app/App.java b/src/main/java/com/mycompany/app/App.java
deleted file mode 100644
index 77cf3e0..0000000
--- a/src/main/java/com/mycompany/app/App.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.mycompany.app;
-
-/**
- * Hello world!
- *
- */
-public class App
-{
- public static void main( String[] args )
- {
- System.out.println( "Hello World!" );
- }
-}
diff --git a/src/test/java/com/mycompany/app/AppTest.java b/src/test/java/com/mycompany/app/AppTest.java
deleted file mode 100644
index 81ac345..0000000
--- a/src/test/java/com/mycompany/app/AppTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.mycompany.app;
-
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
-{
- /**
- * Rigorous Test :-)
- */
- @Test
- public void shouldAnswerWithTrue()
- {
- assertTrue( true );
- }
-}
diff --git a/target/classes/com/mycompany/app/App.class b/target/classes/com/mycompany/app/App.class
deleted file mode 100644
index 5cc43ee..0000000
Binary files a/target/classes/com/mycompany/app/App.class and /dev/null differ
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
deleted file mode 100644
index b1f1b69..0000000
--- a/target/maven-archiver/pom.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-#Created by Apache Maven 3.6.0
-version=1.0-SNAPSHOT
-groupId=com.mycompany.app
-artifactId=my-app
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
deleted file mode 100644
index de9dba0..0000000
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ /dev/null
@@ -1 +0,0 @@
-com/mycompany/app/App.class
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
deleted file mode 100644
index 015d002..0000000
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ /dev/null
@@ -1 +0,0 @@
-/root/Jenkins-cicd/my-app/src/main/java/com/mycompany/app/App.java
diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
deleted file mode 100644
index 6348184..0000000
--- a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
+++ /dev/null
@@ -1 +0,0 @@
-com/mycompany/app/AppTest.class
diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
deleted file mode 100644
index cdee135..0000000
--- a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
+++ /dev/null
@@ -1 +0,0 @@
-/root/Jenkins-cicd/my-app/src/test/java/com/mycompany/app/AppTest.java
diff --git a/target/my-app-1.0-SNAPSHOT.jar b/target/my-app-1.0-SNAPSHOT.jar
deleted file mode 100644
index 392b6ff..0000000
Binary files a/target/my-app-1.0-SNAPSHOT.jar and /dev/null differ
diff --git a/target/surefire-reports/TEST-com.mycompany.app.AppTest.xml b/target/surefire-reports/TEST-com.mycompany.app.AppTest.xml
deleted file mode 100644
index 4b9c2b4..0000000
--- a/target/surefire-reports/TEST-com.mycompany.app.AppTest.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/target/surefire-reports/com.mycompany.app.AppTest.txt b/target/surefire-reports/com.mycompany.app.AppTest.txt
deleted file mode 100644
index be9d8d3..0000000
--- a/target/surefire-reports/com.mycompany.app.AppTest.txt
+++ /dev/null
@@ -1,4 +0,0 @@
--------------------------------------------------------------------------------
-Test set: com.mycompany.app.AppTest
--------------------------------------------------------------------------------
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.115 s - in com.mycompany.app.AppTest
diff --git a/target/test-classes/com/mycompany/app/AppTest.class b/target/test-classes/com/mycompany/app/AppTest.class
deleted file mode 100644
index 197784c..0000000
Binary files a/target/test-classes/com/mycompany/app/AppTest.class and /dev/null differ