how to use jenkins

 Jenkins is
1) Open source automation server
2) Helps to automate the non-human part of
the software development process
3) Allows continuous integration
5) In my company Port is 8081 localhost
 To run my project in Jenkins
1) I need  to Login Jenkins account
2) I need to Create freestyle project
3) after that Install plugins -cucumber report and git
4) Under source code management I choose git and past git url
5) I Build trigger and I choose to build periodically
6) Invoke top-level maven
1. Maven version; MAVEN_HOME
2. Goals; clean verify -
Drunner=smoke_runner.xml
7) Under post-build actions
1. Choose cucumber reports
2. Choose editable email notify
8) Editable email notification
1. Attach build log; choose build log
2. Click advanced settings
9) Failure-Any
1. Click advanced
2. Recipient list - email address who will
receive the report. Add comma if multiple
3. Click add trigger - like failure always
4. Attach build log; select attach build log
5. Save
10) Final Step
1. Click build now and test will run and
gives your cucumber report

3.8
5
Liuyihaoge 115 points

                                    How did you create a Job in jenkins? 
In my company devops team maintains 
the jenkins and as a tester my jenkins
account user do not have enough privilege 
to create new jobs. I provide them server
specifications which means minimum capacity
of the jenkins server (maven, java 8, browser
types(chrome, firefox or what you need), OS(Mac-Windows), etc).
I can only run the jobs and see the results. 
To create my smoke tests on jenkins I created 
a ticket in jira for the devops team. 
But also know how to create and configure 
jenkins jobs myself. 
I have done it in my previous projects. 

How you configure a job(build) in Jenkins?
As a test engineer I only configured 
my smoke tests on jenkins. 
how we configure our smoke test also depend
s on what tools we have in our framework.
I have a cucumber + junit + maven framework. 
So this is how that job is configured:

1. Source Code Management
Here we specify where to get the code from.
we put the link of our GitHub repo 
and also enter the credentials

2. Build Triggers
We specify how often we run those tests.
we choose Build periodically because we
want to run in certain schedule. 
in my project, we run smoke tests every morning.
so in the build trigger we entered daily option:
H 6 * * * --> every day around 6 am.
Jenkins used a cron expression, and the different fields are:

  H * * * *   ==> Build every hour at any minute (6.12 am, 8.38pm)
  0 * * * *   ==> Build every hour at exactly on the hour (6.00 am, 8.00pm)
  0 8 * * *   ==> Build every day exactly 8.00 am
  H/5 * * * * ==> Build every 5 minutes
  H 6 * * 1-5 ==> Build around 6 am from first day of the week (Monday) to 5th day (Friday)
  H 1 * 6,20 * * ==> Build on 6th and 20th day of the month around 1 am for regression

3. Build
Here we enter the details of the actual Run.
since my project is based on maven, 
I choose option: Invoke top-level maven targets
then I choose which maven to run from the
version dropdown. in the next field, 
I enter the maven goal: verify. in this field
we do not need to enter the word mvn.
I can also mention here which tag or which
runner class I want to run. So the command will be:
	verify -Dcucumber.options="--tags @smoke"       ==> for smoke test
	verify -Dcucumber.options="--tags @regression"  ==> for regression test

4. Add Post-build Actions
In the post build actions, we configure
what we want to do after build. after
each test we generate report and email
a. report
We generate report using Cucumber reports plugin.
I select Cucumber reports plugin from the
Post-build Actions to generate reports. 
b. Email
Using the email plugin we can send email
after every build. I select Editable Email
Notification option from the Post-build
Actions to send emails.

3.8 (5 Votes)
0
4
7
Moonicorn 125 points

                                    mvn clean ==> delete target folder
- mvn clean test ==> delete target folder
                     and run cucumber tests

- mvn clean verify ==> delete target folder, run cucumber test,
                       generate cucumber HTML report

- mvn clean verify -P Regression ==> delete target folder,
                                 run Regression profile in pom.xml.

- mvn verify -Dfile = RegressionRunner.java ==>
                     runs this specific runner class

- mvn install -DskipTests ==> It will skip all tests

- mvn -Dtest=login test ==> Running a Single Test Class:
                            It will run only login test class

- mvn verify -Dbrowser=firefox --> to run with firefox

- mvn verify -Dbrowser=chrome --> to run with chrome

- mvn verify -Dcucumber.options="--tags @smoke" 

-Denv="QA2" --> provide scenarios that you want to run.
No need to change CucumberRunner class. 
It overrides runner class configuration.

4 (7 Votes)
0
3.5
2

                                    Jenkins automates building, testing,
reporting, packaging, staging, deploying
the application by using plugins.
Jenkins offers a simple way to set up a
continuous integration or continuous 
delivery environment for almost any 
combination of languages and source code
repositories using pipelines, as well as
automating other routine development tasks.
While Jenkins doesn’t eliminate the need
to create scripts for individual steps, 
it does give you a faster and more robust
way to integrate your entire chain of build,
test and deployment tools than you can 
easily build yourself.

