@catladder/pipeline 1.100.2 → 1.101.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/node/buildJob.js +9 -8
- package/dist/build/node/yarn.js +1 -1
- package/dist/build/types.d.ts +8 -4
- package/dist/bundles/catladder-gitlab/index.js +3 -3
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.js +4 -1
- package/dist/deploy/base.js +5 -4
- package/dist/deploy/types/base.d.ts +8 -0
- package/dist/pipeline/commitInfo/getBuildId.d.ts +6 -1
- package/dist/pipeline/commitInfo/getBuildId.js +22 -2
- package/dist/pipeline/commitInfo/getCommitInfo.js +4 -1
- package/dist/pipeline/gitlab/createGitlabJobs.d.ts +1 -0
- package/dist/pipeline/gitlab/createGitlabJobs.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +1 -0
- package/dist/types/gitlab-types.d.ts +1 -0
- package/dist/types/jobs.d.ts +4 -0
- package/dist/utils/index.d.ts +1 -1
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +80 -32
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +80 -32
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +80 -32
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +160 -64
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +160 -64
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +64 -24
- package/examples/__snapshots__/custom-build-job.ts.snap +64 -24
- package/examples/__snapshots__/custom-deploy.ts.snap +64 -28
- package/examples/__snapshots__/custom-envs.ts.snap +56 -22
- package/examples/__snapshots__/custom-sbom-java.ts.snap +64 -24
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +148 -52
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +148 -52
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +148 -52
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +296 -104
- package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +148 -52
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +108 -36
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +120 -48
- package/package.json +1 -1
- package/src/build/node/buildJob.ts +6 -1
- package/src/build/node/yarn.ts +2 -1
- package/src/build/types.ts +10 -5
- package/src/context/getEnvironmentVariables.ts +4 -1
- package/src/deploy/base.ts +7 -2
- package/src/deploy/types/base.ts +10 -0
- package/src/pipeline/commitInfo/getBuildId.ts +11 -0
- package/src/pipeline/commitInfo/getCommitInfo.ts +2 -1
- package/src/pipeline/gitlab/createGitlabJobs.ts +2 -0
- package/src/types/context.ts +1 -0
- package/src/types/gitlab-types.ts +1 -0
- package/src/types/jobs.ts +5 -0
- package/src/utils/index.ts +1 -1
|
@@ -4,3 +4,14 @@ export const getBuildId = async () =>
|
|
|
4
4
|
await exec("git describe --tags || git rev-parse HEAD").then((s) =>
|
|
5
5
|
s.stdout.trim()
|
|
6
6
|
);
|
|
7
|
+
|
|
8
|
+
// thx chat gpt
|
|
9
|
+
/**
|
|
10
|
+
* returns the last tagged version string Major.minor.patch
|
|
11
|
+
* returns 0.0.0 if there is no tag
|
|
12
|
+
*/
|
|
13
|
+
export const getCurrentVersionString = async () => {
|
|
14
|
+
return await exec(
|
|
15
|
+
'latest_tag=$(git describe --tags --abbrev=0 2>/dev/null); if [ -z "$latest_tag" ]; then echo "0.0.0"; else echo "${latest_tag#v}"; fi | cut -d "." -f 1-3'
|
|
16
|
+
).then((s) => s.stdout.trim());
|
|
17
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommitInfo } from "../../types";
|
|
2
|
-
import { getBuildId } from "./getBuildId";
|
|
2
|
+
import { getBuildId, getCurrentVersionString } from "./getBuildId";
|
|
3
3
|
export const getBaseCommitInfo = async (): Promise<
|
|
4
4
|
Omit<CommitInfo, "trigger">
|
|
5
5
|
> => ({
|
|
@@ -9,4 +9,5 @@ export const getBaseCommitInfo = async (): Promise<
|
|
|
9
9
|
: "unknown",
|
|
10
10
|
buildTime: new Date().toISOString(),
|
|
11
11
|
buildId: await getBuildId(),
|
|
12
|
+
currentVersion: await getCurrentVersionString(),
|
|
12
13
|
});
|
|
@@ -51,6 +51,7 @@ export const makeGitlabJob = (
|
|
|
51
51
|
needsOtherComponent,
|
|
52
52
|
name,
|
|
53
53
|
needs,
|
|
54
|
+
jobTags,
|
|
54
55
|
...job
|
|
55
56
|
}: CatladderJob<string>,
|
|
56
57
|
allJobs: AllCatladderJobs
|
|
@@ -101,6 +102,7 @@ export const makeGitlabJob = (
|
|
|
101
102
|
|
|
102
103
|
const gitlabJob: GitlabJobDef = removeUndefined({
|
|
103
104
|
...job,
|
|
105
|
+
tags: jobTags,
|
|
104
106
|
stage,
|
|
105
107
|
environment: job.environment?.on_stop
|
|
106
108
|
? {
|
package/src/types/context.ts
CHANGED
package/src/types/jobs.ts
CHANGED
package/src/utils/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export function notNil<TValue>(
|
|
|
6
6
|
return value !== null && value !== undefined;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const ensureArray = <T>(s: T | T[]): T[] | null =>
|
|
9
|
+
export const ensureArray = <T>(s: undefined | T | T[]): T[] | null =>
|
|
10
10
|
isNil(s) ? null : Array.isArray(s) ? s : [s];
|
|
11
11
|
|
|
12
12
|
// see https://github.com/lodash/lodash/issues/5384
|