Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Set up a Jenkins continuous-integration pipeline by committing a Jenkinsfile to your repository, creating a Pipeline or Multibranch Pipeline item, connecting source-control events, and assigning an agent that has the tools your build needs. A maintainable pipeline normally checks out code, builds it, runs automated tests, publishes artifacts, and optionally deploys them.

What a Jenkins CI pipeline does

Jenkins automates the repeatable path from a source-control change to a verified build. Each change can start a run that checks out the revision, compiles or packages it, executes tests, stores build outputs, and—when your release policy allows—deploys the result. The pipeline definition lives in a versioned Jenkinsfile, so changes to CI are reviewed, audited, and rolled back with the application code instead of being hidden in controller-only configuration.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Jenkins supports two Pipeline syntaxes:

  • Declarative Pipeline uses a structured pipeline {} block with explicit stages and steps. It is generally the easiest format to review and standardize.
  • Scripted Pipeline uses Groovy control flow for cases that need more programmatic flexibility. It remains supported, but teams must impose their own structure and guardrails.

The procedure below uses Declarative syntax because it makes the required execution model visible.

Prerequisites and design decisions

Prepare the repository and Jenkins controller

  • A source-control repository that Jenkins can read.
  • A Jenkins controller with Pipeline support and the source-control integration required by your provider.
  • An agent (also called a worker) with the compiler, package manager, test runner, and other build tools your commands use.
  • Network access from the controller or agent to the source repository, dependency registries, artifact storage, and any deployment targets.
  • Credentials configured in Jenkins for private repositories, registries, signing keys, or deployment systems.

Check plugin versions, permissions, and credential scopes on the target controller before rolling out the job. A Jenkinsfile can be syntactically correct yet fail because an agent lacks a tool, a plugin step is unavailable, or the job cannot read a credential.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Choose a job model

Choice Use it when What Jenkins does
Pipeline You need one job for one repository reference or a centrally managed flow. Runs the Jenkinsfile configured for that item.
Multibranch Pipeline Your repository has several active branches or pull-request refs. Discovers branches containing a Jenkinsfile and creates branch-specific jobs automatically.

For a repository with short-lived feature branches, Multibranch Pipeline usually avoids manually creating and deleting jobs. A single Pipeline is simpler when only one stable reference needs building.

Select an execution trigger

  • SCM webhook: the Git provider calls Jenkins after a push or other repository event. This gives event-driven discovery and normally starts work quickly.
  • Periodic scan: Jenkins checks the configured source at an interval. Use it as a fallback when webhook delivery is unavailable, or as supplementary discovery.

Webhook delivery and branch discovery are separate concerns: the webhook must reach Jenkins, and the Multibranch configuration must be allowed to discover the relevant branches.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create and commit the Jenkinsfile

Create a file named exactly Jenkinsfile in the repository root. Commit it to the branch or branches Jenkins should build. Keeping the file in source control gives every revision a corresponding pipeline definition and lets reviewers inspect CI changes alongside application changes.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Minimal Declarative example

pipeline {
  agent any
  stages {
    stage('Checkout') {
      steps {
        checkout scm
      }
    }
    stage('Build') {
      steps {
        sh './build.sh'
      }
    }
    stage('Test') {
      steps {
        sh './test.sh'
      }
    }
  }
}

This example uses an available Jenkins executor, checks out the revision associated with the job, then runs two repository scripts. Replace the shell commands with the commands for your language and build system. On Windows agents, use bat or powershell instead of sh.

Understand the required Declarative structure

  • pipeline {} is the top-level Declarative block.
  • agent allocates an executor and workspace. A Declarative Pipeline without an agent is not valid.
  • stages groups the delivery activities that Jenkins displays in the run view.
  • Each stage contains steps, which perform the actual commands or Jenkins steps.

Use one stage for each discrete activity—such as Build, Test, Package, Publish, and Deploy—rather than placing the entire process in one opaque shell script. Clear stages make failures, approvals, timing, and restart decisions easier to understand.

Create the Jenkins job

Option A: Pipeline item

  1. In Jenkins, select New Item.
  2. Enter a job name, choose Pipeline, and select OK.
  3. In the job configuration, choose how the Pipeline definition is supplied. Select the repository-backed option when available, then provide the SCM URL, credentials, and the branch or reference containing Jenkinsfile.
  4. Save the item and run Build Now once to verify repository access, agent allocation, and the Jenkinsfile.

