I have a situation where in 2 Stages in a Jenkinsfile
I have to do the following things:
- Push a Docker image to artifactory. This push is to a folder on artifactory where I cannot delete that pushed image easily (a lot of process is involved to get that deleted).
- Committing/ Merging changes to the master repo on GitLab, within the stage itself (and not through an MR).
These 2 stages are connected to each other i.e. if Stage 1 has executed, then Stage 2 has to be executed.
So, you can understand these 2 stages are critical as in, they are making almost permanent changes to main folders and repos.
- If Stage 1 fails (due to random flaky or connectivity issues), we want to re-run stage 1, and then continue with the job to stage 2
- Also if Stage 1 has been executed successfully, but Stage 2 has failed, then I only want to run Stage 2 again.
Can someone suggest what can be done for this?