You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Does the command make build from the first step build a Docker image that you want to use on the second step? If so, you can do this with cache, if these two steps are part of the same pipeline and if they are not parallel. In order to do this, you can add the following to both of the two steps you posted here (Caches documentation):
I would suggest including the command make build in the second step as well. Caches get cleared automatically 1 week after they are created. It is also possible for users to manually remove the cache from the Pipelines page of the repo. The second step you shared here is manual, so if any of these two things happen before you trigger the second step and the cache is not present, the second step will fail. Adding the command make build in the second step will ensure that the step doesn't fail because of a missing cache. If the cache is present, then the make build command in the second step will use the existing cache and the build will be faster.
If you have any questions, please feel free to reach out.
I tried using using cache docker previously but the commit ID in ECR is being committed twice for eg for 1st time commit is 1234 it pushes to ECR with image:1234
but when I commit 2nd time is how image:1234,567 .Commit ID logic written inside make build
due to cache 1234 is also coming in next push
Thank you for reaching out. I'm not sure I understand what is happening, as I don't know what exactly your make commands are doing.
There is another option, you could use artifacts instead of cache. An example:
name: Build docker image
- docker build -t repo/imagename .
- docker save --output tmp-image.docker repo/imagename
name: Deploy docker image
- docker load --input ./tmp-image.docker
- docker images
In this example, I have added the docker build and docker save commands in the script of my first step, but you can include them both in the Makefile that the make command is using.
In the first step, I have defined as an artifact the file that the docker save command produces. Files defined as artifacts will be available for the next steps (as long as the steps are not parallel).
Then, in the second step, the docker load command will load the image from the artifact produced in the first step. With this approach, you don't have to build the image again in the second step.
Please feel free to let me know if this works for you.
If you still experience issues, it would be useful to have the build log from both steps and a description of what is the undesired behavior in this build log. You can download the build log for each step from our website: while viewing the build log for each step, there is an option to download it at the top right corner. Please make sure to sanitize any private/sensitive data prior to sharing here.
If you don't feel comfortable sharing build logs here, you can create a ticket with the support team (which will be visible only to you and Atlassian staff), and share more details and the build URL there. You can create a ticket via https://support.atlassian.com/contact/#/, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.
Please feel free to let me know if you have any questions.