@@ -24,6 +24,7 @@ exec sudo -n env \
2424 "DOCKER_GIT_API_CONTAINER_NAME=${DOCKER_GIT_API_CONTAINER_NAME:-}" \
2525 "DOCKER_GIT_API_PORT=${DOCKER_GIT_API_PORT:-}" \
2626 "DOCKER_GIT_CONTROLLER_DOCKER_HOST=${DOCKER_GIT_CONTROLLER_DOCKER_HOST:-}" \
27+ "DOCKER_GIT_CONTROLLER_BUILD_SKILLER=${DOCKER_GIT_CONTROLLER_BUILD_SKILLER:-}" \
2728 "DOCKER_GIT_CONTROLLER_REV=${DOCKER_GIT_CONTROLLER_REV:-}" \
2829 "DOCKER_GIT_DOCKERD_DEFAULT_CGROUPNS_MODE=${DOCKER_GIT_DOCKERD_DEFAULT_CGROUPNS_MODE:-}" \
2930 "DOCKER_GIT_DOCKERD_TCP_HOST=${DOCKER_GIT_DOCKERD_TCP_HOST:-}" \
@@ -134,6 +135,35 @@ dg_ensure_node_gyp() {
134135 export PATH=" $node_gyp_bin :$PATH "
135136}
136137
138+ dg_is_truthy () {
139+ case " ${1:- } " in
140+ 1|true|TRUE|yes|YES|on|ON)
141+ return 0
142+ ;;
143+ * )
144+ return 1
145+ ;;
146+ esac
147+ }
148+
149+ dg_log_duration () {
150+ local label=" $1 "
151+ local started_at=" $2 "
152+ local finished_at
153+ finished_at=" $( date +%s) "
154+
155+ echo " e2e: ${label} completed in $(( finished_at - started_at)) s" >&2
156+ }
157+
158+ dg_workspace_install_ready () {
159+ local repo_root=" $1 "
160+
161+ [[ -d " $repo_root /node_modules" ]] \
162+ && [[ -x " $repo_root /packages/app/node_modules/.bin/vite" ]] \
163+ && [[ -x " $repo_root /packages/lib/node_modules/.bin/tsc" ]] \
164+ && [[ -x " $repo_root /packages/docker-git-session-sync/node_modules/.bin/vite" ]]
165+ }
166+
137167dg_pick_free_port () {
138168 local first_port=" $1 "
139169 local last_port=" $2 "
@@ -430,31 +460,56 @@ dg_project_ssh_to_container() {
430460dg_prepare_bun_workspace () {
431461 local repo_root=" $1 "
432462 local bin_dir=" $2 "
463+ local started_at
433464
434465 dg_ensure_bun
435466 dg_ensure_node_gyp " $bin_dir "
436467
468+ if dg_is_truthy " ${DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL:- 0} " && dg_workspace_install_ready " $repo_root " ; then
469+ echo " e2e: reusing existing Bun workspace install" >&2
470+ return 0
471+ fi
472+
473+ started_at=" $( date +%s) "
437474 (
438475 cd " $repo_root "
439476 bun install --no-save --silent
440477 )
478+ dg_log_duration " Bun workspace install" " $started_at "
441479}
442480
443481dg_build_docker_git_cli () {
444482 local repo_root=" $1 "
483+ local started_at
484+
485+ started_at=" $( date +%s) "
486+
487+ if dg_is_truthy " ${DOCKER_GIT_E2E_REUSE_WORKSPACE_INSTALL:- 0} " && dg_workspace_install_ready " $repo_root " ; then
488+ (
489+ cd " $repo_root "
490+ bun run --cwd packages/app build:docker-git:reuse-install
491+ )
492+ dg_log_duration " docker-git CLI build" " $started_at "
493+ return 0
494+ fi
445495
446496 (
447497 cd " $repo_root "
448498 bun run --cwd packages/app build:docker-git
449499 )
500+ dg_log_duration " docker-git CLI build" " $started_at "
450501}
451502
452503dg_prepare_docker_git_cli () {
453504 local repo_root=" $1 "
454505 local bin_dir=" $2 "
506+ local started_at
507+
508+ started_at=" $( date +%s) "
455509
456510 dg_prepare_bun_workspace " $repo_root " " $bin_dir "
457511 dg_build_docker_git_cli " $repo_root "
512+ dg_log_duration " prepare docker-git CLI" " $started_at "
458513}
459514
460515dg_run_docker_git () {
0 commit comments