Chapter 11

Build and publish

Your button works in the showroom. It still lives only on your laptop. Publishing is the last mile: pack it up, check it, and hand it to the Pega server.

Pega 24 – 26

The idea

Pack it, check it, post it.

Think of posting a parcel. You check the contents are what the label says (validate), you box it up (bundle), you write the address (ruleset and version), you confirm you really want to send it, and then it goes. One command, npm run publish, does all of it, and stops to ask you at the moments that matter.

Checklist

Before you press the button.

  1. The checks pass. npm run verify is green.
  2. You are signed in. npm run authenticate has run, and the server address in tasks.config.json is the one you mean.
  3. The destination is right. Ruleset name and version match your application. Mixing these up is the most common publishing mistake.
  4. You chose the build type. Development while experimenting. Production only when it is final, because it cannot be deleted.
  5. The version moved forward. The component version in config.json is the one you want on the server.

Play

One command, seven moments.

Run it below. The steps and the two confirmation questions are the real ones; the server and names are placeholders. Say No to a question at least once, so you see that nothing is sent until you agree.

npm run publishTry it: run it, answer the questions, try Production
Build type
  1. ValidateChecks config.json against the component rules.
  2. BundlePacks your code and its styles into one deliverable file.
  3. Choose whereTakes the ruleset and version from your config (or asks).
  4. ConfirmShows the server and asks you to say yes.
  5. UploadSends the bundle to the Pega server.
  6. SavedPega stores it as a rule in your ruleset version.
terminal

$ npm run publish

Illustrative output with placeholder values. Your own run prints your real server and application.

Reference

The commands.

Terminal
# Validate and build, without publishing. A dry run for the bundle.npm run buildComponent -- --name=Acme_UI_CelebrateButtonnpm run buildAllComponents # Publish one component. It asks for ruleset, version and build type.npm run publish -- Acme_UI_CelebrateButton # Skip the questions: component, ruleset, version, then Y (development) or N.npm run publish -- Acme_UI_CelebrateButton AcmeComponents 01-01-01 Y # Publish everything that is built.npm run publishAll

The one-line form comes from reading the tool's source, not from a run. Try it with a development build first.

Play

Or use the Deployment Hub.

If commands are not your thing, start npm run hub and use a web page instead. It reads the servers you listed in hub.config.json and publishes with buttons. This is a model of it: choose a server, press Publish, and watch the runs list grow. Try Stop while one is running.

Deployment HubTry it: pick a server, press Publish
Deployment Hublocalhost:3050/hub

Ruleset

AcmeComponents

Build: dev (from the server's entry in hub.config.json)

Runs

Nothing yet. Press Publish or Validate.

Publish
Builds and publishes one component, or all of them, to any server in your config.
Validate
Runs the schema checks without a full publish. A quick sanity pass.
Sign in
OAuth sign-in per server, remembered on your machine.
Stop
Aborts a run mid-flight, after a confirmation. What was already sent to the server stays there.
Terminal
Each run is a collapsible block with its own status, command, duration and output.
Run history
Earlier runs load when the page opens. A failed run stays open so you can read why.

Fine print

What you are signing up for.

The builder prints a note whenever you list its commands, and it is worth reading once. In its own words, by choosing to create and use custom components you agree to keep them up to date with every release of Pega Infinity, and to meet compliance standards for data privacy and accessibility.

In practice: when your Pega server is upgraded, rebuild with the matching builder (see the version table on the start page) and republish. A component is software, and software needs looking after. Your button is not done; it is shipped.

One more thing the builder mentions: it also has a library mode for bundling many components into a versioned library. It is labelled beta and experimental in the tool itself, so this guide, and this project, use the ordinary component mode.

Your turn

Questions and comments

Stuck on something, or have a thought? Write it here. To talk about one part, use the Comment button under that section's heading.

3–20 letters, digits, _ or -. Kept in this browser so you are not asked again.

0/1000

A hands-on guide by Sanjeev Kujur. Independent, and not affiliated with or endorsed by Pegasystems.

Covering Pega Infinity versions 24.2, 25.1, and 26.1 · Updated 5 Nov 2026