Skip to content

dev/preview:build: Clean git repository before performing build #14156

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

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion dev/preview/workflow/preview/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,57 @@ ensure_gcloud_auth

VERSION="$(preview-name-from-branch)-dev"

# We have quite a few Leeway packages whose hash includes files from .gitignore.
# Some of these files (such as build folders) are populated as part of our prebuilds
# which means that the hash for these components will be different from a workspace
# then in CI.
#
# 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.
# The files were produced using "git clean -ndfX"
components_dir="$SCRIPT_PATH/../../../../components"
install_dir="$SCRIPT_PATH/../../../../install"
rm -rf \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

Copy link
Contributor Author

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 ☺️

"$components_dir/content-service-api/typescript/lib/" \
"$components_dir/dashboard/build/" \
"$components_dir/ee/db-sync/lib/" \
"$components_dir/ee/payment-endpoint/lib/" \
"$components_dir/gitpod-db/lib/" \
"$components_dir/gitpod-messagebus/lib/" \
"$components_dir/gitpod-protocol/lib/" \
"$components_dir/ide-metrics-api/typescript-grpc/lib/" \
"$components_dir/ide-metrics-api/typescript-grpcweb/lib/" \
"$components_dir/ide-service-api/typescript/lib/" \
"$components_dir/image-builder-api/typescript/lib/" \
"$components_dir/licensor/typescript/build/" \
"$components_dir/licensor/typescript/ee/lib/" \
"$components_dir/licensor/typescript/lib/" \
"$components_dir/local-app-api/typescript-grpcweb/lib/" \
"$components_dir/public-api/typescript/lib/" \
"$components_dir/server/dist/" \
"$components_dir/supervisor-api/typescript-grpc/lib/" \
"$components_dir/supervisor-api/typescript-grpcweb/lib/" \
"$components_dir/supervisor/frontend/dist/" \
"$components_dir/supervisor/frontend/lib/" \
"$components_dir/usage-api/typescript/lib/" \
"$components_dir/ws-daemon-api/typescript/lib/" \
"$components_dir/ws-manager-api/typescript/lib/" \
"$components_dir/ws-manager-bridge-api/typescript/lib/" \
"$components_dir/ws-manager-bridge/dist/" \
"$install_dir/installer/third_party/charts/docker-registry/Chart.lock" \
"$install_dir/installer/third_party/charts/docker-registry/charts/" \
"$install_dir/installer/third_party/charts/minio/Chart.lock" \
"$install_dir/installer/third_party/charts/minio/charts/" \
"$install_dir/installer/third_party/charts/mysql/Chart.lock" \
"$install_dir/installer/third_party/charts/mysql/charts/" \
"$install_dir/installer/third_party/charts/rabbitmq/Chart.lock" \
"$install_dir/installer/third_party/charts/rabbitmq/charts/"

leeway build \
-DSEGMENT_IO_TOKEN="" \
-DSEGMENT_IO_TOKEN="$(kubectl --context=dev -n werft get secret self-hosted -o jsonpath='{.data.segmentIOToken}' | base64 -d)" \
-DREPLICATED_API_TOKEN="$(kubectl --context=dev -n werft get secret replicated -o jsonpath='{.data.token}' | base64 -d)" \
-DREPLICATED_APP="$(kubectl --context=dev -n werft get secret replicated -o jsonpath='{.data.app}' | base64 -d)" \
-Dversion="${VERSION}" \
--dont-retag \
--dont-test \
Expand Down