---
title: Deploy Jenkins with AI on Blossom
url: "/deploy/jenkins/"
canonical_url: https://blossom88.com/deploy/jenkins/
markdown_url: https://blossom88.com/deploy/jenkins.md
summary: Run a Jenkins pipeline on a private worker and keep its build artifacts through
  an update.
categories:
- deployment
- ci
stack:
- Java
- Groovy
- Jenkins Pipeline
---

# Deploy Jenkins with AI on Blossom

[Jenkins](https://www.jenkins.io/) automates jobs such as building and
testing code. Run a sample pipeline on a separate worker and open its
archived result after replacing the controller Container.

## Ask Your Agent

> **Ask your AI agent:** Deploy Jenkins on Blossom and help me run a sample pipeline on a private worker.
>
> Follow this guide: https://blossom88.com/deploy/jenkins/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and choose a Blossom Cloud Location when you log in. You can also use [Blossom BYOC (bring your own cloud)](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#blossom-byoc).

## Have Ready

- **Controller HTTPS address** (Required): Use a stable address for the Jenkins UI.

## How It Runs

| Part | Role | Where |
|---|---|---|
| Jenkins controller | Schedule jobs and store pipeline history and artifacts | Persistent Service with a Volume |
| Jenkins worker | Run the labeled pipeline | Private Service on App Capacity |

## Deploy Jenkins

Run the official Jenkins LTS controller and inbound agent images.
Keep the controller UI behind Blossom Account access for the
workshop.

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom service:create --data jenkins.yml
    blossom service:create --data worker.yml
    blossom env_var:push --environment environment-100 --file jenkins.env
    blossom environment:deploy --id environment-100 --follow
    blossom env_var:push --environment environment-100 --file worker.env
    blossom environment:deploy --id environment-100 --follow
    blossom service:scale --id service-worker-100 --desired-size 1 --follow

</details>

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Mount the controller Volume at `/var/jenkins_home`, use port 8080,
and give Jenkins time to initialize and load its Pipeline plugins.
Set the controller executor count to zero.

</details>

## Connect the Private Worker

Register an inbound node with a label and start the worker after the
node exists. Use a WebSocket to the controller's private HTTP port and
pass the node secret through a private file. Deploy the updated
Environment variables before scaling the worker up. The worker uses
the variables from the successful Release.

![Open the first successful Jenkins build and its archived result.](/deploy/assets/images/jenkins/workshop-build.webp)

## Run the Workshop Pipeline

Give the pipeline the worker's label. Write a text file containing
the worker name, then archive it as an artifact. Open the completed
build and download the file.

> **Ask your AI agent:** Run a sample Jenkins pipeline on the private worker and archive a text file with its name.

> Follow this guide: https://blossom88.com/deploy/jenkins/



## Keep It Running

Replace the controller Container on the same Volume. Open the
original build and artifact, then run the pipeline again with the
same worker.

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom service:scale --id service-web-100 --desired-size 0 --follow
    blossom service:scale --id service-web-100 --desired-size 1 --follow

</details>

![See the same worker complete a second build after controller replacement.](/deploy/assets/images/jenkins/workshop-second-build.webp)

## What You Get

- A protected Jenkins controller
- An inbound worker on the private Service network
- A successful pipeline with an archived result
- The same artifact and a working worker after a controller update

Tested on Blossom: The first artifact survived controller replacement, and the same private worker ran another successful build.
