-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/preview:build: Clean git repository before performing build #14156
Conversation
Add additional build args
# We should fix the package definitions so that they don't include these files in the hash. | ||
# | ||
# For now we're simply cleaning the repository by deleting all files that are in .gitignore. | ||
git clean -dfX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this only in werft, as otherwise it might nuke changes/files that have not been added yet if you run it from a ws
git clean -dfX | |
if [[ -n ${WERFT_SERVICE_HOST+x} ]]; then | |
git clean -dfX | |
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only really needed outside of Werft though - I don't think it will remove changed files (will test), but you're right it would delete files that are not yet tracked by git! Let me see if I can't narrow it down to only cover "ignored files"
# The files were produced using "git clean -ndfX" | ||
components_dir="$SCRIPT_PATH/../../../../components" | ||
install_dir="$SCRIPT_PATH/../../../../install" | ||
rm -rf \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an ephemeral workspace, what's the worst that could happen 😉 Kidding aside, I'm only okay with this because we're going to remove it soon when we fix the real issue in #14157
Description
It turns out that the "cache miss" we were seeing from Gitpod Workspaces is due to some of our packages being sensitive to a "dirty filesystem". As a temporary solution I'm using
git clean
(see comment in code) but we should go through each component and see if we can make sure it isn't impacted by the occurrence of files that we have in .gitignore (such as build folders) - I have created an issue (#14157) and proposed it for next week.This PR also adds a few more build arguments to align with the Leeway invocation performed by Werft to make it easier to merge the two as part of https://github.com/gitpod-io/ops/issues/5894
Related Issue(s)
Fixes #13767
How to test
Release Notes
Documentation
N/A
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide