'Why Google Cloud Build is passing data between steps without any configuration in cloudbuild.yaml file
Refer to Google Cloud documentation Passing data between build steps
It says -
Cloud Build runs your tasks as a series of build steps, which execute in isolated and containerized environments. After each step, the container is discarded. This allows you to have totally different tools and environments for each step, and by default, any data created in one step can't contaminate the next step. But sometimes you may need to persist state from one step of a build to use in subsequent steps.
Now refer to the below cloudbuild.yaml code from Google Cloud Documentation example.
steps:
# Step 1
- name: node
entrypoint: npm
args: ['install']
# Step 2
- name: node
entrypoint: npm
args: ['test']
Question: Why and how the above example runs successfully even if we don’t have a step to install the requirements again in step 2. Because as per my thinking, the step 2 should get fail (but it is not actually) as the installations done in step 1 should get discarded as per the documentation. Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
