Help Center/
CodeArts Pipeline/
User Guide/
Reference/
Pipeline Contexts/
Example 2: Obtaining Artifact Information Using the Pipeline Context
Updated on 2024-12-16 GMT+08:00
Example 2: Obtaining Artifact Information Using the Pipeline Context
You can use the Build extension to generate an artifact and reference it via context in the ExecuteShellCommand job to retrieve the artifact information.
- 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
Parent topic: Pipeline Contexts
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot