@sprucelabs/spruce-deploy-plugin 62.2.23 → 62.2.25
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/package.json +10 -10
- package/build/__tests__/behavioral/CheckingHealth.test.d.ts +0 -10
- package/build/__tests__/behavioral/CheckingHealth.test.js +0 -117
- package/build/esm/__tests__/behavioral/CheckingHealth.test.d.ts +0 -10
- package/build/esm/__tests__/behavioral/CheckingHealth.test.js +0 -134
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "62.2.
|
|
6
|
+
"version": "62.2.25",
|
|
7
7
|
"files": [
|
|
8
8
|
"build/**/*",
|
|
9
9
|
"!build/__tests__",
|
|
@@ -62,22 +62,22 @@
|
|
|
62
62
|
"lint.tsc": "tsc -p . --noEmit"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@sprucelabs/error": "^6.0.
|
|
65
|
+
"@sprucelabs/error": "^6.0.67",
|
|
66
66
|
"@sprucelabs/schema": "^30.0.109",
|
|
67
|
-
"@sprucelabs/spruce-skill-booter": "^62.2.
|
|
68
|
-
"@sprucelabs/spruce-skill-utils": "^31.0.
|
|
67
|
+
"@sprucelabs/spruce-skill-booter": "^62.2.25",
|
|
68
|
+
"@sprucelabs/spruce-skill-utils": "^31.0.127",
|
|
69
69
|
"heroku-client": "^3.1.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@sprucelabs/esm-postbuild": "^6.0.
|
|
73
|
-
"@sprucelabs/jest-json-reporter": "^8.0.
|
|
74
|
-
"@sprucelabs/resolve-path-aliases": "^2.0.
|
|
72
|
+
"@sprucelabs/esm-postbuild": "^6.0.51",
|
|
73
|
+
"@sprucelabs/jest-json-reporter": "^8.0.70",
|
|
74
|
+
"@sprucelabs/resolve-path-aliases": "^2.0.46",
|
|
75
75
|
"@sprucelabs/semantic-release": "^5.0.1",
|
|
76
|
-
"@sprucelabs/test": "^9.0.
|
|
76
|
+
"@sprucelabs/test": "^9.0.32",
|
|
77
77
|
"@sprucelabs/test-utils": "^5.1.2",
|
|
78
78
|
"chokidar-cli": "^3.0.0",
|
|
79
79
|
"eslint": "^9.5.0",
|
|
80
|
-
"eslint-config-spruce": "^11.2.
|
|
80
|
+
"eslint-config-spruce": "^11.2.25",
|
|
81
81
|
"jest": "^29.7.0",
|
|
82
82
|
"jest-circus": "^29.7.0",
|
|
83
83
|
"prettier": "^3.3.2",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "c477b55a1974aa716dcccea98b36d0fb8976317b"
|
|
107
107
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import AbstractDeployTest from '../../tests/AbstractDeployTest';
|
|
2
|
-
export default class CheckingHealthTest extends AbstractDeployTest {
|
|
3
|
-
protected static pluginReturnsInstance(): Promise<void>;
|
|
4
|
-
protected static registersWithSkill(): Promise<void>;
|
|
5
|
-
protected static givesBackEmptyHealthByDefault(): Promise<void>;
|
|
6
|
-
protected static failsHealthCheckWithBadApp(): Promise<void>;
|
|
7
|
-
protected static getsBackHealtCheckShowingNotDeployed(): Promise<void>;
|
|
8
|
-
protected static healthCheckChecksDeployStatus(): Promise<void>;
|
|
9
|
-
protected static killingASkillKillsDeploy(): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
|
-
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
14
|
-
const deploy_plugin_1 = __importDefault(require("../../plugins/deploy.plugin"));
|
|
15
|
-
const AbstractDeployTest_1 = __importDefault(require("../../tests/AbstractDeployTest"));
|
|
16
|
-
const APP_NAME_NEVER_DEPLOYED = 'spruce-test-app';
|
|
17
|
-
const APP_NAME_DEPLOYED = 'sb-skill-schrutebucks-pos';
|
|
18
|
-
const APP_NAME_BAD_APP = 'spruce-test-app-bad';
|
|
19
|
-
const WEB_URL_NEVER_DEPLOYED = 'https://spruce-test-app.herokuapp.com/';
|
|
20
|
-
const WEB_URL_DEPLOYED = 'https://sb-skill-schrutebucks-pos.herokuapp.com/';
|
|
21
|
-
class CheckingHealthTest extends AbstractDeployTest_1.default {
|
|
22
|
-
static async pluginReturnsInstance() {
|
|
23
|
-
test_utils_1.assert.isTruthy(deploy_plugin_1.default instanceof Function);
|
|
24
|
-
}
|
|
25
|
-
static async registersWithSkill() {
|
|
26
|
-
const skill = await this.Skill();
|
|
27
|
-
const features = skill.getFeatures();
|
|
28
|
-
test_utils_1.assert.isLength(features, 1);
|
|
29
|
-
}
|
|
30
|
-
static async givesBackEmptyHealthByDefault() {
|
|
31
|
-
const skill = await this.Skill();
|
|
32
|
-
const health = await skill.checkHealth();
|
|
33
|
-
test_utils_1.assert.isTruthy(health.deploy);
|
|
34
|
-
test_utils_1.assert.isEqual(health.deploy.status, 'passed');
|
|
35
|
-
test_utils_1.assert.isArray(health.deploy.deploys);
|
|
36
|
-
test_utils_1.assert.isLength(health.deploy.deploys, 0);
|
|
37
|
-
}
|
|
38
|
-
static async failsHealthCheckWithBadApp() {
|
|
39
|
-
process.env.HEROKU_APP_NAME = APP_NAME_BAD_APP;
|
|
40
|
-
process.env.HEROKU_API_TOKEN = process.env.TEST_HEROKU_API_TOKEN;
|
|
41
|
-
process.env.HEROKU_TEAM_NAME = 'sprucelabs';
|
|
42
|
-
const skill = await this.Skill();
|
|
43
|
-
const health = await skill.checkHealth();
|
|
44
|
-
test_utils_1.assert.isTruthy(health.deploy);
|
|
45
|
-
test_utils_1.assert.isEqual(health.deploy.status, 'failed');
|
|
46
|
-
test_utils_1.assert.isArray(health.deploy.deploys);
|
|
47
|
-
test_utils_1.assert.isLength(health.deploy.deploys, 0);
|
|
48
|
-
test_utils_1.assert.isArray(health.deploy.errors);
|
|
49
|
-
const err = health.deploy.errors[0];
|
|
50
|
-
test_utils_2.errorAssert.assertError(err, 'HEROKU_ERROR');
|
|
51
|
-
}
|
|
52
|
-
static async getsBackHealtCheckShowingNotDeployed() {
|
|
53
|
-
process.env.HEROKU_APP_NAME = APP_NAME_NEVER_DEPLOYED;
|
|
54
|
-
process.env.HEROKU_API_TOKEN = process.env.TEST_HEROKU_API_TOKEN;
|
|
55
|
-
process.env.HEROKU_TEAM_NAME = 'sprucelabs';
|
|
56
|
-
const skill = await this.Skill();
|
|
57
|
-
const health = await skill.checkHealth();
|
|
58
|
-
test_utils_1.assert.isTruthy(health.deploy);
|
|
59
|
-
test_utils_1.assert.isEqual(health.deploy.status, 'passed');
|
|
60
|
-
test_utils_1.assert.isArray(health.deploy.deploys);
|
|
61
|
-
test_utils_1.assert.isLength(health.deploy.deploys, 1);
|
|
62
|
-
test_utils_1.assert.isFalsy(health.deploy.errors);
|
|
63
|
-
test_utils_1.assert.isEqualDeep(health.deploy.deploys, [
|
|
64
|
-
{
|
|
65
|
-
provider: 'heroku',
|
|
66
|
-
name: APP_NAME_NEVER_DEPLOYED,
|
|
67
|
-
webUrl: WEB_URL_NEVER_DEPLOYED,
|
|
68
|
-
isDeployed: false,
|
|
69
|
-
},
|
|
70
|
-
]);
|
|
71
|
-
}
|
|
72
|
-
static async healthCheckChecksDeployStatus() {
|
|
73
|
-
process.env.HEROKU_APP_NAME = APP_NAME_DEPLOYED;
|
|
74
|
-
process.env.HEROKU_API_TOKEN = process.env.TEST_HEROKU_API_TOKEN;
|
|
75
|
-
const skill = await this.Skill();
|
|
76
|
-
const health = await skill.checkHealth();
|
|
77
|
-
test_utils_1.assert.isTruthy(health.deploy);
|
|
78
|
-
test_utils_1.assert.isEqual(health.deploy.status, 'passed');
|
|
79
|
-
test_utils_1.assert.isArray(health.deploy.deploys);
|
|
80
|
-
test_utils_1.assert.isLength(health.deploy.deploys, 1);
|
|
81
|
-
test_utils_1.assert.isEqualDeep(health.deploy.deploys, [
|
|
82
|
-
{
|
|
83
|
-
provider: 'heroku',
|
|
84
|
-
name: APP_NAME_DEPLOYED,
|
|
85
|
-
webUrl: WEB_URL_DEPLOYED,
|
|
86
|
-
isDeployed: true,
|
|
87
|
-
},
|
|
88
|
-
]);
|
|
89
|
-
}
|
|
90
|
-
static async killingASkillKillsDeploy() {
|
|
91
|
-
const { skill } = await this.bootSkill({});
|
|
92
|
-
await skill.kill();
|
|
93
|
-
test_utils_1.assert.isFalse(skill.isRunning());
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.default = CheckingHealthTest;
|
|
97
|
-
__decorate([
|
|
98
|
-
test_utils_1.test.only('Enable these when needed for deploying to heroku')
|
|
99
|
-
], CheckingHealthTest, "pluginReturnsInstance", null);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, test_utils_1.test)()
|
|
102
|
-
], CheckingHealthTest, "registersWithSkill", null);
|
|
103
|
-
__decorate([
|
|
104
|
-
(0, test_utils_1.test)()
|
|
105
|
-
], CheckingHealthTest, "givesBackEmptyHealthByDefault", null);
|
|
106
|
-
__decorate([
|
|
107
|
-
(0, test_utils_1.test)()
|
|
108
|
-
], CheckingHealthTest, "failsHealthCheckWithBadApp", null);
|
|
109
|
-
__decorate([
|
|
110
|
-
(0, test_utils_1.test)()
|
|
111
|
-
], CheckingHealthTest, "getsBackHealtCheckShowingNotDeployed", null);
|
|
112
|
-
__decorate([
|
|
113
|
-
(0, test_utils_1.test)()
|
|
114
|
-
], CheckingHealthTest, "healthCheckChecksDeployStatus", null);
|
|
115
|
-
__decorate([
|
|
116
|
-
(0, test_utils_1.test)()
|
|
117
|
-
], CheckingHealthTest, "killingASkillKillsDeploy", null);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import AbstractDeployTest from '../../tests/AbstractDeployTest';
|
|
2
|
-
export default class CheckingHealthTest extends AbstractDeployTest {
|
|
3
|
-
protected static pluginReturnsInstance(): Promise<void>;
|
|
4
|
-
protected static registersWithSkill(): Promise<void>;
|
|
5
|
-
protected static givesBackEmptyHealthByDefault(): Promise<void>;
|
|
6
|
-
protected static failsHealthCheckWithBadApp(): Promise<void>;
|
|
7
|
-
protected static getsBackHealtCheckShowingNotDeployed(): Promise<void>;
|
|
8
|
-
protected static healthCheckChecksDeployStatus(): Promise<void>;
|
|
9
|
-
protected static killingASkillKillsDeploy(): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
import { test, assert } from '@sprucelabs/test-utils';
|
|
17
|
-
import { errorAssert } from '@sprucelabs/test-utils';
|
|
18
|
-
import plugin from '../../plugins/deploy.plugin.js';
|
|
19
|
-
import AbstractDeployTest from '../../tests/AbstractDeployTest.js';
|
|
20
|
-
const APP_NAME_NEVER_DEPLOYED = 'spruce-test-app';
|
|
21
|
-
const APP_NAME_DEPLOYED = 'sb-skill-schrutebucks-pos';
|
|
22
|
-
const APP_NAME_BAD_APP = 'spruce-test-app-bad';
|
|
23
|
-
const WEB_URL_NEVER_DEPLOYED = 'https://spruce-test-app.herokuapp.com/';
|
|
24
|
-
const WEB_URL_DEPLOYED = 'https://sb-skill-schrutebucks-pos.herokuapp.com/';
|
|
25
|
-
export default class CheckingHealthTest extends AbstractDeployTest {
|
|
26
|
-
static pluginReturnsInstance() {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
assert.isTruthy(plugin instanceof Function);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
static registersWithSkill() {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const skill = yield this.Skill();
|
|
34
|
-
const features = skill.getFeatures();
|
|
35
|
-
assert.isLength(features, 1);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
static givesBackEmptyHealthByDefault() {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const skill = yield this.Skill();
|
|
41
|
-
const health = yield skill.checkHealth();
|
|
42
|
-
assert.isTruthy(health.deploy);
|
|
43
|
-
assert.isEqual(health.deploy.status, 'passed');
|
|
44
|
-
assert.isArray(health.deploy.deploys);
|
|
45
|
-
assert.isLength(health.deploy.deploys, 0);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
static failsHealthCheckWithBadApp() {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
process.env.HEROKU_APP_NAME = APP_NAME_BAD_APP;
|
|
51
|
-
process.env.HEROKU_API_TOKEN = process.env.TEST_HEROKU_API_TOKEN;
|
|
52
|
-
process.env.HEROKU_TEAM_NAME = 'sprucelabs';
|
|
53
|
-
const skill = yield this.Skill();
|
|
54
|
-
const health = yield skill.checkHealth();
|
|
55
|
-
assert.isTruthy(health.deploy);
|
|
56
|
-
assert.isEqual(health.deploy.status, 'failed');
|
|
57
|
-
assert.isArray(health.deploy.deploys);
|
|
58
|
-
assert.isLength(health.deploy.deploys, 0);
|
|
59
|
-
assert.isArray(health.deploy.errors);
|
|
60
|
-
const err = health.deploy.errors[0];
|
|
61
|
-
errorAssert.assertError(err, 'HEROKU_ERROR');
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
static getsBackHealtCheckShowingNotDeployed() {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
process.env.HEROKU_APP_NAME = APP_NAME_NEVER_DEPLOYED;
|
|
67
|
-
process.env.HEROKU_API_TOKEN = process.env.TEST_HEROKU_API_TOKEN;
|
|
68
|
-
process.env.HEROKU_TEAM_NAME = 'sprucelabs';
|
|
69
|
-
const skill = yield this.Skill();
|
|
70
|
-
const health = yield skill.checkHealth();
|
|
71
|
-
assert.isTruthy(health.deploy);
|
|
72
|
-
assert.isEqual(health.deploy.status, 'passed');
|
|
73
|
-
assert.isArray(health.deploy.deploys);
|
|
74
|
-
assert.isLength(health.deploy.deploys, 1);
|
|
75
|
-
assert.isFalsy(health.deploy.errors);
|
|
76
|
-
assert.isEqualDeep(health.deploy.deploys, [
|
|
77
|
-
{
|
|
78
|
-
provider: 'heroku',
|
|
79
|
-
name: APP_NAME_NEVER_DEPLOYED,
|
|
80
|
-
webUrl: WEB_URL_NEVER_DEPLOYED,
|
|
81
|
-
isDeployed: false,
|
|
82
|
-
},
|
|
83
|
-
]);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
static healthCheckChecksDeployStatus() {
|
|
87
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
process.env.HEROKU_APP_NAME = APP_NAME_DEPLOYED;
|
|
89
|
-
process.env.HEROKU_API_TOKEN = process.env.TEST_HEROKU_API_TOKEN;
|
|
90
|
-
const skill = yield this.Skill();
|
|
91
|
-
const health = yield skill.checkHealth();
|
|
92
|
-
assert.isTruthy(health.deploy);
|
|
93
|
-
assert.isEqual(health.deploy.status, 'passed');
|
|
94
|
-
assert.isArray(health.deploy.deploys);
|
|
95
|
-
assert.isLength(health.deploy.deploys, 1);
|
|
96
|
-
assert.isEqualDeep(health.deploy.deploys, [
|
|
97
|
-
{
|
|
98
|
-
provider: 'heroku',
|
|
99
|
-
name: APP_NAME_DEPLOYED,
|
|
100
|
-
webUrl: WEB_URL_DEPLOYED,
|
|
101
|
-
isDeployed: true,
|
|
102
|
-
},
|
|
103
|
-
]);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
static killingASkillKillsDeploy() {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
const { skill } = yield this.bootSkill({});
|
|
109
|
-
yield skill.kill();
|
|
110
|
-
assert.isFalse(skill.isRunning());
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
__decorate([
|
|
115
|
-
test.only('Enable these when needed for deploying to heroku')
|
|
116
|
-
], CheckingHealthTest, "pluginReturnsInstance", null);
|
|
117
|
-
__decorate([
|
|
118
|
-
test()
|
|
119
|
-
], CheckingHealthTest, "registersWithSkill", null);
|
|
120
|
-
__decorate([
|
|
121
|
-
test()
|
|
122
|
-
], CheckingHealthTest, "givesBackEmptyHealthByDefault", null);
|
|
123
|
-
__decorate([
|
|
124
|
-
test()
|
|
125
|
-
], CheckingHealthTest, "failsHealthCheckWithBadApp", null);
|
|
126
|
-
__decorate([
|
|
127
|
-
test()
|
|
128
|
-
], CheckingHealthTest, "getsBackHealtCheckShowingNotDeployed", null);
|
|
129
|
-
__decorate([
|
|
130
|
-
test()
|
|
131
|
-
], CheckingHealthTest, "healthCheckChecksDeployStatus", null);
|
|
132
|
-
__decorate([
|
|
133
|
-
test()
|
|
134
|
-
], CheckingHealthTest, "killingASkillKillsDeploy", null);
|