Skip to content

Commit 56a1fff

Browse files
committed
deploy: 8466f0a
1 parent 99370b6 commit 56a1fff

4 files changed

Lines changed: 114 additions & 2 deletions

File tree

print.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,62 @@ <h1 id="introduction"><a class="header" href="#introduction">Introduction</a></h
192192
wing project discover ~/code --depth 2
193193
wing project import ~/code --dry-run
194194
</code></pre>
195+
<h2 id="where-a-project-lives"><a class="header" href="#where-a-project-lives">Where a project lives</a></h2>
196+
<p>A project is registered with the machine it is on. Nothing changes for projects on this machine —
197+
they simply have no host — but once a project is somewhere else, every question about it has two
198+
halves, and the registry answers both.</p>
199+
<pre><code class="language-sh">wing project add api --path /srv/api --machine lab
200+
wing project set api --machine local # move it back to this machine
201+
wing project list # the Host column
202+
wing project list --machine lab # only what is on lab
203+
wing project list --local
204+
wing hosts # which machines have projects, and how many
205+
</code></pre>
206+
<pre><code> Host Projects Languages
207+
local 9 nim, go, rust, zig
208+
lab 8 go, d, zig, v, rust, cpp, nim
209+
build 0
210+
</code></pre>
211+
<p>A machine with no projects still gets a row: "nothing here yet" and "no such machine" are different
212+
answers, and only one of them means you have not run discovery.</p>
213+
<h3 id="names-are-qualified-by-host"><a class="header" href="#names-are-qualified-by-host">Names are qualified by host</a></h3>
214+
<p>The same name on two machines is two projects — a <code>deploy</code> on the build server and a <code>deploy</code> here
215+
are not the same thing, and on a laptop that talks to five servers there will be several such pairs.
216+
So a project is addressed as <code>name</code>, or as <code>host:name</code> when the bare name is ambiguous:</p>
217+
<pre><code>$ wing where api
218+
'api' is on 2 machines: lab:api, local:api — name one of those instead
219+
</code></pre>
220+
<p>Both halves of that answer can be typed straight back in. <code>local:</code> names this machine.</p>
221+
<h2 id="finding-the-projects-on-a-machine"><a class="header" href="#finding-the-projects-on-a-machine">Finding the projects on a machine</a></h2>
222+
<pre><code class="language-sh">wing project discover ~/code --machine lab --depth 3 # look
223+
wing project discover ~/code --machine lab --register # and keep
224+
wing project discover ~/code --all-machines --register
225+
wing project discover ~/code --register # this machine
226+
</code></pre>
227+
<p>One <code>find</code> per machine, run over ssh, all machines at once — a round trip per candidate directory
228+
would take minutes. It looks for the markers that mean "a project is here" (<code>.git</code>, <code>Cargo.toml</code>,
229+
<code>go.mod</code>, <code>*.nimble</code>, <code>pyproject.toml</code>, <code>v.mod</code>, <code>*.cabal</code>, <code>.make.lua</code> and the rest) and folds the
230+
several markers a polyglot project has into one entry.</p>
231+
<p>Without <code>--register</code> it prints what it found and keeps nothing, so a scan can be looked at before it
232+
becomes registry entries. Registration merges rather than replaces: re-running discovery is how the
233+
registry stays true, so it has to be safe to repeat, and a machine that is switched off does not
234+
lose its projects.</p>
235+
<h2 id="getting-into-a-project"><a class="header" href="#getting-into-a-project">Getting into a project</a></h2>
236+
<pre><code class="language-sh">wing ssh api # a shell in the project, wherever it is
237+
wing ssh lab:api # …on that machine specifically
238+
wing ssh lab # just the machine
239+
wing ssh lab:api -- 'git status'
240+
wing ssh api --cd src # start somewhere else
241+
wing where api # print the path (local) or the ssh command (remote)
242+
</code></pre>
243+
<p><code>wing ssh</code> takes a machine or a project. On a remote project it opens a login shell already inside
244+
the directory — one lookup and one <code>cd</code>, and it is the same command whether the project turns out to
245+
be here or three machines away. On a local project it is a shell in that directory.</p>
246+
<p>A bare name is read as a machine first, since <code>wing ssh lab</code> reads as a machine; <code>--project</code> says
247+
otherwise and <code>host:name</code> is never ambiguous.</p>
248+
<p><code>wing where</code> prints instead of entering, which is what a shell function wants:</p>
249+
<pre><code class="language-sh">cd "$(wing where api)" # for a local project
250+
</code></pre>
195251
<div style="break-before: page; page-break-before: always;"></div><h1 id="machines"><a class="header" href="#machines">Machines</a></h1>
196252
<p>Machines store SSH targets and host interfaces, and drive a tight SSH
197253
integration: <code>connect</code>, <code>check --ssh</code>, and <code>sync</code> all reuse one <strong>ControlMaster