3.5 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
jenkins run jenkins command how to write jenkins for .net jenkins development jenkins with prompt ow to create a jenkins file jenkins example ways to give jenkins configurations jenkins steps example jenkins linux jenkins integration jenkins run cmd commands do you need java to run jenkins? why we need jenkins in automation what is the use of jenkins in java jenkins basic where do we use Jenkins ? jenkins software tutorial jenkins using make does jenkins really require java jenkins programming language uses of jenkins why use jenkins file Use Jenkins jenkins are developed in which language when did jenkins come out what language is jenkins script jenkins command command to start jenkins start jenkins linux What is the use of a Jenkins file jenkins jenkins dok how to manage jenkins what is the use of jenkins jenkins command to start is jenkins popular how setup jenkins add jenkins compiling from jenkins jenkins steps script how do I start jenkins jenkins file ? how to use? how to create jenkins jenkins.* what is a jenkins file how to start jenkins from command line do I need to use jenkins jenkins jenkinsfile tutorial jenkins jenkinsfile? getting started with jenkins What is Jenkins job? jenkins used for can i use jenkins for .net jenkins script library Jenkins' what is jenkins work how to write jenkins file what are Jenkins stage using make command in jenkins jenkins jenkins what are jenkins written in What do you mean by Jenkins ? jenkins examples jenkins code how to write jenkins library jenkins build command setting up jenkins Commands to use to start Jenkins manually guide to writing jenkins library jenkins when jenkins cli commands useful jenkins Which of the following commands runs Jenkins from the command line How can you make Jenkins build the project manually why do we need jenkins jenkins basic scripts what's jenkins how to work with jenkins in windows jenkins clii what is Jenkins about Jenkins why jenkins jenkins full tutorial why is jenkins used jenkins tutorial\ To implement any Java Program using Jenkins jenkins basic tutorial how to jenkins from command line what is possible to do with jenkins jenkins run command how to start a jenkins server jenkins for linux what does jenkins do? what is use of jenkins jenkins start command jenkins how to get Jenkinsfile jenkins in java where to add jenkins script jenkins jenkinsfile what is build in jenkins when to use jenkins command to start jenkins manually whta is jenkins windows jenkins command how to start jenkins was is jenkins? jenkins demo jenkins basics using jenkins how to jenkins load $ what was jenkins called before Jenkins (software) how to run jenkins jenkins is used for how to use jenkins files how to create jenkins pipeline run jenkins manually jenkins on command line what is Jenkins and Jenkins Pipeline linux jenkins run jenkins command line how to do jenkins build how to implement jenkins explain jenkins what can i use jenkins for start jenkins from command line jenkins script console launch jenkins how does jenkins pipeline work\ how to build a jenkins job jenkins what is jenkins only work with java ? what does jenkins file do run jenkins how to to run jenkins i jenkins terminal why jenkins is needed why jenkins file why jenkins is used What is Jenkins and why it is used? what are jenkins build on what is jenkins programming jenkins as code what is jenkinsfile jenkins start jenkins how does jenkins work what is jenkins and why it is used jenkins script example msbuild jenkins pipeline leeroy jenkins jenkins dotnet build jenkins python api jenkins help what is Jenkins job whats is Jenkins job jenkins guide jenkins architecture linux commands in jenkins where is jenkins from how jenkins works jenkins .Jenkins command line jenkins run jenkins framework what does jenkins do JHow to start jenkins jenkins cl define jenkins jenkins options how to start jenkins jenkins equivalent what can jenkins do jenkins software shell jenkins setup jenkins in your project what is jenkins why it is used Jenkins. use of jenkins who use jenkins jenkins on linux jenkins in linux server jenkins basic commands why use jenkins why we use jenkins should i use jenkins simple jenkins file jenkins language jenkins jenkinsfile howto how does jenkins pipeline work jenkins how it works jenkins scripting tutorial why do i need jenkins what is Jenkins software jenkins basic code where is our jenkins running jenkins cli jenkins how will work how to setup a jenkins server jenkins basic steps jenkins run cmd jenkins cmd can you use jenkins with java 15 Jenkins what is jenkins used for jenkins cmd command jenkins tool command how to write a jenkins job how to setup jenkins jenkins script jenkins console jenkins command line working with jenkins script jenkins jenkins documentation how to make a jenkins server jenkins language support jenkins to server jenkins medium opensourceconfiguration jenkins jenkins whats is jenkins tool set up kjenkins for beginners jenkins CI free what is jenkins how do you use jenkins how to jenkins jenkins commands install jenkins jenkins tutoriaal jenkins how to how to work with jenkins jenkins tutorial how to use jenkins
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source