@catladder/pipeline 1.113.0 → 1.114.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/build/docker.d.ts +2 -1
- package/dist/build/docker.js +13 -2
- package/dist/build/rails/build.js +9 -0
- package/dist/build/types.d.ts +5 -0
- package/dist/bundles/catladder-gitlab/index.js +3 -3
- package/dist/constants.js +1 -1
- package/dist/deploy/cloudRun/deployJob.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +16 -16
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +16 -16
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +16 -16
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +32 -32
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +48 -48
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +16 -16
- package/examples/__snapshots__/custom-build-job.ts.snap +16 -16
- package/examples/__snapshots__/custom-sbom-java.ts.snap +16 -16
- package/examples/__snapshots__/native-app.ts.snap +16 -16
- package/examples/__snapshots__/node-build-with-custom-image.ts.snap +16 -16
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +2094 -0
- package/examples/rails-k8s-with-worker.ts +15 -12
- package/package.json +1 -1
- package/src/build/docker.ts +5 -0
- package/src/build/rails/build.ts +15 -1
- package/src/build/types.ts +5 -0
- package/src/deploy/cloudRun/deployJob.ts +1 -1
package/dist/build/docker.d.ts
CHANGED
|
@@ -56,4 +56,5 @@ export declare const createDockerBuildJobBase: (context: Context, {
|
|
|
56
56
|
...def
|
|
57
57
|
}: Partial<CatladderJob>) => CatladderJob;
|
|
58
58
|
export declare const gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
|
|
59
|
-
export declare const getDockerBuildDefaultScript: (ensureDockerFileScript?: string | undefined) => (string | undefined)[];
|
|
59
|
+
export declare const getDockerBuildDefaultScript: (ensureDockerFileScript?: string | undefined) => (string | undefined)[];
|
|
60
|
+
export declare const hasDockerfile: (context: Context) => boolean;
|
package/dist/build/docker.js
CHANGED
|
@@ -18,11 +18,18 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
};
|
|
21
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
22
|
+
return mod && mod.__esModule ? mod : {
|
|
23
|
+
"default": mod
|
|
24
|
+
};
|
|
25
|
+
};
|
|
21
26
|
exports.__esModule = true;
|
|
22
|
-
exports.getDockerBuildDefaultScript = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
|
|
27
|
+
exports.hasDockerfile = exports.getDockerBuildDefaultScript = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
|
|
23
28
|
var lodash_1 = require("lodash");
|
|
24
29
|
var deploy_1 = require("../deploy");
|
|
25
30
|
var runner_1 = require("../runner");
|
|
31
|
+
var fs_1 = require("fs");
|
|
32
|
+
var path_1 = __importDefault(require("path"));
|
|
26
33
|
var DOCKER_RUNNER_BUILD_VARIABLES = {
|
|
27
34
|
KUBERNETES_CPU_REQUEST: "0.5",
|
|
28
35
|
KUBERNETES_CPU_LIMIT: "1",
|
|
@@ -96,4 +103,8 @@ exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password
|
|
|
96
103
|
var getDockerBuildDefaultScript = function (ensureDockerFileScript) {
|
|
97
104
|
return [ensureDockerFileScript, exports.gitlabDockerLogin, "docker version", "docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1", "docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE", "docker push $DOCKER_CACHE_IMAGE"].filter(Boolean);
|
|
98
105
|
};
|
|
99
|
-
exports.getDockerBuildDefaultScript = getDockerBuildDefaultScript;
|
|
106
|
+
exports.getDockerBuildDefaultScript = getDockerBuildDefaultScript;
|
|
107
|
+
var hasDockerfile = function (context) {
|
|
108
|
+
return (0, fs_1.existsSync)(path_1["default"].join(context.componentConfig.dir, "Dockerfile"));
|
|
109
|
+
};
|
|
110
|
+
exports.hasDockerfile = hasDockerfile;
|
|
@@ -44,6 +44,15 @@ var createRailsBuildJobs = function (context) {
|
|
|
44
44
|
// should not happen
|
|
45
45
|
throw new Error("build type is not rails");
|
|
46
46
|
}
|
|
47
|
+
if ((0, docker_1.hasDockerfile)(context)) {
|
|
48
|
+
return (0, base_1.createBuildJobs)(context, {
|
|
49
|
+
appBuild: undefined,
|
|
50
|
+
dockerBuild: {
|
|
51
|
+
script: (0, docker_1.getDockerBuildDefaultScript)(),
|
|
52
|
+
variables: {}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
47
56
|
var cnbConf = buildConfig.cnbBuilder;
|
|
48
57
|
var packEnvArgs = Object.entries((_a = cnbConf === null || cnbConf === void 0 ? void 0 : cnbConf.buildVars) !== null && _a !== void 0 ? _a : {}).map(function (_a) {
|
|
49
58
|
var _b = __read(_a, 2),
|
package/dist/build/types.d.ts
CHANGED
|
@@ -167,6 +167,11 @@ export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" |
|
|
|
167
167
|
};
|
|
168
168
|
export declare type BuildConfigRails = BuildConfigBase & {
|
|
169
169
|
type: "rails";
|
|
170
|
+
/**
|
|
171
|
+
* The [Cloud Native Buildpacks](https://buildpacks.io/) builder configuration.
|
|
172
|
+
*
|
|
173
|
+
* Only applies when there is no `Dockerfile`.
|
|
174
|
+
*/
|
|
170
175
|
cnbBuilder?: {
|
|
171
176
|
/**
|
|
172
177
|
* The Cloud Native Buildpacks builder image to use.
|