projects.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,62 @@ <h1 id="projects"><a class="header" href="#projects">Projects</a></h1>
161161
wing project set api --framework cobra
162162
wing project discover ~/code --depth 2
163163
wing project import ~/code --dry-run
164+
</code></pre>
165+
<h2 id="where-a-project-lives"><a class="header" href="#where-a-project-lives">Where a project lives</a></h2>
166+
<p>A project is registered with the machine it is on. Nothing changes for projects on this machine —
167+
they simply have no host — but once a project is somewhere else, every question about it has two
168+
halves, and the registry answers both.</p>
169+
<pre><code class="language-sh">wing project add api --path /srv/api --machine lab
170+
wing project set api --machine local # move it back to this machine
171+
wing project list # the Host column
172+
wing project list --machine lab # only what is on lab
173+
wing project list --local
174+
wing hosts # which machines have projects, and how many
175+
</code></pre>
176+
<pre><code> Host Projects Languages
177+
local 9 nim, go, rust, zig
178+
lab 8 go, d, zig, v, rust, cpp, nim
179+
build 0
180+
</code></pre>
181+
<p>A machine with no projects still gets a row: "nothing here yet" and "no such machine" are different
182+
answers, and only one of them means you have not run discovery.</p>
183+
<h3 id="names-are-qualified-by-host"><a class="header" href="#names-are-qualified-by-host">Names are qualified by host</a></h3>
184+
<p>The same name on two machines is two projects — a <code>deploy</code> on the build server and a <code>deploy</code> here
185+
are not the same thing, and on a laptop that talks to five servers there will be several such pairs.
186+
So a project is addressed as <code>name</code>, or as <code>host:name</code> when the bare name is ambiguous:</p>
187+
<pre><code>$ wing where api
188+
'api' is on 2 machines: lab:api, local:api — name one of those instead
189+
</code></pre>
190+
<p>Both halves of that answer can be typed straight back in. <code>local:</code> names this machine.</p>
191+
<h2 id="finding-the-projects-on-a-machine"><a class="header" href="#finding-the-projects-on-a-machine">Finding the projects on a machine</a></h2>
192+
<pre><code class="language-sh">wing project discover ~/code --machine lab --depth 3 # look
193+
wing project discover ~/code --machine lab --register # and keep
194+
wing project discover ~/code --all-machines --register
195+
wing project discover ~/code --register # this machine
196+
</code></pre>
197+
<p>One <code>find</code> per machine, run over ssh, all machines at once — a round trip per candidate directory
198+
would take minutes. It looks for the markers that mean "a project is here" (<code>.git</code>, <code>Cargo.toml</code>,
199+
<code>go.mod</code>, <code>*.nimble</code>, <code>pyproject.toml</code>, <code>v.mod</code>, <code>*.cabal</code>, <code>.make.lua</code> and the rest) and folds the
200+
several markers a polyglot project has into one entry.</p>
201+
<p>Without <code>--register</code> it prints what it found and keeps nothing, so a scan can be looked at before it
202+
becomes registry entries. Registration merges rather than replaces: re-running discovery is how the
203+
registry stays true, so it has to be safe to repeat, and a machine that is switched off does not
204+
lose its projects.</p>
205+
<h2 id="getting-into-a-project"><a class="header" href="#getting-into-a-project">Getting into a project</a></h2>
206+
<pre><code class="language-sh">wing ssh api # a shell in the project, wherever it is
207+
wing ssh lab:api # …on that machine specifically
208+
wing ssh lab # just the machine
209+
wing ssh lab:api -- 'git status'
210+
wing ssh api --cd src # start somewhere else
211+
wing where api # print the path (local) or the ssh command (remote)
212+
</code></pre>
213+
<p><code>wing ssh</code> takes a machine or a project. On a remote project it opens a login shell already inside
214+
the directory — one lookup and one <code>cd</code>, and it is the same command whether the project turns out to
215+
be here or three machines away. On a local project it is a shell in that directory.</p>
216+
<p>A bare name is read as a machine first, since <code>wing ssh lab</code> reads as a machine; <code>--project</code> says
217+
otherwise and <code>host:name</code> is never ambiguous.</p>
218+
<p><code>wing where</code> prints instead of entering, which is what a shell function wants:</p>
219+
<pre><code class="language-sh">cd "$(wing where api)" # for a local project
164220
</code></pre>
165221

166222
</main>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)