@catladder/pipeline 4.6.3 → 4.7.0
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/dist/constants.js +1 -1
- package/dist/deploy/cloudRun/index.js +12 -0
- package/dist/deploy/index.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/pipeline/createJobsForComponent.js +5 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +8 -0
- package/dist/verify/createVerifyJobs.d.ts +4 -0
- package/dist/verify/createVerifyJobs.js +229 -0
- package/dist/verify/index.d.ts +2 -0
- package/dist/verify/index.js +26 -0
- package/dist/verify/types.d.ts +16 -0
- package/dist/verify/types.js +5 -0
- package/examples/__snapshots__/cloud-run-verify.test.ts.snap +3061 -0
- package/examples/cloud-run-verify.test.ts +12 -0
- package/examples/cloud-run-verify.ts +50 -0
- package/package.json +1 -1
- package/src/deploy/cloudRun/index.ts +23 -1
- package/src/deploy/index.ts +5 -0
- package/src/index.ts +1 -0
- package/src/pipeline/createJobsForComponent.ts +4 -2
- package/src/types/config.ts +9 -0
- package/src/verify/createVerifyJobs.ts +81 -0
- package/src/verify/index.ts +2 -0
- package/src/verify/types.ts +18 -0
package/dist/constants.js
CHANGED
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
7
|
-
exports.PIPELINE_IMAGE_TAG = "v4-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "v4-7-0-9922ea65" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -137,5 +137,17 @@ exports.GCLOUD_RUN_DEPLOY_TYPE = {
|
|
|
137
137
|
DEPLOY_CLOUD_RUN_PROJECT_ID: deployConfigRaw ? deployConfigRaw.projectId : undefined,
|
|
138
138
|
DEPLOY_CLOUD_RUN_REGION: deployConfigRaw ? deployConfigRaw.region : undefined
|
|
139
139
|
});
|
|
140
|
+
},
|
|
141
|
+
verifyJobSetupScript: function (context) {
|
|
142
|
+
var _a;
|
|
143
|
+
var deployConfig = (_a = context.deploy) === null || _a === void 0 ? void 0 : _a.config;
|
|
144
|
+
var service = deployConfig === null || deployConfig === void 0 ? void 0 : deployConfig.service;
|
|
145
|
+
var serviceConfig = typeof service === "object" ? service : undefined;
|
|
146
|
+
if ((serviceConfig === null || serviceConfig === void 0 ? void 0 : serviceConfig.allowUnauthenticated) !== false) {
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
// the service requires IAM auth: provide application default credentials
|
|
150
|
+
// so the verify command can fetch identity tokens for the deployed service
|
|
151
|
+
return (0, gitlab_1.collapseableSection)("verifygcloudauth", "Setup google application credentials")(["echo \"$".concat(exports.GCLOUD_DEPLOY_CREDENTIALS_KEY, "\" > \"$CI_PROJECT_DIR/.gcloud-sa.json\""), "export GOOGLE_APPLICATION_CREDENTIALS=\"$CI_PROJECT_DIR/.gcloud-sa.json\""]);
|
|
140
152
|
}
|
|
141
153
|
};
|
package/dist/deploy/index.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export type DeployTypeDefinition<D extends DeployConfig> = {
|
|
|
14
14
|
defaults: (envContext: EnvironmentContext<BuildConfig, D>) => PartialDeep<D>;
|
|
15
15
|
additionalSecretKeys: (envContext: EnvironmentContext<BuildConfig, D>) => SecretEnvVar[];
|
|
16
16
|
getAdditionalEnvVars: (envContext: EnvironmentContext<BuildConfig, D>) => Record<string, string | BashExpression | undefined | null>;
|
|
17
|
+
/**
|
|
18
|
+
* script lines the deploy type contributes to the start of the verify job,
|
|
19
|
+
* e.g. to authenticate against a non-public service
|
|
20
|
+
*/
|
|
21
|
+
verifyJobSetupScript?: (context: ComponentContext) => string[];
|
|
17
22
|
};
|
|
18
23
|
export type DeployTypes = { [T in DeployConfigType]: DeployTypeDefinition<DeployConfigGeneric<T>> };
|
|
19
24
|
export declare const DEPLOY_TYPES: DeployTypes;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ __exportStar(require("./config"), exports);
|
|
|
30
30
|
__exportStar(require("./context"), exports);
|
|
31
31
|
__exportStar(require("./build"), exports);
|
|
32
32
|
__exportStar(require("./deploy"), exports);
|
|
33
|
+
__exportStar(require("./verify"), exports);
|
|
33
34
|
__exportStar(require("./utils/writeFiles"), exports);
|
|
34
35
|
__exportStar(require("./utils/measureTime"), exports);
|
|
35
36
|
__exportStar(require("./variables/VariableValue"), exports);
|
|
@@ -170,6 +170,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
170
170
|
exports.createJobsForComponentContext = void 0;
|
|
171
171
|
var build_1 = require("../build");
|
|
172
172
|
var deploy_1 = require("../deploy");
|
|
173
|
+
var createVerifyJobs_1 = require("../verify/createVerifyJobs");
|
|
173
174
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
174
175
|
return jobs.map(function (_a) {
|
|
175
176
|
var _b;
|
|
@@ -189,15 +190,15 @@ var getCustomJobs = function (context) {
|
|
|
189
190
|
};
|
|
190
191
|
var createJobsForComponentContext = function (context) {
|
|
191
192
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
192
|
-
var _a, buildJobs, deployJobs, customJobs;
|
|
193
|
+
var _a, buildJobs, deployJobs, verifyJobs, customJobs;
|
|
193
194
|
return __generator(this, function (_b) {
|
|
194
195
|
switch (_b.label) {
|
|
195
196
|
case 0:
|
|
196
|
-
return [4 /*yield*/, Promise.all([context.build.type !== "disabled" ? build_1.BUILD_TYPES[context.build.buildType].jobs(context) : [], context.componentConfig.deploy !== false ? deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context) : []])];
|
|
197
|
+
return [4 /*yield*/, Promise.all([context.build.type !== "disabled" ? build_1.BUILD_TYPES[context.build.buildType].jobs(context) : [], context.componentConfig.deploy !== false ? deploy_1.DEPLOY_TYPES[context.componentConfig.deploy.type].jobs(context) : [], (0, createVerifyJobs_1.createVerifyJobs)(context)])];
|
|
197
198
|
case 1:
|
|
198
|
-
_a = __read.apply(void 0, [_b.sent(),
|
|
199
|
+
_a = __read.apply(void 0, [_b.sent(), 3]), buildJobs = _a[0], deployJobs = _a[1], verifyJobs = _a[2];
|
|
199
200
|
customJobs = getCustomJobs(context);
|
|
200
|
-
return [2 /*return*/, __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false)];
|
|
201
|
+
return [2 /*return*/, __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(verifyJobs), false), __read(customJobs), false)];
|
|
201
202
|
}
|
|
202
203
|
});
|
|
203
204
|
});
|