presidium 0.18.2 → 0.18.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DockerService.js +1 -2
- package/DockerService.test.js +24 -26
- package/package.json +1 -1
package/DockerService.js
CHANGED
|
@@ -134,10 +134,8 @@ DockerService.prototype.deploy = async function deploy() {
|
|
|
134
134
|
throw new Error(await response.text())
|
|
135
135
|
}
|
|
136
136
|
} else {
|
|
137
|
-
await this.synchronize()
|
|
138
137
|
await this.update(this.serviceOptions)
|
|
139
138
|
}
|
|
140
|
-
await this.synchronize()
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
// new DockerService().synchronize() -> Promise<>
|
|
@@ -193,6 +191,7 @@ DockerService.prototype.synchronize = function dockerServiceSynchronize() {
|
|
|
193
191
|
*/
|
|
194
192
|
|
|
195
193
|
DockerService.prototype.update = async function update(options) {
|
|
194
|
+
await this.synchronize()
|
|
196
195
|
return this.docker.updateService(this.name, {
|
|
197
196
|
...options,
|
|
198
197
|
spec: this.spec,
|
package/DockerService.test.js
CHANGED
|
@@ -39,32 +39,30 @@ const test = new Test('DockerService', DockerService)
|
|
|
39
39
|
assert.equal(info.Spec.RollbackConfig.MaxFailureRatio, 0.15)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})
|
|
67
|
-
}
|
|
42
|
+
await myService.update({
|
|
43
|
+
labels: { foo: 'bar' },
|
|
44
|
+
replicas: 2,
|
|
45
|
+
updateParallelism: 3,
|
|
46
|
+
updateDelay: 2e9,
|
|
47
|
+
updateFailureAction: 'continue',
|
|
48
|
+
updateMonitor: 30e9,
|
|
49
|
+
updateMaxFailureRatio: 0.3,
|
|
50
|
+
rollbackParallelism: 3,
|
|
51
|
+
rollbackDelay: 2e9,
|
|
52
|
+
rollbackFailureAction: 'continue',
|
|
53
|
+
rollbackMonitor: 30e9,
|
|
54
|
+
rollbackMaxFailureRatio: 0.3,
|
|
55
|
+
env: { FOO: 'foo' },
|
|
56
|
+
workdir: '/opt',
|
|
57
|
+
mounts: [{
|
|
58
|
+
source: 'other-volume',
|
|
59
|
+
target: '/opt/other-volume',
|
|
60
|
+
}],
|
|
61
|
+
publish: { 8080: 80 },
|
|
62
|
+
healthCmd: ['curl', '0.0.0.0:80'],
|
|
63
|
+
restart: 'on-failure:5',
|
|
64
|
+
memory: 512e6, // bytes
|
|
65
|
+
})
|
|
68
66
|
|
|
69
67
|
{
|
|
70
68
|
const info = await myService.inspect()
|