Skip to content

Commit cf85758

Browse files
authored
Merge pull request #1 from vilasvarghese/master
test
2 parents c2eee81 + f7713fb commit cf85758

7 files changed

Lines changed: 298 additions & 4 deletions

File tree

git/GitQuestions.txt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Basic Git Concepts:
2+
3+
What is Git and what problem does it solve?
4+
Explain the difference between Git and GitHub.
5+
What is a version control system?
6+
What is a repository in Git?
7+
What is a commit in Git?
8+
Describe the purpose of the working directory, staging area, and repository in Git.
9+
What is the Git index/staging area?
10+
What are branches in Git?
11+
How do you initialize a new Git repository?
12+
How do you clone an existing Git repository?
13+
What is a remote repository?
14+
How do you check the status of files in your Git repository?
15+
What is the purpose of the .gitignore file?
16+
How do you create a new branch in Git?
17+
How do you switch between branches?
18+
What is the HEAD in Git?
19+
20+
Basic Git Commands:
21+
22+
How do you stage changes for commit?
23+
How do you commit changes to the repository?
24+
How do you create a new Git branch and switch to it in a single command?
25+
How do you merge two branches in Git?
26+
How do you push changes to a remote repository?
27+
How do you pull changes from a remote repository?
28+
How do you remove a file from Git without deleting it from the filesystem?
29+
How do you undo the last commit without losing changes?
30+
How do you discard changes in a file and revert it to the last commit state?
31+
How do you create and apply a Git patch?
32+
How do you delete a branch in Git?
33+
34+
Intermediate Git Concepts:
35+
36+
Explain what a merge conflict is and how to resolve it.
37+
What is a fast-forward merge?
38+
What is a rebase in Git?
39+
What are the advantages of rebasing over merging?
40+
What is cherry-picking in Git?
41+
How do you stash changes in Git and retrieve them later?
42+
Explain the difference between a soft reset, mixed reset, and hard reset.
43+
What is Git bisect used for?
44+
How do you set up an upstream remote for a forked repository?
45+
What is a pull request in Git?
46+
How do you squash multiple commits into a single commit?
47+
Explain the concept of detached HEAD state.
48+
How do you amend the most recent commit message?
49+
How do you rename a branch in Git?
50+
How do you configure and use Git aliases?
51+
How do you sign commits using GPG in Git?
52+
53+
Advanced Git Concepts:
54+
55+
Explain the difference between shallow cloning and deep cloning a repository.
56+
How do you work with submodules in Git?
57+
What is Git reflog and how is it useful?
58+
Explain the concept of Git hooks and give examples of pre-commit and post-receive hooks.
59+
What is a commit object in Git and how is it represented?
60+
How do you interactively rebase commits using git rebase -i?
61+
What is a Git blame and how can it be useful for identifying code authors?
62+
Explain how to use Git bisect to find the commit that introduced a bug.
63+
What is a Git subtree and how do you work with it?
64+
How do you configure a merge strategy in Git?
65+
Explain the difference between git pull --rebase and git pull --merge.
66+
How do you use the git cherry and git cherry-pick commands?
67+
What is the git worktree command used for?
68+
How do you sign tags using GPG in Git?

jenkins/Lab/AddAgents/instructions.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ chmod 700 authorized_keys
2323

2424

