Obtaining Artifact Information Using the Pipeline Context
You can reference pipeline context during job configuration to obtain desired information. The following example uses the Build extension to generate an artifact and retrieves the artifact information by referencing context in the ExecuteShellCommand job.
- Create a pipeline.
- Add the Build extension to Stage_1, obtain the task ID as shown in Figure 1, and set the artifact identifier to demo as shown in Figure 2.
- Add the ExecuteShellCommand extension to Stage_2. Run the following commands to obtain the artifact information:
# Obtain the download address of the artifact. echo ${{ jobs.JOB_xZGhF.artifacts.demo.download_url }} # Obtain all information about the artifact. echo ${{ jobs.JOB_xZGhF.artifacts.demo }}
Figure 3 Adding the ExecuteShellCommand extension - Execute the pipeline. After the execution is successful, check the printed artifact information in the log.
Figure 4 Artifact information
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot