carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1{{define "ladder"}}
2{{if $.Detail.Pipeline}}
3<h2>Pipeline</h2>
4<p class="small">Every version moves through these channels in order — the first is where
5<code>carlos deploy</code> lands. Promoting moves it one step up; whatever follows that step
6picks it up. Each channel's own rules, not a fixed name, decide what it takes to get there.</p>
7{{else}}
8<h2>The ladder</h2>
9<p class="small">Every version climbs the same steps — canary (test) → edge → beta → stable (live).
10Promoting moves it one step up; whatever follows that step picks it up.</p>
11{{with .Detail.Production}}
12<div class="bake">
13 {{if .Err}}
14 <p class="small error">Safety delay: this app's setting can't be read right now, so the delay stays on.
15 {{if $.CanPromote}}
16 <form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/production" class="inline">
17 <input type="hidden" name="csrf" value="{{$.CSRF}}">
18 <input type="hidden" name="production" value="on">
19 <button type="submit" class="linkish">Set it again</button>
20 </form>
21 — writes a fresh signed flag over the unreadable one.
22 {{end}}
23 </p>
24 {{else if .On}}
25 <p class="small">Safety delay: <strong>on</strong> — new versions wait ~24h on beta and ~72h on live before they go live.
26 {{if and $.CanPromote $.IsOwner}}
27 <form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/production" class="inline">
28 <input type="hidden" name="csrf" value="{{$.CSRF}}">
29 <input type="hidden" name="production" value="off">
30 <button type="submit" class="linkish">Turn off</button>
31 </form>
32 <span class="small">Turning it off asks for your passkey and takes effect after ~72h.</span>
33 {{end}}
34 </p>
35 {{else if .TurningOff}}
36 <p class="small">Safety delay: <strong>turning off</strong> — in effect until ~{{fmtTime .EffectiveAt}}.
37 {{if $.CanPromote}}
38 <form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/production" class="inline">
39 <input type="hidden" name="csrf" value="{{$.CSRF}}">
40 <input type="hidden" name="production" value="on">
41 <button type="submit" class="linkish">Turn back on</button>
42 </form>
43 {{end}}
44 </p>
45 {{else}}
46 <p class="small">Safety delay: off — new versions go live as soon as they're promoted.
47 {{if $.CanPromote}}
48 <form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/production" class="inline">
49 <input type="hidden" name="csrf" value="{{$.CSRF}}">
50 <input type="hidden" name="production" value="on">
51 <button type="submit" class="linkish">Turn on</button>
52 </form>
53 {{end}}
54 </p>
55 {{end}}
56 {{if .Nudge}}
57 <p class="small nudge">{{icon "triangle-alert"}} This app looks like it's serving real users but new versions go live immediately — consider turning the safety delay on.</p>
58 {{end}}
59</div>
60{{end}}
61{{end}}
62<ol class="ladder">
63 {{range .Detail.Ladder}}
64 <li class="rung" id="rung-{{.Rung}}">
65 <p class="rung-name">{{.Rung}}</p>
66 {{if .Channels}}
67 {{range .Channels}}
68 <div class="rung-channel">
69 {{if .Err}}
70 <p class="error"><code>{{.Channel}}</code> — {{.Err}}</p>
71 {{else}}
72 <p><code>{{.Channel}}</code> holds <code>{{.Version}}</code>
73 <span class="small" title="{{fmtTime .PromotedAt}}">promoted {{ago .PromotedAt}}{{if .Actor}} by {{.Actor}}{{end}}</span>
74 {{if .Hotfix}}<span class="chip chip-stale">{{icon "zap"}} published directly — skipped the pipeline</span>{{end}}
75 {{if .FastTrack}}<span class="chip chip-stale">{{icon "fast-forward"}} delay skipped</span>{{end}}</p>
76 {{if and (not .BakedUntil.IsZero) $.CanPromote $.IsOwner}}
77 <form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/fasttrack" class="inline">
78 <input type="hidden" name="csrf" value="{{$.CSRF}}">
79 <input type="hidden" name="channel" value="{{.Channel}}">
80 <button type="submit" class="btn-sm btn-danger">Skip the delay for {{.Version}}</button>
81 </form>
82 <span class="small">goes live {{until .BakedUntil}}</span>
83 {{end}}
84 {{end}}
85 {{if .Routes}}
86 <ul class="routes">
87 {{range .Routes}}
88 <li><a href="https://{{.Host}}">{{.Host}}</a>
89 <span class="chip chip-env">{{icon "layers"}} {{if .Environment}}{{.Environment}}{{else}}default{{end}}</span>
90 {{if .ProdWired}}<span class="chip chip-prod">{{icon "triangle-alert"}} canary in front of everybody</span>
91 {{else if .Canary}}<span class="chip chip-canary">{{icon "flask-conical"}} canary</span>{{end}}
92 {{if .Expired}}<span class="chip chip-expired">{{icon "hourglass"}} expired {{.ExpiredFor}}</span>{{end}}
93 {{if .Caps}}<span class="small">granted: {{.Caps}}</span>{{end}}
94 </li>
95 {{end}}
96 </ul>
97 {{else}}
98 <p class="small">Nothing follows this channel yet.</p>
99 {{end}}
100 </div>
101 {{end}}
102 {{else}}
103 <p class="small">Nothing on {{.Rung}}.</p>
104 {{end}}
105 <p class="small gate">{{.Gate}}</p>
106 {{if .Up}}
107 <div class="step">
108 {{icon "arrow-down"}}
109 {{if and .Up.Version $.CanPromote (or $.Detail.Pipeline $.IsOwner)}}
110 <form method="post" action="{{$.Base}}/apps/{{$.Detail.App}}/promote">
111 <input type="hidden" name="csrf" value="{{$.CSRF}}">
112 <input type="hidden" name="channel" value="{{.Up.To}}">
113 <input type="hidden" name="version" value="{{.Up.Version}}">
114 <button type="submit" class="btn-sm">Promote {{.Up.Version}} to {{.Up.To}}</button>
115 </form>
116 {{else if .Up.Note}}
117 <span class="small">{{.Up.Note}}</span>
118 {{else}}
119 <span class="small">Only an account owner can promote to {{.Up.To}}.</span>
120 {{end}}
121 </div>
122 {{end}}
123 </li>
124 {{end}}
125</ol>
126{{end}}
127