Step 2: Make a Change
Now let's modify the pipeline to see how quickly you can iterate.
Update the Pipeline
Update hello.yaml:
input:
generate:
interval: 1s
mapping: |
root.message = "Hello, World!"
root.timestamp = now()
root.count = counter()
output:
stdout: {}
Copy the changed pipeline config under the config: key of hello-job.yaml, the
job spec you wrote in
Step 1, then redeploy:
expanso-cli job deploy hello-job.yaml
Deploying an existing job name updates that job in place and the control plane
re-evaluates it, so you do not stop it first. --force applies the deploy even
when the spec is unchanged; to restart a job with the spec it already has, use
expanso-cli job rerun hello-world.
Now you see:
{"count":1,"message":"Hello, World!","timestamp":"2024-12-26T10:00:00.123Z"}
{"count":2,"message":"Hello, World!","timestamp":"2024-12-26T10:00:01.456Z"}
{"count":3,"message":"Hello, World!","timestamp":"2024-12-26T10:00:02.789Z"}
What Changed?
now()- A Bloblang function that returns the current timestampcounter()- A function that increments with each message
Try changing the message text or interval and redeploy. Each deploy creates a new
job version, so expanso-cli job versions hello-world shows the history and
expanso-cli job rollback returns to an earlier one.