/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ def lib = library("jenkins") pipeline { agent none stages { stage('Example Build') { steps { script { def messages = lib.jenkins.Messages.new(this) messages.add("stage1", "message 1") messages.add("stage2", "message 2") } } } post() { success { script { def messages = lib.jenkins.Messages.new(this) def stashed = messages.get(["stage1", "stage2"]) echo stashed } } } } }