2525
sudo -i su -c 'sed -i -e "s/MACs /MACs hmac-sha1,/g" /etc/ssh/sshd_config; service sshd restart'
26-
systemctl restart sshd.ser vice
2726
systemctl restart sshd.service
2827
systemctl status sshd
2928

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
pipeline {
2+
agent any
3+
4+
environment {
5+
GIT_REPO_URL = 'https://github.com/yourusername/your-repo.git'
6+
GIT_CREDENTIALS_ID = 'your-git-credentials-id'
7+
CHECKOUT_PATH = '/path/to/checkout'
8+
MAVEN_TOOL = 'Maven-3.8.3'
9+
}
10+
11+
stages {
12+
stage('Checkout') {
13+
steps {
14+
checkout([$class: 'GitSCM',
15+
branches: [[name: '*/master']],
16+
userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.GIT_CREDENTIALS_ID]]])
17+
}
18+
}
19+
20+
stage('Build with Maven') {
21+
steps {
22+
script {
23+
def mvnHome = tool name: env.MAVEN_TOOL, type: 'hudson.tasks.Maven$MavenInstallation'
24+
25+
dir(env.CHECKOUT_PATH) {
26+
sh "${mvnHome}/bin/mvn clean install"
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
node {
2+
// Define the GitHub repository URL and your credentials
3+
def gitRepoUrl = 'https://github.com/vilasvarghese/docker-k8s.git'
4+
//def gitCredentialsId = 'your-git-credentials-id'
5+
6+
// Define the path where the code will be checked out
7+
//def checkoutPath = '/path/to/checkout'
8+
9+
// Define the Maven installation name
10+
def mavenTool = 'M3' // The name of the Maven tool configured in Jenkins
11+
12+
stage('Checkout') {
13+
// Clone the GitHub repository
14+
checkout([$class: 'GitSCM',
15+
branches: [[name: '*/master']],
16+
userRemoteConfigs: [[url: gitRepoUrl]]])
17+
//, credentialsId: gitCredentialsId
18+
}
19+
20+
stage('Build with Maven') {
21+
// Set up the Maven tool
22+
def mvnHome = tool name: mavenTool, type: 'hudson.tasks.Maven$MavenInstallation'
23+
24+
// Change to the checkout directory
25+
/*dir(checkoutPath) {
26+
// Build the project using Maven
27+
sh "${mvnHome}/bin/mvn clean install"
28+
}*/
29+
sh "${mvnHome} clean install"
30+
//Above mvnHome should be defined in the tools section.
31+
//
32+
}
33+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
In the job
2+
----------
3+
Check
4+
GitHub hook trigger for GITScm polling
5+
6+
In github
7+
---------
8+
Go to repo
9+
Click settings of repo.
10+
Click webhooks
11+
Click Add Webhook
12+
http://3.143.210.172:8080/github-webhook/

maven/MaveSimpleNotes.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Maven plugins are extensions that enhance the functionality of the Maven build t
146146
The Assembly plugin is a popular plugin used to create custom distribution packages from the project output. It can create ZIP, TAR, and other archive formats, combining various project artifacts and resources into a single distribution package.
147147

148148
Install Plugin (maven-install-plugin) and Deploy Plugin (maven-deploy-plugin):
149-
These core plugins handle the installation and deployment of project artifacts to local and remote repositories, respectively. The install phase installs the project artifact to the local Maven repository, while the deploy phase deploys the artifact to a remote repository for sharing with other developers.
149+
These core plugins handle the installation and deployment of project artifacts to local and remote repositories, respectively. The install phase installs the project artifact to the local Maven repository, while the deploy phase deploys the artifact to a remote repository for sharing with other developers.
150150

151151
Failsafe Plugin (maven-failsafe-plugin):
152152
The Failsafe plugin is similar to the Surefire plugin but is designed for integration tests rather than unit tests. It is bound to the verify phase and allows for the execution of tests that require a running application.
@@ -462,12 +462,11 @@ Follow
462462
https://spring.io/guides/gs/spring-boot/
463463

464464
-----------------------------------------------------------------------
465-
4. Maven Commands demonstration to Build, Test and Package the projects
465+
4. Maven Commands demonstration to Build(compile), Test(test) and Package(package) the projects
466466
-----------------------------------------------------------------------
467467

468468
To demonstrate building, testing, and packaging a Maven project, let's assume you have already created a simple Maven project with the following structure:
469469

470-
css
471470

472471
my-maven-project/
473472
├── src/

maven/MavenQuestions.txt

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
What is Apache Maven?
2+
What problem does Maven solve?
3+
What are the benefits of using Maven?
4+
How do you define a project in Maven?
5+
What is a POM (Project Object Model)?
6+
Explain the purpose of the pom.xml file.
7+
What is the default packaging type in Maven?
8+
What is a Maven repository?
9+
What are the two main types of repositories in Maven?
10+
How does Maven handle project dependencies?
11+
Explain the concept of a transitive dependency in Maven.
12+
What is a Maven plugin?
13+
14+
Maven Commands:
15+
16+
How do you create a new Maven project?
17+
What is the command to build a Maven project?
18+
How do you clean a Maven project?
19+
Explain the purpose of the mvn clean install command.
20+
What is the purpose of the mvn clean package command?
21+
How do you run tests using Maven?
22+
What is the difference between mvn install and mvn deploy?
23+
How do you skip tests during the build process?
24+
How do you specify a specific Maven goal to execute?
25+
26+
Project Structure and Configuration:
27+
28+
What is the src directory in a Maven project?
29+
Explain the purpose of the src/main/java directory.
30+
What does the src/test/java directory contain?
31+
What is the purpose of the src/main/resources directory?
32+
How do you specify project information like groupId and artifactId?
33+
What is the parent POM?
34+
How do you specify project dependencies in the POM?
35+
What is a dependency scope in Maven?
36+
37+
Dependency Management:
38+
39+
What is a Maven dependency?
40+
How do you add a dependency to the pom.xml file?
41+
What are the common dependency scopes in Maven?
42+
Explain the difference between compile, provided, runtime, and test scopes.
43+
How do you exclude transitive dependencies?
44+
What is the purpose of the dependencyManagement section in the POM?
45+
How can you resolve version conflicts between dependencies?
46+
47+
Build Lifecycle and Phases:
48+
49+
What is a Maven build lifecycle?
50+
Explain the difference between a Maven phase and a goal.
51+
What are the three build lifecycles in Maven?
52+
Name the phases in the default build lifecycle.
53+
What is the clean phase used for?
54+
What happens in the validate phase?
55+
Explain the purpose of the compile phase.
56+
How does the package phase differ from the install phase?
57+
What is the site phase used for?
58+
59+
Profiles and Plugins:
60+
61+
What is a Maven profile?
62+
How do you define a profile in the POM?
63+
What is a Maven plugin?
64+
How do you configure a plugin in the POM?
65+
What is the purpose of the groupId, artifactId, and version elements in a plugin configuration?
66+
What is the purpose of the execution element in a plugin configuration?
67+
How do you execute a specific goal of a plugin?
68+
69+
Customization and Configuration:
70+
71+
How can you customize the Maven build process?
72+
What is a custom Maven archetype?
73+
How do you create a custom archetype?
74+
What is the .m2/settings.xml file used for?
75+
How do you specify a proxy server in Maven?
76+
How do you change the default local repository location?
77+
78+
Maven Repository:
79+
80+
What is the Central Repository?
81+
How do you search for artifacts in the Central Repository?
82+
How can you specify a remote repository in the POM?
83+
What is the purpose of snapshots and releases in Maven repositories?
84+
How do you deploy artifacts to a Maven repository?
85+
Explain the differences between snapshot and release versions.
86+
87+
Multi-Module Projects:
88+
89+
What is a multi-module project in Maven?
90+
How do you define a parent POM for a multi-module project?
91+
What is the purpose of the <modules> element in the parent POM?
92+
How do you build and deploy a multi-module project?
93+
How does dependency management work in a multi-module project?
94+
95+
Build Profiles:
96+
97+
What is a build profile in Maven?
98+
How do you activate a build profile?
99+
Can you activate multiple profiles simultaneously?
100+
How do you specify a profile's activation criteria?
101+
102+
Maven Repository Managers:
103+
104+
What is a Maven repository manager?
105+
Name a popular Maven repository manager.
106+
How do repository managers improve dependency management?
107+
What are some benefits of using a repository manager?
108+
109+
Maven Best Practices:
110+
111+
What are some best practices for organizing project structure in Maven?
112+
How can you improve build efficiency in Maven?
113+
What is the importance of versioning in Maven?
114+
What are some strategies for dealing with version conflicts?
115+
116+
Troubleshooting:
117+
118+
How do you debug Maven build failures?
119+
What should you do if you encounter "Out of Memory" errors during the build?
120+
How can you resolve issues with downloading dependencies?
121+
How do you generate a Maven debug log?
122+
123+
Advanced Topics:
124+
125+
What is the purpose of the Maven Assembly Plugin?
126+
How can you create an executable JAR using Maven?
127+
What is the purpose of the Maven Shade Plugin?
128+
Explain the concept of Maven Archetypes.
129+
How do you create a custom Maven plugin?
130+
131+
Integration and Tooling:
132+
133+
How does Maven integrate with continuous integration tools like Jenkins?
134+
What are some popular IDEs that have Maven integration?
135+
How does Maven integrate with version control systems like Git?
136+
137+
Performance and Optimization:
138+
139+
How can you speed up Maven builds?
140+
Explain the concept of incremental builds in Maven.
141+
What is the purpose of the .m2/repository directory?
142+
143+
Migration and Upgrades:
144+
145+
How can you migrate a project from Ant to Maven?
146+
What is the process for upgrading Maven versions?
147+
How can you migrate a project from Maven 2 to Maven 3?
148+
149+
Maven Ecosystem:
150+
151+
What are some alternative build tools to Maven?

0 commit comments

Comments
 (0)