Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
25bb1b85
Unverified
Commit
25bb1b85
authored
3 years ago
by
Isabel Suchanek
Browse files
Options
Download
Email Patches
Plain Diff
Check for noop/no target rollback
parent
e380c8f9
Branches unavailable
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
command/deployment_status.go
+21
-9
command/deployment_status.go
with
21 additions
and
9 deletions
+21
-9
command/deployment_status.go
+
21
-
9
View file @
25bb1b85
...
...
@@ -435,6 +435,10 @@ func (c *DeploymentStatusCommand) ttyMonitor(client *api.Client, deployID string
WaitTime
:
2
*
time
.
Second
,
}
var
statusComponent
*
glint
.
LayoutComponent
var
endSpinner
*
glint
.
LayoutComponent
UPDATE
:
for
{
deploy
,
meta
,
err
:=
client
.
Deployments
()
.
Info
(
deployID
,
&
q
)
if
err
!=
nil
{
...
...
@@ -447,7 +451,6 @@ func (c *DeploymentStatusCommand) ttyMonitor(client *api.Client, deployID string
}
status
:=
deploy
.
Status
var
statusComponent
*
glint
.
LayoutComponent
statusComponent
=
glint
.
Layout
(
glint
.
Text
(
""
),
glint
.
Text
(
formatTime
(
time
.
Now
())),
...
...
@@ -488,7 +491,7 @@ func (c *DeploymentStatusCommand) ttyMonitor(client *api.Client, deployID string
statusComponent
=
glint
.
Layout
(
statusComponent
)
.
MarginLeft
(
4
)
d
.
Set
(
spinner
,
statusComponent
)
endSpinner
:
=
glint
.
Layout
(
endSpinner
=
glint
.
Layout
(
components
.
Spinner
(),
glint
.
Text
(
fmt
.
Sprintf
(
" Deployment %q %s"
,
limit
(
deployID
,
length
),
status
)),
)
.
Row
()
.
MarginLeft
(
2
)
...
...
@@ -503,8 +506,6 @@ func (c *DeploymentStatusCommand) ttyMonitor(client *api.Client, deployID string
glint
.
Layout
(
glint
.
Text
(
""
)),
)
// Check no stable version to rollback to
// Check rollback != current deployID
// Wait for rollback to launch
time
.
Sleep
(
1
*
time
.
Second
)
rollback
,
_
,
err
:=
client
.
Jobs
()
.
LatestDeployment
(
deploy
.
JobID
,
nil
)
...
...
@@ -518,25 +519,36 @@ func (c *DeploymentStatusCommand) ttyMonitor(client *api.Client, deployID string
return
}
// Check for noop/no target rollbacks
if
rollback
.
ID
==
deploy
.
ID
{
break
UPDATE
}
d
.
Close
()
c
.
ttyMonitor
(
client
,
rollback
.
ID
,
index
,
verbose
)
}
else
{
// Render one final time with completion message
d
.
Set
(
endSpinner
,
statusComponent
)
d
.
RenderFrame
()
// d.Set(endSpinner, statusComponent)
// d.RenderFrame()
break
UPDATE
}
return
case
structs
.
DeploymentStatusSuccessful
,
structs
.
DeploymentStatusCancelled
,
structs
.
DeploymentStatusDescriptionBlocked
:
// Render one final time with completion message
d
.
Set
(
endSpinner
,
statusComponent
)
d
.
RenderFrame
()
return
// d.Set(endSpinner, statusComponent)
// d.RenderFrame()
// return
break
UPDATE
default
:
q
.
WaitIndex
=
meta
.
LastIndex
continue
}
}
d
.
Set
(
endSpinner
,
statusComponent
)
d
.
RenderFrame
()
// return
}
// Used for Windows and non-tty
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help