diff --git a/Makefile b/Makefile index fe7b52b8f8b96c69dcd6fe42de8026ed92fabf2d..805ef5175c50f66b2e398b9465e124c1c31bc9d3 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ list: # .PHONY: all all: preflight-checks \ +gdk_bundle_install \ gitlab/.git \ gitlab-shell-setup \ gitlab-setup \ @@ -126,6 +127,7 @@ install: start-task all post-install-task start # Pull `gitlab` directory first, since its dependencies are linked from there. .PHONY: update update: start-task \ +gdk_bundle_install \ gitlab/.git/pull \ gitlab-update \ platform-update \ diff --git a/lib/gdk/command/update.rb b/lib/gdk/command/update.rb index 1c1f74c995fb3b4e431cf8b10f2f85afed69890d..42689a7cdad23c3c61b07af6dc273e3af866f519 100644 --- a/lib/gdk/command/update.rb +++ b/lib/gdk/command/update.rb @@ -23,12 +23,11 @@ def run(_args = []) def update! GDK::Hooks.with_hooks(config.gdk.update_hooks, 'gdk update') do - if self_update? - GDK.make('self-update') - GDK.make('self-update', 'update', env: update_env).success? - else - GDK.make('update', env: update_env).success? - end + # Run `self-update` first to make sure Makefiles are up-to-date. + # This ensures the next `make update` call works with the latest updates and instructions. + GDK.make('self-update') if self_update? + + GDK.make('update', env: update_env).success? end end diff --git a/spec/lib/gdk/command/update_spec.rb b/spec/lib/gdk/command/update_spec.rb index 3d33b4e47b0cddb2d1e1e83e6433f1520908a2cf..2685ccbc0f81343b415dd47a12af08c6eb9fff91 100644 --- a/spec/lib/gdk/command/update_spec.rb +++ b/spec/lib/gdk/command/update_spec.rb @@ -14,7 +14,7 @@ context 'when self-update is enabled' do it 'runs self-update and update' do expect(GDK).to receive(:make).with('self-update') - expect(GDK).to receive(:make).with('self-update', 'update', env: env) + expect(GDK).to receive(:make).with('update', env: env) subject.run end