Hi! Has anyone had an issue where for the first t...
# general
f
Hi! Has anyone had an issue where for the first time merge request for Infracost comment works fine but during the second time this error occurs? fatal: destination path '/tmp/base' already exists and is not an empty directory. Any tip would be appreciated.
b
Hello! Based on our yesterday's discussion, it seems that your local machine already has
/tmp/base
directory after the first run and it's not cleaned up
To mitigate that you could add a last step to the pipeline config to delete this directory
Usually the pipeline job is running in a container, so the directory is located in there, and we don't need to worry about the cleanup as the container gets discarded.
After the line with
infracost comment gitlab
command you can add a new line with something like
- rm -rf /tmp/base
as a last step
FYI, this folder is created on
git clone
step to pull your base branch - it is needed to create a baseline for comparison
f
Looks like it worked in that form:
- Remove-Item -Recurse -Force /tmp/base
After the changes are made for existing merge request, will additional comment from Infracost appear?
b
Oh, sorry, I guess Windows should have a different command 🙂
The
infracost comment
command has a
--behavior
flag that supports 3 options:
new
,
update
,
delete-and-new
, where
update
is default. Update means it will update content of its latest comment
If you follow our example, its behavior is set to
update
f
I somehow missed this part. Hour by hour I like Infracost more and more 🤓
b
Hope you're enjoying using it 🙂