Mainframe Path Start learning free
Beginner7 min readLesson 5 of 5

Deploying a package safely

A safe deployment takes the same package through each environment in turn, with configuration supplied separately for each one. Production needs approval, runs in an agreed window, is checked straight afterwards, and has a rollback plan: usually, deploy the previous version again.

Promotion through environments

One artifact, several environments
DevelopmentEvery merge deploys automatically. Quick checks
TestAutomated and manual testing against realistic data
Acceptance or pre-productionBusiness sign-off, often on a copy of production
ProductionAfter approval and change control, in an agreed window

Promotion means moving the *same* artifact, the same version with the same checksum, from one environment to the next. What changes between environments is configuration: database names, URLs, dataset prefixes, credentials. Keep configuration outside the package and supply it per environment, so that the package itself never needs rebuilding.

Gates before production

Deployment strategies

StrategyHow it worksMain benefit
All at onceStop, replace, startSimple, but users notice the outage
RollingUpdate servers a few at a timeNo full outage
Blue-greenRun the new version beside the old one, then switch traffic overSwitching back is just switching traffic back
CanarySend a small share of users to the new version firstProblems hit a few users, not everyone

Check, then decide: keep or roll back

Straight after deploying, run smoke tests: a handful of quick checks that the main functions work, such as logging on, one enquiry and one update. Watch the error rates and logs for a while. If something is wrong, roll back, which usually means deploying the previous version again. That is only possible if the previous artifact is still stored and the deployment is automated.

Deploying to z/OS

On the mainframe, deploying usually means copying the load modules into the target load libraries, then making the running systems use them. CICS keeps programs in memory, so the new version is picked up with a NEWCOPY or PHASEIN of the program. Programs with static SQL need their Db2 packages bound. Tools such as IBM Wazi Deploy, IBM UrbanCode Deploy and Ansible automate these steps and record what was deployed where.

TRY IT YOURSELF

What is the usual way to roll back a bad deployment? (Answer in a few words.)

Show a hint

Think about the artifact you kept.

Show the solution

Deploy the previous (last good) version of the artifact again.

Common mistakes

Building a new package for production

Then production runs something nobody tested. Promote the artifact that passed testing.

Building environment settings into the package

A package that contains test database names must be rebuilt for production. Supply configuration per environment.

No rollback plan

'We will fix it forward' at 2 a.m. is a gamble. Keep the previous version and know the command that redeploys it.

What you will see at work

Key terms

Check your understanding.
Take this lesson's quiz and save your progress. Free.

Take the lesson quiz
← Packaging binaries: artifacts, versions and repositoriesBack to Jenkins and CI/CD pipelines