@simplysf/simply-cicd 0.3.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/README.md +1621 -0
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.d.ts +21 -0
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js +47 -0
- package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js.map +1 -0
- package/lib/commands/simply/cicd/build/create-fallback-tag.d.ts +25 -0
- package/lib/commands/simply/cicd/build/create-fallback-tag.js +63 -0
- package/lib/commands/simply/cicd/build/create-fallback-tag.js.map +1 -0
- package/lib/commands/simply/cicd/build/create-package-version.d.ts +32 -0
- package/lib/commands/simply/cicd/build/create-package-version.js +110 -0
- package/lib/commands/simply/cicd/build/create-package-version.js.map +1 -0
- package/lib/commands/simply/cicd/build/create-scratch.d.ts +25 -0
- package/lib/commands/simply/cicd/build/create-scratch.js +63 -0
- package/lib/commands/simply/cicd/build/create-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/build/delete-scratch.d.ts +21 -0
- package/lib/commands/simply/cicd/build/delete-scratch.js +53 -0
- package/lib/commands/simply/cicd/build/delete-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/build/determine-package-changes.d.ts +17 -0
- package/lib/commands/simply/cicd/build/determine-package-changes.js +44 -0
- package/lib/commands/simply/cicd/build/determine-package-changes.js.map +1 -0
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.d.ts +20 -0
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js +47 -0
- package/lib/commands/simply/cicd/build/generate-flexipage-diff.js.map +1 -0
- package/lib/commands/simply/cicd/build/generate-flow-diff.d.ts +20 -0
- package/lib/commands/simply/cicd/build/generate-flow-diff.js +47 -0
- package/lib/commands/simply/cicd/build/generate-flow-diff.js.map +1 -0
- package/lib/commands/simply/cicd/build/install-dependencies.d.ts +18 -0
- package/lib/commands/simply/cicd/build/install-dependencies.js +58 -0
- package/lib/commands/simply/cicd/build/install-dependencies.js.map +1 -0
- package/lib/commands/simply/cicd/build/lwc-jest.d.ts +14 -0
- package/lib/commands/simply/cicd/build/lwc-jest.js +37 -0
- package/lib/commands/simply/cicd/build/lwc-jest.js.map +1 -0
- package/lib/commands/simply/cicd/build/push-scratch.d.ts +19 -0
- package/lib/commands/simply/cicd/build/push-scratch.js +57 -0
- package/lib/commands/simply/cicd/build/push-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/build/test-scratch.d.ts +18 -0
- package/lib/commands/simply/cicd/build/test-scratch.js +58 -0
- package/lib/commands/simply/cicd/build/test-scratch.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.d.ts +23 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js +82 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.d.ts +21 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js +57 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.d.ts +29 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js +89 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.d.ts +15 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js +49 -0
- package/lib/commands/simply/cicd/deploy/happy-soup/validate.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/install-packaged.d.ts +24 -0
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js +69 -0
- package/lib/commands/simply/cicd/deploy/project/install-packaged.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/post-deploy.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/post-deploy.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/post-destructive.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/post-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.d.ts +28 -0
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js +36 -0
- package/lib/commands/simply/cicd/deploy/project/pre-destructive.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.d.ts +26 -0
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js +66 -0
- package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/project/validate.d.ts +14 -0
- package/lib/commands/simply/cicd/deploy/project/validate.js +51 -0
- package/lib/commands/simply/cicd/deploy/project/validate.js.map +1 -0
- package/lib/commands/simply/cicd/deploy/validate.d.ts +14 -0
- package/lib/commands/simply/cicd/deploy/validate.js +50 -0
- package/lib/commands/simply/cicd/deploy/validate.js.map +1 -0
- package/lib/commands/simply/cicd/notify/happy-soup.d.ts +32 -0
- package/lib/commands/simply/cicd/notify/happy-soup.js +193 -0
- package/lib/commands/simply/cicd/notify/happy-soup.js.map +1 -0
- package/lib/commands/simply/cicd/notify/project.d.ts +51 -0
- package/lib/commands/simply/cicd/notify/project.js +376 -0
- package/lib/commands/simply/cicd/notify/project.js.map +1 -0
- package/lib/commands/simply/cicd/notify/teams.d.ts +18 -0
- package/lib/commands/simply/cicd/notify/teams.js +77 -0
- package/lib/commands/simply/cicd/notify/teams.js.map +1 -0
- package/lib/commands/simply/cicd/sfdx-dependabot.d.ts +84 -0
- package/lib/commands/simply/cicd/sfdx-dependabot.js +469 -0
- package/lib/commands/simply/cicd/sfdx-dependabot.js.map +1 -0
- package/lib/common/build/cleanupScratchOrgs.d.ts +7 -0
- package/lib/common/build/cleanupScratchOrgs.js +91 -0
- package/lib/common/build/cleanupScratchOrgs.js.map +1 -0
- package/lib/common/build/createFallbackTag.d.ts +24 -0
- package/lib/common/build/createFallbackTag.js +96 -0
- package/lib/common/build/createFallbackTag.js.map +1 -0
- package/lib/common/build/createPackageVersion.d.ts +27 -0
- package/lib/common/build/createPackageVersion.js +164 -0
- package/lib/common/build/createPackageVersion.js.map +1 -0
- package/lib/common/build/createScratchOrg.d.ts +14 -0
- package/lib/common/build/createScratchOrg.js +191 -0
- package/lib/common/build/createScratchOrg.js.map +1 -0
- package/lib/common/build/deleteScratchOrg.d.ts +12 -0
- package/lib/common/build/deleteScratchOrg.js +58 -0
- package/lib/common/build/deleteScratchOrg.js.map +1 -0
- package/lib/common/build/determinePackageChanges.d.ts +13 -0
- package/lib/common/build/determinePackageChanges.js +98 -0
- package/lib/common/build/determinePackageChanges.js.map +1 -0
- package/lib/common/build/devHubs.d.ts +8 -0
- package/lib/common/build/devHubs.js +30 -0
- package/lib/common/build/devHubs.js.map +1 -0
- package/lib/common/build/flags.d.ts +36 -0
- package/lib/common/build/flags.js +120 -0
- package/lib/common/build/flags.js.map +1 -0
- package/lib/common/build/flexipageDelta.d.ts +31 -0
- package/lib/common/build/flexipageDelta.js +92 -0
- package/lib/common/build/flexipageDelta.js.map +1 -0
- package/lib/common/build/flowDelta.d.ts +30 -0
- package/lib/common/build/flowDelta.js +91 -0
- package/lib/common/build/flowDelta.js.map +1 -0
- package/lib/common/build/installDependencies.d.ts +7 -0
- package/lib/common/build/installDependencies.js +36 -0
- package/lib/common/build/installDependencies.js.map +1 -0
- package/lib/common/build/lwcJest.d.ts +9 -0
- package/lib/common/build/lwcJest.js +36 -0
- package/lib/common/build/lwcJest.js.map +1 -0
- package/lib/common/build/pushScratch.d.ts +8 -0
- package/lib/common/build/pushScratch.js +63 -0
- package/lib/common/build/pushScratch.js.map +1 -0
- package/lib/common/build/scratchOrgInfo.d.ts +10 -0
- package/lib/common/build/scratchOrgInfo.js +21 -0
- package/lib/common/build/scratchOrgInfo.js.map +1 -0
- package/lib/common/build/skipGuard.d.ts +8 -0
- package/lib/common/build/skipGuard.js +41 -0
- package/lib/common/build/skipGuard.js.map +1 -0
- package/lib/common/build/testScratch.d.ts +14 -0
- package/lib/common/build/testScratch.js +45 -0
- package/lib/common/build/testScratch.js.map +1 -0
- package/lib/common/deploy/deployCommon.d.ts +101 -0
- package/lib/common/deploy/deployCommon.js +361 -0
- package/lib/common/deploy/deployCommon.js.map +1 -0
- package/lib/common/deploy/deployHappySoup.d.ts +54 -0
- package/lib/common/deploy/deployHappySoup.js +143 -0
- package/lib/common/deploy/deployHappySoup.js.map +1 -0
- package/lib/common/deploy/deployProject.d.ts +24 -0
- package/lib/common/deploy/deployProject.js +114 -0
- package/lib/common/deploy/deployProject.js.map +1 -0
- package/lib/common/deploy/flags.d.ts +34 -0
- package/lib/common/deploy/flags.js +91 -0
- package/lib/common/deploy/flags.js.map +1 -0
- package/lib/common/deploy/runDeployStage.d.ts +16 -0
- package/lib/common/deploy/runDeployStage.js +65 -0
- package/lib/common/deploy/runDeployStage.js.map +1 -0
- package/lib/common/deploy/stageCommand.d.ts +106 -0
- package/lib/common/deploy/stageCommand.js +131 -0
- package/lib/common/deploy/stageCommand.js.map +1 -0
- package/lib/common/deploy/validate.d.ts +11 -0
- package/lib/common/deploy/validate.js +54 -0
- package/lib/common/deploy/validate.js.map +1 -0
- package/lib/common/env.d.ts +9 -0
- package/lib/common/env.js +47 -0
- package/lib/common/env.js.map +1 -0
- package/lib/common/exec/sfCli.d.ts +27 -0
- package/lib/common/exec/sfCli.js +50 -0
- package/lib/common/exec/sfCli.js.map +1 -0
- package/lib/common/flags/env.d.ts +44 -0
- package/lib/common/flags/env.js +81 -0
- package/lib/common/flags/env.js.map +1 -0
- package/lib/common/git.d.ts +19 -0
- package/lib/common/git.js +79 -0
- package/lib/common/git.js.map +1 -0
- package/lib/common/logger.d.ts +10 -0
- package/lib/common/logger.js +33 -0
- package/lib/common/logger.js.map +1 -0
- package/lib/common/notify/getCommitStories.d.ts +16 -0
- package/lib/common/notify/getCommitStories.js +69 -0
- package/lib/common/notify/getCommitStories.js.map +1 -0
- package/lib/common/notify/renderTemplate.d.ts +3 -0
- package/lib/common/notify/renderTemplate.js +24 -0
- package/lib/common/notify/renderTemplate.js.map +1 -0
- package/lib/common/notify/sendNotification.d.ts +2 -0
- package/lib/common/notify/sendNotification.js +50 -0
- package/lib/common/notify/sendNotification.js.map +1 -0
- package/lib/common/notify/templates.d.ts +11 -0
- package/lib/common/notify/templates.js +85 -0
- package/lib/common/notify/templates.js.map +1 -0
- package/lib/common/schemas/deployConfig.d.ts +25 -0
- package/lib/common/schemas/deployConfig.js +55 -0
- package/lib/common/schemas/deployConfig.js.map +1 -0
- package/lib/common/schemas/deployProgress.d.ts +10 -0
- package/lib/common/schemas/deployProgress.js +27 -0
- package/lib/common/schemas/deployProgress.js.map +1 -0
- package/lib/common/schemas/deployRules.d.ts +34 -0
- package/lib/common/schemas/deployRules.js +40 -0
- package/lib/common/schemas/deployRules.js.map +1 -0
- package/lib/common/sfApex.d.ts +22 -0
- package/lib/common/sfApex.js +158 -0
- package/lib/common/sfApex.js.map +1 -0
- package/lib/common/sfAuth.d.ts +30 -0
- package/lib/common/sfAuth.js +99 -0
- package/lib/common/sfAuth.js.map +1 -0
- package/lib/common/sfConfig.d.ts +6 -0
- package/lib/common/sfConfig.js +45 -0
- package/lib/common/sfConfig.js.map +1 -0
- package/lib/common/sfPackages.d.ts +12 -0
- package/lib/common/sfPackages.js +53 -0
- package/lib/common/sfPackages.js.map +1 -0
- package/lib/common/sfPlugins.d.ts +11 -0
- package/lib/common/sfPlugins.js +134 -0
- package/lib/common/sfPlugins.js.map +1 -0
- package/lib/common/sfdxDependabot/updater.d.ts +14 -0
- package/lib/common/sfdxDependabot/updater.js +94 -0
- package/lib/common/sfdxDependabot/updater.js.map +1 -0
- package/lib/common/vcs/gitlab.d.ts +21 -0
- package/lib/common/vcs/gitlab.js +208 -0
- package/lib/common/vcs/gitlab.js.map +1 -0
- package/lib/common/vcs/index.d.ts +4 -0
- package/lib/common/vcs/index.js +26 -0
- package/lib/common/vcs/index.js.map +1 -0
- package/lib/common/vcs/types.d.ts +69 -0
- package/lib/common/vcs/types.js +17 -0
- package/lib/common/vcs/types.js.map +1 -0
- package/lib/config/defaultDeploymentPlugins.d.ts +2 -0
- package/lib/config/defaultDeploymentPlugins.js +18 -0
- package/lib/config/defaultDeploymentPlugins.js.map +1 -0
- package/lib/config/trustedPlugins.d.ts +2 -0
- package/lib/config/trustedPlugins.js +18 -0
- package/lib/config/trustedPlugins.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/messages/simply.cicd.build.cleanup-scratch-orgs.md +11 -0
- package/messages/simply.cicd.build.create-fallback-tag.md +21 -0
- package/messages/simply.cicd.build.create-package-version.md +49 -0
- package/messages/simply.cicd.build.create-scratch.md +21 -0
- package/messages/simply.cicd.build.delete-scratch.md +13 -0
- package/messages/simply.cicd.build.determine-package-changes.md +15 -0
- package/messages/simply.cicd.build.generate-flexipage-diff.md +11 -0
- package/messages/simply.cicd.build.generate-flow-diff.md +11 -0
- package/messages/simply.cicd.build.install-dependencies.md +17 -0
- package/messages/simply.cicd.build.lwc-jest.md +11 -0
- package/messages/simply.cicd.build.md +75 -0
- package/messages/simply.cicd.build.push-scratch.md +21 -0
- package/messages/simply.cicd.build.test-scratch.md +17 -0
- package/messages/simply.cicd.deploy.happy-soup.deploy-unpackaged.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.deployment-close-out.md +39 -0
- package/messages/simply.cicd.deploy.happy-soup.install-packaged.md +15 -0
- package/messages/simply.cicd.deploy.happy-soup.post-deploy.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.post-destructive.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.pre-destructive.md +11 -0
- package/messages/simply.cicd.deploy.happy-soup.tag-deployment.md +35 -0
- package/messages/simply.cicd.deploy.happy-soup.validate.md +25 -0
- package/messages/simply.cicd.deploy.md +75 -0
- package/messages/simply.cicd.deploy.project.deploy-unpackaged.md +11 -0
- package/messages/simply.cicd.deploy.project.install-packaged.md +23 -0
- package/messages/simply.cicd.deploy.project.post-deploy.md +11 -0
- package/messages/simply.cicd.deploy.project.post-destructive.md +11 -0
- package/messages/simply.cicd.deploy.project.pre-destructive.md +11 -0
- package/messages/simply.cicd.deploy.project.run-apex-tests.md +15 -0
- package/messages/simply.cicd.deploy.project.validate.md +25 -0
- package/messages/simply.cicd.deploy.validate.md +25 -0
- package/messages/simply.cicd.md +3 -0
- package/messages/simply.cicd.notify.happy-soup.md +73 -0
- package/messages/simply.cicd.notify.project.md +125 -0
- package/messages/simply.cicd.notify.teams.md +27 -0
- package/messages/simply.cicd.sfdx-dependabot.md +91 -0
- package/package.json +214 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
function normalizeProject(project) {
|
|
17
|
+
return {
|
|
18
|
+
id: project.id,
|
|
19
|
+
name: project.name,
|
|
20
|
+
pathWithNamespace: project.path_with_namespace,
|
|
21
|
+
defaultBranch: project.default_branch,
|
|
22
|
+
archived: Boolean(project.archived),
|
|
23
|
+
empty: Boolean(project.empty_repo),
|
|
24
|
+
isFork: Boolean(project.forked_from_project) || project.fork === true,
|
|
25
|
+
raw: project,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function normalizeMergeRequest(mergeRequest) {
|
|
29
|
+
return {
|
|
30
|
+
id: mergeRequest.id,
|
|
31
|
+
iid: mergeRequest.iid,
|
|
32
|
+
title: mergeRequest.title,
|
|
33
|
+
description: mergeRequest.description,
|
|
34
|
+
sourceBranch: mergeRequest.source_branch,
|
|
35
|
+
targetBranch: mergeRequest.target_branch,
|
|
36
|
+
webUrl: mergeRequest.web_url,
|
|
37
|
+
raw: mergeRequest,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** A `VcsProvider` implementation for GitLab, backed by the GitLab REST API v4. */
|
|
41
|
+
export class GitLabProvider {
|
|
42
|
+
apiUrl;
|
|
43
|
+
token;
|
|
44
|
+
constructor(apiUrl, token) {
|
|
45
|
+
if (!apiUrl) {
|
|
46
|
+
throw new Error('GitLab API URL is required.');
|
|
47
|
+
}
|
|
48
|
+
if (!token) {
|
|
49
|
+
throw new Error('GitLab access token is required.');
|
|
50
|
+
}
|
|
51
|
+
this.apiUrl = apiUrl.replace(/\/+$/, '');
|
|
52
|
+
this.token = token;
|
|
53
|
+
}
|
|
54
|
+
async getGroupProjects(groupId) {
|
|
55
|
+
let projects = [];
|
|
56
|
+
let page = 1;
|
|
57
|
+
let hasMore = true;
|
|
58
|
+
const encodedGroupId = encodeURIComponent(groupId);
|
|
59
|
+
while (hasMore) {
|
|
60
|
+
const endpoint = `/groups/${encodedGroupId}/projects?include_subgroups=true&per_page=100&page=${page}`;
|
|
61
|
+
// eslint-disable-next-line no-await-in-loop -- pagination is inherently sequential (next page depends on this one's headers)
|
|
62
|
+
const response = await this.request(endpoint);
|
|
63
|
+
// eslint-disable-next-line no-await-in-loop
|
|
64
|
+
const data = (await response.json());
|
|
65
|
+
if (!Array.isArray(data) || data.length === 0) {
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
projects = projects.concat(data);
|
|
69
|
+
const nextPageHeader = response.headers.get('X-Next-Page');
|
|
70
|
+
if (nextPageHeader) {
|
|
71
|
+
const nextPageNum = Number(nextPageHeader);
|
|
72
|
+
if (nextPageNum && nextPageNum > page) {
|
|
73
|
+
page = nextPageNum;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
hasMore = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else if (data.length < 100) {
|
|
80
|
+
hasMore = false;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
page++;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return projects.map(normalizeProject);
|
|
87
|
+
}
|
|
88
|
+
async getFileContent(projectId, filePath, ref) {
|
|
89
|
+
const encodedFilePath = encodeURIComponent(filePath);
|
|
90
|
+
const endpoint = `/projects/${projectId}/repository/files/${encodedFilePath}/raw?ref=${encodeURIComponent(ref)}`;
|
|
91
|
+
return this.getRawText(endpoint);
|
|
92
|
+
}
|
|
93
|
+
async branchExists(projectId, branchName) {
|
|
94
|
+
const encodedBranch = encodeURIComponent(branchName);
|
|
95
|
+
const endpoint = `/projects/${projectId}/repository/branches/${encodedBranch}`;
|
|
96
|
+
try {
|
|
97
|
+
await this.request(endpoint, { method: 'GET' });
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
const err = error;
|
|
102
|
+
if (err.message.includes('404')) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
throw err;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async createBranch(projectId, branchName, ref) {
|
|
109
|
+
const endpoint = `/projects/${projectId}/repository/branches`;
|
|
110
|
+
const response = await this.request(endpoint, {
|
|
111
|
+
method: 'POST',
|
|
112
|
+
body: { branch: branchName, ref },
|
|
113
|
+
});
|
|
114
|
+
const raw = await response.json();
|
|
115
|
+
return { name: branchName, raw };
|
|
116
|
+
}
|
|
117
|
+
async commitFile(projectId, branchName, commitMessage, filePath, content) {
|
|
118
|
+
const endpoint = `/projects/${projectId}/repository/commits`;
|
|
119
|
+
/* eslint-disable camelcase -- GitLab API field names */
|
|
120
|
+
const response = await this.request(endpoint, {
|
|
121
|
+
method: 'POST',
|
|
122
|
+
body: {
|
|
123
|
+
branch: branchName,
|
|
124
|
+
commit_message: commitMessage,
|
|
125
|
+
actions: [{ action: 'update', file_path: filePath, content }],
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
/* eslint-enable camelcase */
|
|
129
|
+
const raw = (await response.json());
|
|
130
|
+
return { id: raw.id, raw };
|
|
131
|
+
}
|
|
132
|
+
async findOpenMergeRequest(projectId, sourceBranch, targetBranch) {
|
|
133
|
+
const endpoint = `/projects/${projectId}/merge_requests?state=opened&source_branch=${encodeURIComponent(sourceBranch)}&target_branch=${encodeURIComponent(targetBranch)}`;
|
|
134
|
+
const mergeRequests = (await this.getJson(endpoint));
|
|
135
|
+
return mergeRequests.length > 0 ? normalizeMergeRequest(mergeRequests[0]) : undefined;
|
|
136
|
+
}
|
|
137
|
+
async createMergeRequest(projectId, sourceBranch, targetBranch, title, description, labels) {
|
|
138
|
+
const endpoint = `/projects/${projectId}/merge_requests`;
|
|
139
|
+
/* eslint-disable camelcase -- GitLab API field names */
|
|
140
|
+
const body = {
|
|
141
|
+
source_branch: sourceBranch,
|
|
142
|
+
target_branch: targetBranch,
|
|
143
|
+
title,
|
|
144
|
+
description,
|
|
145
|
+
remove_source_branch: true,
|
|
146
|
+
};
|
|
147
|
+
/* eslint-enable camelcase */
|
|
148
|
+
if (labels) {
|
|
149
|
+
body.labels = labels;
|
|
150
|
+
}
|
|
151
|
+
const response = await this.request(endpoint, { method: 'POST', body });
|
|
152
|
+
return normalizeMergeRequest((await response.json()));
|
|
153
|
+
}
|
|
154
|
+
async updateMergeRequest(projectId, mergeRequestId, title, description, labels) {
|
|
155
|
+
const endpoint = `/projects/${projectId}/merge_requests/${mergeRequestId}`;
|
|
156
|
+
const body = { title, description };
|
|
157
|
+
if (labels) {
|
|
158
|
+
body.labels = labels;
|
|
159
|
+
}
|
|
160
|
+
const response = await this.request(endpoint, { method: 'PUT', body });
|
|
161
|
+
return normalizeMergeRequest((await response.json()));
|
|
162
|
+
}
|
|
163
|
+
async getProjectVariables(projectId) {
|
|
164
|
+
try {
|
|
165
|
+
const variables = (await this.getJson(`/projects/${projectId}/variables`));
|
|
166
|
+
return variables.map((variable) => ({ key: variable.key, value: variable.value, raw: variable }));
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// If we don't have permission to read variables, treat it as "no variables".
|
|
170
|
+
return [];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// eslint-disable-next-line class-methods-use-this -- part of the VcsProvider instance contract; GitLab's URL scheme needs no instance state
|
|
174
|
+
buildAuthenticatedRemoteUrl(host, token, projectPath) {
|
|
175
|
+
return `https://oauth2:${token}@${host}/${projectPath}.git`;
|
|
176
|
+
}
|
|
177
|
+
// eslint-disable-next-line class-methods-use-this -- part of the VcsProvider instance contract; GitLab's URL scheme needs no instance state
|
|
178
|
+
buildCiCloneUrl(host, ciJobToken, projectPath) {
|
|
179
|
+
return `https://gitlab-ci-token:${ciJobToken}@${host}/${projectPath}.git`;
|
|
180
|
+
}
|
|
181
|
+
async request(endpoint, options = {}) {
|
|
182
|
+
const url = endpoint.startsWith('http') ? endpoint : `${this.apiUrl}${endpoint}`;
|
|
183
|
+
const headers = {
|
|
184
|
+
'PRIVATE-TOKEN': this.token,
|
|
185
|
+
'Content-Type': 'application/json',
|
|
186
|
+
...options.headers,
|
|
187
|
+
};
|
|
188
|
+
const response = await fetch(url, {
|
|
189
|
+
method: options.method,
|
|
190
|
+
headers,
|
|
191
|
+
body: options.body !== undefined ? JSON.stringify(options.body) : undefined,
|
|
192
|
+
});
|
|
193
|
+
if (!response.ok) {
|
|
194
|
+
const errorText = await response.text().catch(() => 'Unknown error');
|
|
195
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText} - ${errorText}`);
|
|
196
|
+
}
|
|
197
|
+
return response;
|
|
198
|
+
}
|
|
199
|
+
async getJson(endpoint) {
|
|
200
|
+
const response = await this.request(endpoint);
|
|
201
|
+
return response.json();
|
|
202
|
+
}
|
|
203
|
+
async getRawText(endpoint) {
|
|
204
|
+
const response = await this.request(endpoint);
|
|
205
|
+
return response.text();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=gitlab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../src/common/vcs/gitlab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA8BH,SAAS,gBAAgB,CAAC,OAA8B;IACtD,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd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CAAC;QAChG,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,KAAK,CAAC,OAAO,CAAC,QAAgB;QACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,QAAgB;QACvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { VcsProvider, VcsProviderKind } from './types.js';
|
|
2
|
+
/** Builds a `VcsProvider` for the given platform. Only `gitlab` is implemented today. */
|
|
3
|
+
export declare function getVcsProvider(kind: VcsProviderKind, apiUrl: string, token: string): VcsProvider;
|
|
4
|
+
export type { VcsBranch, VcsCommit, VcsMergeRequest, VcsProject, VcsProjectVariable, VcsProvider, VcsProviderKind, } from './types.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { GitLabProvider } from './gitlab.js';
|
|
17
|
+
/** Builds a `VcsProvider` for the given platform. Only `gitlab` is implemented today. */
|
|
18
|
+
export function getVcsProvider(kind, apiUrl, token) {
|
|
19
|
+
switch (kind) {
|
|
20
|
+
case 'gitlab':
|
|
21
|
+
return new GitLabProvider(apiUrl, token);
|
|
22
|
+
default:
|
|
23
|
+
throw new Error(`VCS provider "${kind}" is not yet supported.`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/vcs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAC,IAAqB,EAAE,MAAc,EAAE,KAAa;IACjF,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC3C;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAc,yBAAyB,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** The set of source-control-hosting platforms `simply-cicd` knows how to talk to. */
|
|
2
|
+
export type VcsProviderKind = 'gitlab';
|
|
3
|
+
/** A repository/project, normalized across VCS platforms. */
|
|
4
|
+
export type VcsProject = {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
pathWithNamespace: string;
|
|
8
|
+
defaultBranch?: string;
|
|
9
|
+
archived: boolean;
|
|
10
|
+
empty: boolean;
|
|
11
|
+
isFork: boolean;
|
|
12
|
+
/** The raw, platform-specific API response this was derived from. */
|
|
13
|
+
raw: unknown;
|
|
14
|
+
};
|
|
15
|
+
/** A branch, normalized across VCS platforms. */
|
|
16
|
+
export type VcsBranch = {
|
|
17
|
+
name: string;
|
|
18
|
+
raw: unknown;
|
|
19
|
+
};
|
|
20
|
+
/** The result of a file-content commit, normalized across VCS platforms. */
|
|
21
|
+
export type VcsCommit = {
|
|
22
|
+
id?: string;
|
|
23
|
+
raw: unknown;
|
|
24
|
+
};
|
|
25
|
+
/** A merge/pull request, normalized across VCS platforms. */
|
|
26
|
+
export type VcsMergeRequest = {
|
|
27
|
+
id: number;
|
|
28
|
+
iid: number;
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
sourceBranch: string;
|
|
32
|
+
targetBranch: string;
|
|
33
|
+
webUrl?: string;
|
|
34
|
+
raw: unknown;
|
|
35
|
+
};
|
|
36
|
+
/** A project/repo-level CI variable, normalized across VCS platforms. */
|
|
37
|
+
export type VcsProjectVariable = {
|
|
38
|
+
key: string;
|
|
39
|
+
value: string;
|
|
40
|
+
raw: unknown;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* A source-control-hosting platform client, abstracted so that platforms beyond GitLab (e.g.
|
|
44
|
+
* GitHub) can be added later without changing any command that consumes a `VcsProvider`.
|
|
45
|
+
*/
|
|
46
|
+
export interface VcsProvider {
|
|
47
|
+
/** Lists all projects/repos under a group/org, including subgroups, paginating as needed. */
|
|
48
|
+
getGroupProjects(groupId: string | number): Promise<VcsProject[]>;
|
|
49
|
+
/** Fetches the raw content of a file from a project at a given ref. */
|
|
50
|
+
getFileContent(projectId: string | number, filePath: string, ref: string): Promise<string>;
|
|
51
|
+
/** Returns whether a branch exists in a project. */
|
|
52
|
+
branchExists(projectId: string | number, branchName: string): Promise<boolean>;
|
|
53
|
+
/** Creates a branch from a reference point (usually the project's default branch). */
|
|
54
|
+
createBranch(projectId: string | number, branchName: string, ref: string): Promise<VcsBranch>;
|
|
55
|
+
/** Commits new content for a single file to a branch. */
|
|
56
|
+
commitFile(projectId: string | number, branchName: string, commitMessage: string, filePath: string, content: string): Promise<VcsCommit>;
|
|
57
|
+
/** Finds an existing open merge/pull request with the given source and target branch, if any. */
|
|
58
|
+
findOpenMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string): Promise<VcsMergeRequest | undefined>;
|
|
59
|
+
/** Creates a new merge/pull request. */
|
|
60
|
+
createMergeRequest(projectId: string | number, sourceBranch: string, targetBranch: string, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
|
|
61
|
+
/** Updates an existing merge/pull request's title, description, and labels. */
|
|
62
|
+
updateMergeRequest(projectId: string | number, mergeRequestId: number, title: string, description: string, labels?: string): Promise<VcsMergeRequest>;
|
|
63
|
+
/** Fetches project/repo-level CI variables. Returns an empty array if unreadable. */
|
|
64
|
+
getProjectVariables(projectId: string | number): Promise<VcsProjectVariable[]>;
|
|
65
|
+
/** Builds a token-authenticated remote URL suitable for push/tag operations (e.g. `git remote add`). */
|
|
66
|
+
buildAuthenticatedRemoteUrl(host: string, token: string, projectPath: string): string;
|
|
67
|
+
/** Builds a CI-job-token-authenticated remote URL suitable for a read-only `git clone`. */
|
|
68
|
+
buildCiCloneUrl(host: string, ciJobToken: string, projectPath: string): string;
|
|
69
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/vcs/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** Plugins installed by default before running a deployment. */
|
|
17
|
+
export const DEFAULT_DEPLOYMENT_PLUGINS = ['@simplysf/simply'];
|
|
18
|
+
//# sourceMappingURL=defaultDeploymentPlugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultDeploymentPlugins.js","sourceRoot":"","sources":["../../src/config/defaultDeploymentPlugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAa,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/** Plugins pre-approved as trusted unsigned publishers, to avoid interactive install prompts. */
|
|
17
|
+
export const TRUSTED_PLUGINS = ['sfdmu', '@simplysf/simply'];
|
|
18
|
+
//# sourceMappingURL=trustedPlugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustedPlugins.js","sourceRoot":"","sources":["../../src/config/trustedPlugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,iGAAiG;AACjG,MAAM,CAAC,MAAM,eAAe,GAAa,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export default {};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Delete scratch orgs older than 3 hours from every configured Dev Hub.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
For each Dev Hub, queries `ActiveScratchOrg` records created more than 3 hours ago and bulk-deletes them. Useful for keeping a shared Dev Hub's scratch org allotment from being exhausted by abandoned CI runs.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- <%= config.bin %> <%= command.id %> --dev-hub-name main --dev-hub-username devhub@example.com --dev-hub-client-id 3MVG9... --dev-hub-instance-url https://login.salesforce.com --jwt-key-file ./server.key
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create a fallback git tag carrying forward the previous package version's ID, for builds that didn't produce a new package version.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Resolves the last tag to increment (either `--last-tag`, or the closest reachable tag matching the project's version prefix), extracts its annotated `04t` package version ID, and creates/pushes a new tag with an incremented numeric suffix (e.g. `v1.1.0` -> `v1.1.0-1` -> `v1.1.0-2`) annotated with that same package ID. Soft no-ops (does not error) when no last tag, or no valid package ID within it, can be found — a build with nothing to fall back to just has nothing to do here.
|
|
8
|
+
|
|
9
|
+
Skipped automatically when `PACKAGE_CHANGED=TRUE` is set in the environment (see `build determine-package-changes`) — a real package version will be created instead.
|
|
10
|
+
|
|
11
|
+
# flags.last-tag.summary
|
|
12
|
+
|
|
13
|
+
Manually specify the last tag to increment, instead of resolving it from git.
|
|
14
|
+
|
|
15
|
+
# flags.out.summary
|
|
16
|
+
|
|
17
|
+
Output dotenv file path.
|
|
18
|
+
|
|
19
|
+
# examples
|
|
20
|
+
|
|
21
|
+
- <%= config.bin %> <%= command.id %> --ci-commit-ref-name main --ci-project-path group/project --project-access-token glpat-... --ci-pipeline-id 123
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create a new package version, verify minimum code coverage, and create/push a version-tracking git tag.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Skips entirely (without error) when the pipeline was triggered by a merge request, or when this isn't a release-branch build and `--always-create-package` wasn't passed. Otherwise, creates a new version of the default package directory's package, polls until creation finishes, verifies the resulting version's Apex code coverage meets `--code-coverage-minimum` (or the project's own `plugins.simply.coverageRequirement.minimumCoverageRequired`, if declared in `sfdx-project.json`), and creates/pushes a git tag annotated with the new package version's `04t` ID.
|
|
8
|
+
|
|
9
|
+
Skipped automatically when `PACKAGE_CHANGED=FALSE` is set in the environment (see `build determine-package-changes`).
|
|
10
|
+
|
|
11
|
+
# flags.ci-commit-sha.summary
|
|
12
|
+
|
|
13
|
+
Commit SHA to tag as the package version's source.
|
|
14
|
+
|
|
15
|
+
# flags.ci-pipeline-source.summary
|
|
16
|
+
|
|
17
|
+
Source trigger of the CI pipeline (e.g. merge_request_event). When set to merge_request_event, package creation is skipped.
|
|
18
|
+
|
|
19
|
+
# flags.ci-pipeline-url.summary
|
|
20
|
+
|
|
21
|
+
URL of the CI pipeline, used as the package version's description.
|
|
22
|
+
|
|
23
|
+
# flags.devhub-tooling-username.summary
|
|
24
|
+
|
|
25
|
+
Username of the Dev Hub used for tooling operations like package version creation.
|
|
26
|
+
|
|
27
|
+
# flags.devhub-tooling-client-id.summary
|
|
28
|
+
|
|
29
|
+
Connected app client ID for the tooling Dev Hub.
|
|
30
|
+
|
|
31
|
+
# flags.devhub-tooling-instance-url.summary
|
|
32
|
+
|
|
33
|
+
Login instance URL for the tooling Dev Hub.
|
|
34
|
+
|
|
35
|
+
# flags.always-create-package.summary
|
|
36
|
+
|
|
37
|
+
Create a package version even when this isn't a release-branch build.
|
|
38
|
+
|
|
39
|
+
# flags.code-coverage-minimum.summary
|
|
40
|
+
|
|
41
|
+
Minimum Apex code coverage percentage required for the new package version.
|
|
42
|
+
|
|
43
|
+
# flags.package-release-branch-prefix.summary
|
|
44
|
+
|
|
45
|
+
Prefix identifying release branches. Determines whether this build creates a package version and how the resulting git tag is named.
|
|
46
|
+
|
|
47
|
+
# examples
|
|
48
|
+
|
|
49
|
+
- <%= config.bin %> <%= command.id %> --ci-commit-ref-name main --ci-commit-sha a1b2c3d --ci-pipeline-id 123 --ci-pipeline-url https://gitlab.example.com/pipelines/123 --ci-project-path group/project --project-access-token glpat-... --devhub-tooling-username devhub-tooling@example.com --devhub-tooling-client-id 3MVG9... --devhub-tooling-instance-url https://login.salesforce.com --jwt-key-file ./server.key
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create a scratch org, trying each configured Dev Hub in order.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Reads the default package directory's `definitionFile` from `sfdx-project.json` (falling back to `--scratch-definition-file`), and attempts creation against each `--dev-hub-*` in order. A Dev Hub that has hit its daily scratch org limit is skipped in favor of the next one. Writes the resulting org's auth fields to `SCRATCH_ORG_INFO.json` for later build steps, best-effort sets a default `CountryCode`, and assigns any permission sets/licenses declared under the default package directory's `packageMetadataAccess`.
|
|
8
|
+
|
|
9
|
+
Skipped automatically when `PACKAGE_CHANGED=FALSE` is set in the environment (see `build determine-package-changes`).
|
|
10
|
+
|
|
11
|
+
# flags.scratch-definition-file.summary
|
|
12
|
+
|
|
13
|
+
Definition file used to create the scratch org, if not specified in sfdx-project.json.
|
|
14
|
+
|
|
15
|
+
# flags.scratch-duration-days.summary
|
|
16
|
+
|
|
17
|
+
Duration of the scratch org in days.
|
|
18
|
+
|
|
19
|
+
# examples
|
|
20
|
+
|
|
21
|
+
- <%= config.bin %> <%= command.id %> --dev-hub-name main --dev-hub-username devhub@example.com --dev-hub-client-id 3MVG9... --dev-hub-instance-url https://login.salesforce.com --jwt-key-file ./server.key
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Delete the scratch org created by `build create-scratch`.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Reads `SCRATCH_ORG_INFO.json` (written by `build create-scratch`) to find which Dev Hub owns the scratch org, authenticates to that Dev Hub and the scratch org, and deletes it. Deletion failures are logged rather than thrown, since a scratch org left behind after a failed deletion just needs manual cleanup and shouldn't fail an otherwise-successful pipeline run.
|
|
8
|
+
|
|
9
|
+
Skipped automatically when `PACKAGE_CHANGED=FALSE` is set in the environment (see `build determine-package-changes`).
|
|
10
|
+
|
|
11
|
+
# examples
|
|
12
|
+
|
|
13
|
+
- <%= config.bin %> <%= command.id %> --dev-hub-name main --dev-hub-username devhub@example.com --dev-hub-client-id 3MVG9... --dev-hub-instance-url https://login.salesforce.com --jwt-key-file ./server.key
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Determine if any package-relevant files have changed since the last release tag.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Reads the default package directory from `sfdx-project.json`, finds the closest reachable git tag matching its version prefix, and diffs that tag against `HEAD` for the package directory and `sfdx-project.json` itself. Writes `PACKAGE_CHANGED=TRUE|FALSE` and `LAST_TAG=<tag>` to the output file. Any failure during detection (missing/invalid sfdx-project.json, git errors) defaults to `PACKAGE_CHANGED=TRUE`, so a build never silently skips work it should have done.
|
|
8
|
+
|
|
9
|
+
# flags.out.summary
|
|
10
|
+
|
|
11
|
+
Output dotenv file path.
|
|
12
|
+
|
|
13
|
+
# examples
|
|
14
|
+
|
|
15
|
+
- <%= config.bin %> <%= command.id %> --out changes.env
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Generate a FlexiPage delta between two commits and post the results to the merge request.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Runs the upstream `flexipage-delta` binary to diff `**/*.flexipage-meta.xml` files between `--from` and `--to`, then `flexipage-delta-gitlab` to post the results back to the GitLab merge request. Both binaries are GitLab-specific, so this command isn't routed through the VCS provider abstraction. Failures are logged, not thrown — a diff-posting step shouldn't fail the build.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- <%= config.bin %> <%= command.id %> --ci-project-id 123 --ci-merge-request-iid 45 --from abc123 --to def456 --project-access-token glpat-...
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Generate a Flow delta between two commits and post the results to the merge request.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Runs the upstream `flow-delta` binary to diff `**/*.flow-meta.xml` files between `--from` and `--to`, then `flow-delta-gitlab` to post the results back to the GitLab merge request. Both binaries are GitLab-specific, so this command isn't routed through the VCS provider abstraction. Failures are logged, not thrown — a diff-posting step shouldn't fail the build.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- <%= config.bin %> <%= command.id %> --ci-project-id 123 --ci-merge-request-iid 45 --from abc123 --to def456 --project-access-token glpat-...
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Install packaged dependencies into the scratch org created by `build create-scratch`.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Reads `SCRATCH_ORG_INFO.json` (written by `build create-scratch`), authenticates as that scratch org, and installs its packaged dependencies.
|
|
8
|
+
|
|
9
|
+
Skipped automatically when `PACKAGE_CHANGED=FALSE` is set in the environment (see `build determine-package-changes`).
|
|
10
|
+
|
|
11
|
+
# flags.install-type.summary
|
|
12
|
+
|
|
13
|
+
The type of dependency installation to perform.
|
|
14
|
+
|
|
15
|
+
# examples
|
|
16
|
+
|
|
17
|
+
- <%= config.bin %> <%= command.id %> --jwt-key-file ./server.key
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Install the LWC Jest test libraries and run the project's LWC Jest tests with coverage.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Installs `@salesforce/sfdx-lwc-jest` and `@sa11y/jest`, then runs `sfdx-lwc-jest --coverage -- --passWithNoTests`. Failures are logged, not thrown.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- <%= config.bin %> <%= command.id %>
|