A single Pipeline can also use a Jenkinsfile stored directly in the job configuration, but that removes the repository as the authoritative source and makes review and history less consistent. Prefer the committed file for normal application pipelines.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Option B: Multibranch Pipeline

  1. Select New Item, enter a name, choose Multibranch Pipeline, and select OK.
  2. Under Branch Sources, add the source-control provider and repository location.
  3. Select or create scan credentials with permission to read the repository and its branches.
  4. Configure branch discovery behavior. Include the branch and pull-request categories your team wants built; exclude obsolete or unsupported references.
  5. Save the item and select Scan Multibranch Pipeline Now (the exact scan label can vary slightly by installed plugins).
  6. Open the discovered branch job and confirm that Jenkins found the root-level Jenkinsfile.

Multibranch Pipeline creates and manages branch-specific jobs only for references that contain a Jenkinsfile. Removing the file from a branch, deleting the branch, or changing discovery filters can therefore remove or disable its corresponding job.

Connect pushes to Jenkins

Configure a webhook

  1. In the source-control provider, open the repository’s webhook or integrations settings.
  2. Add the Jenkins endpoint supplied by your Jenkins SCM integration and select push events, plus pull-request events if your branch policy requires them.
  3. Save the webhook and use the provider’s delivery test or a real test push.
  4. In Jenkins, inspect the Multibranch item’s scan or event log and verify that the expected branch was discovered or scheduled.

The Jenkins endpoint and event names depend on the SCM provider and installed integration plugin, so use the endpoint displayed by that integration rather than guessing a URL. Protect the endpoint with the provider’s supported authentication and network controls.

Use periodic scanning when webhooks are unavailable

In the Multibranch Pipeline configuration, enable the periodic scan trigger and choose an interval appropriate to repository activity and controller capacity. Scanning consumes controller and SCM resources; it should be a fallback or supplement, not an excuse to poll every few seconds. A periodic scan discovers changes that a missed webhook would otherwise leave waiting.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Build a production-ready stage flow

Extend the minimal file only after the basic checkout, build, and test path succeeds. A common progression is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Checkout: obtain the exact revision selected by Jenkins.
  2. Build or compile: resolve dependencies and produce a package.
  3. Test: run unit, integration, or other automated checks.
  4. Publish: upload versioned artifacts and test reports.
  5. Deploy: promote the verified artifact to a target environment when policy permits.

Example structure:

pipeline {
  agent any
  stages {
    stage('Checkout') {
      steps { checkout scm }
    }
    stage('Build') {
      steps { sh './build.sh' }
    }
    stage('Test') {
      steps { sh './test.sh' }
    }
    stage('Package') {
      steps { sh './package.sh' }
    }
    stage('Publish') {
      steps { sh './publish.sh' }
    }
    stage('Deploy') {
      steps { sh './deploy.sh' }
    }
  }
}

Keep deployment commands in a later stage so a failed build or test prevents promotion. In a real pipeline, add the Jenkins steps your installation provides for test-result publication, artifact archiving, approvals, and notifications; verify each step’s plugin and permission requirements before committing it.

Add resilience and cleanup

As the pipeline becomes important to delivery, add bounded timeouts so a hung test cannot occupy an executor indefinitely, retries for demonstrably transient operations, and a post section for notifications or cleanup. Set an artifact and build-retention policy so old workspaces, logs, and packages do not consume unlimited storage. Publish machine-readable test results even when a test stage fails, so the run records the failure details.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Store and use credentials safely

Never commit passwords, tokens, private keys, or registry credentials in a Jenkinsfile or application repository. In Jenkins, create a credential with the narrowest supported folder or job scope, then reference its credential ID from the pipeline.

Declarative credential bindings

Declarative Pipeline’s credentials() helper supports secret text, secret files, username/password pairs, and SSH private-key bindings. For other credential types, use Jenkins Pipeline Syntax’s Snippet Generator to produce the binding supported by the installed plugins.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
pipeline {
  agent any
  environment {
    REGISTRY_AUTH = credentials('registry-credential-id')
  }
  stages {
    stage('Publish') {
      steps {
        sh './publish.sh'
      }
    }
  }
}

The identifier above is only an example; create the credential in Jenkins and substitute its actual ID. Do not echo credential-bearing environment variables, print command lines containing tokens, or write secrets to artifacts and workspaces. Jenkins stores credentials encrypted on the controller, but access is still governed by job permissions and by what the build process can read.

Choose the right Jenkins agent

Agent form Best fit Trade-offs and requirements
agent any Small or homogeneous installations where any available executor has the required tools. Simple, but builds can vary if executors do not have identical tool versions.
Static labeled agent Dedicated operating-system, hardware, or licensed-tool requirements. Predictable capacity, but you maintain the machine, tools, patches, and workspace.
Docker agent Repeatable userspace and dependency versions without manually preparing every worker. The agent host needs Docker access, images must be maintained, and private registry credentials may be required.
Dockerfile agent Build environments defined alongside the repository’s Dockerfile. Jenkins must build or retrieve the image before running the stage; image-build time affects feedback speed.
Kubernetes agent Elastic, isolated workers for variable workloads or parallel builds. A Kubernetes connection, pod template, container images, credentials, network policy, and workspace-volume design are required.

Whichever model you choose, verify that the agent has the expected Java/Jenkins connectivity, source-control access, build tools, enough disk and memory, and write permission to its workspace. Container and pod agents also need explicit configuration for registry authentication, Kubernetes secrets, persistent workspaces, and outbound network access.

Declarative versus Scripted Pipeline

Criterion Declarative Scripted
Structure Opinionated blocks for agents, stages, steps, options, and post actions. Groovy code controls the flow directly.
Reviewability Consistent shape makes common pipelines easier to scan. Flexibility can produce widely different structures between teams.
Complex logic Supports conditions and shared-library extensions, but within Declarative rules. Useful when dynamic loops, branching, or custom Groovy logic is central.
Starting point Preferred for a new, conventional CI pipeline. Choose when the required behavior cannot be expressed cleanly in Declarative syntax.

Both syntaxes can be stored in a Jenkinsfile. Do not mix styles casually: use the documented Scripted sections and validate the resulting file on the actual controller.

Troubleshoot the first failed run

Jenkins cannot find the Jenkinsfile

  • Confirm the filename is exactly Jenkinsfile, including capitalization.
  • Confirm it is at the repository root or change the configured script path to the committed location.
  • Verify that the selected branch actually contains the file.
  • For Multibranch jobs, run a fresh scan and review branch-discovery filters.

Checkout or webhook fails

  • Test repository credentials from the job configuration and confirm they have read access.
  • Check that the webhook URL is the one required by the installed SCM integration.
  • Review the provider’s delivery response and Jenkins event or scan logs.
  • Verify firewall, reverse-proxy, DNS, TLS, and inbound access rules between the provider and Jenkins.

The pipeline is waiting for an executor

  • Confirm an agent is online and has an available executor.
  • Remove or correct an overly restrictive label.
  • Check disk space, workspace permissions, and controller-to-agent connectivity.
  • For Docker or Kubernetes agents, inspect image-pull, pod-start, registry, and cluster events.

A shell step fails although the command works locally

  • Run the command as the Jenkins agent account, not as your interactive user.
  • Check tool versions, environment variables, working directory, file permissions, and network egress.
  • Make scripts executable where required and use a repository-defined tool setup to reduce machine-specific differences.
  • Remove secret values from diagnostic output before sharing logs.

A credential step is rejected

  • Check that the credential ID exactly matches the configured ID.
  • Confirm the job or folder is within the credential’s scope.
  • Verify that the installed plugin supports the binding syntax used by the Jenkinsfile.
  • Ensure the agent can reach the registry, repository, or deployment service that the credential authenticates.

Operational checklist before enabling automatic delivery

  • The Jenkinsfile is committed, reviewed, and tested on the intended branch.
  • Every stage has a clear purpose and fails the run when its required command fails.
  • Build and test tools are pinned or otherwise made consistent across agents.
  • SCM credentials and service credentials are stored in Jenkins, scoped narrowly, and absent from logs and source files.
  • Webhook delivery has been tested, with periodic scanning configured only as an intentional fallback.
  • Artifact names and versions identify the source revision that produced them.
  • Timeouts, retries, retention, test-result publication, notifications, and cleanup match the team’s operating needs.
  • Deployment stages have the approvals, environment protections, and rollback procedure required by your release process.
  • Docker images or Kubernetes pod templates are maintained, patched, and supplied with the registry, secret, volume, and network configuration they need.

What a successful setup looks like

A push to a configured branch causes Jenkins to discover the revision, allocate a suitable agent, check out the code, and display separate Build and Test stages. A passing run produces the expected reports or artifact; a failing run identifies the stage and preserves enough log and test information to correct the problem. For a Multibranch Pipeline, adding a branch with a valid Jenkinsfile creates its branch job automatically, while removing that file prevents the branch from being treated as a pipeline.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.