I’m trying to use the
new_octopusartifact bash function to capture an artefact, but the process is failing.
I first set about proving that the file exists (and can be read, as per the documentation) both before and after
new_octopusartifact, though I noted that in the logs the warning doesn’t appear until the very end of the step.
So looking at the raw logs I found the following -
10:34:23 Info | -rw-r--r-- 1 root root 26123 Mar 29 10:34 destroy.tfplan 10:34:23 Info | Collecting destroy.tfplan as an artifact... 10:34:23 Verbose | Artifact destroy.tfplan will be collected from destroy.tfplan after this step completes 10:34:23 Info | -rw-r--r-- 1 root root 26123 Mar 29 10:34 destroy.tfplan 10:34:23 Verbose | Process /bin/bash in /home/Octopus/Work/20210329103321-938794-32 exited with code 0 10:34:23 Verbose | Collecting artifact destroy.tfplan 10:34:23 Warning | Artifact destroy.tfplan not found at path 'destroy.tfplan'. This can happen if the file is deleted before the task completes.
Notice that there is a
Verbose log message stating -
Artifact destroy.tfplan will be collected from destroy.tfplan after this step completes
Given I’m using a docker container to execute the script, and that the container will be removed after script execution is complete, how can I capture an artefact?