diff --git a/README.md b/README.md index 0b8586bdcb1daab98616902031b697802938d22b..e6704e786274468751657dc949a713d13d746581 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,291 @@ # Table of Contents -- [Introduction](#introduction) -- [User support](#user-support) -- [Global plugin configuration](#global-plugin-configuration) - - [Gitee-to-Jenkins auth](#gitee-to-jenkins-authentication) - - [Jenkins-to-Gitee auth](#jenkins-to-gitee-authentication) - - [Jenkins Job Configuration](#jenkins-job-configuration) - - [Git configuration](#git-configuration) - - [Freestyle jobs](#freestyle-jobs) - - [Job trigger configuration](#job-trigger-configuration) - - [Webhook URL](#webhook-url) - - [Freestyle jobs](#freestyle-and-pipeline-jobs) - - [Build status configuration](#build-status-configuration) - - [Freestyle jobs](#freestyle-jobs-1) -- [Advanced features](#advanced-features) - - [Branch filtering](#branch-filtering) - - [Add a note to pull requests](#add-a-note-to-merge-requests) -- [Release Workflow](#release-workflow) +- [Introduction](#introduction) + - [Current Supported Features](#Current-Supported-Features) + - [Features in plan](#Features-in-plan) +- [Global plugin installation](#global-plugin-installation) +- [Global plugin configuration](#global-plugin-configuration) + - [Gitee link configuration](#gitee-link-configuration) + + - [Build task configuration](#Build-task-configuration) + - [New build task](#New-build-task) + - [Task global configuration](#Task-global-configuration) + - [Source code management configuration](#Source-code-management-configuration) + - [Trigger configuration](#Trigger-configuration) + + - [Post-build step configuration](#Post-build-step-configuration) + - [Build results back to Gitee](#Build-results-back-to-Gitee) + - [Build successfully and automatically merge PR ](#Build-successfully-and-automatically-merge-PR ) + - [New Gitee project WebHook ](#New-Gitee-project-WebHook ) + - [Test push to trigger build](#Test-push-to-trigger-build) + - [Test PR trigger build](#Test-PR-trigger-build) + - [Use scripts to configure triggers](#Use-scripts-to-configure-triggers) +- [Environment variable](#Environment-variable) +- [User support](#user-support) +- [Participate in contribution](#Participate-in-contribution) + - [Package or run tests](#Package-or-run-tests) # Introduction This plugin allows Gitee to trigger builds in Jenkins when code is committed or pull requests are opened/updated. It can also send build status back to Gitee. -### Seeking maintainers +## Current Supported Features +- When pushing code to the Gitee, the configured Webhook triggers the Jenkins task build。 +- Comments on a submission record trigger a Jenkins task build for the corresponding version of the submission record +- When submitting a Pull Request to a Gitee project, Jenkins task builds are triggered by the configured Webhook, which supports PR actions: New, Update, Accept, Close, Review Pass, Test Pass. +- Support [ci-skip] instruction filtering or [ci-build] instruction to trigger build. +- Filter Commit versions that have already been built. If the branch is Push, the same branch Push is filtered,and if the branch is PR, the same PR is filtered. +- Filters triggers by branch name。 +- Regular expressions filter the branches that can be triggered。 +- Set the Webhook authentication password。 +- Post-build operations can configure PR triggered build results to comment in the corresponding PR of Gitee. +- Post-build operation configurable PR triggered by the successful build, the corresponding PR can be automatically merged. +- For all PR-related events, if the PR code conflicts cannot be automatically merged, the build will not be triggered; and if the function of commenting to PR is configured, the comment to PR will prompt conflict. +- PR comments can be triggered via WebHook (can be used for PR to trigger a build failure to facilitate re-triggering the build from the code cloud platform comments). +- Support for configuring PR does not require filtering to trigger a build when testing is required. (Can be used to build a deployment test environment without testing). +- Support the same PR to trigger the construction, cancel the incomplete construction in progress, and proceed to the current construction (the same PR construction is not queued, and multiple different PR constructions still need to be queued). + +## Features in plan +1. PR review and test pass trigger build (users can trigger deployment, and the feature of automatically merged PR can be used to improve the workflow.) +2. Check the trigger mode to automatically add WebHook to Gitee. + +# Global plugin installation +1. Online installation + - Go to Manage Jenkins -> Manage Plugins -> Available + - Right Filter enter: Gitee + - Check Gitee in the optional list below (if Gitee does not exist in the list, click Check now to update the plug-in list) + - Click Download now and install after restart + +![输入图片说明](https://images.gitee.com/uploads/images/2018/0723/112748_b81a1ee3_58426.png "屏幕截图.png") + +2. Manual installation + - From [release](https://gitee.com/oschina/Gitee-Jenkins-Plugin/releases) Enter the latest release in the list and download the corresponding XXX.hpi file + - Go to Manage Jenkins -> Manage Plugins -> Advanced + - In Upload Plugin File, select the XXX.hpi you just downloaded and click Upload + - Check in the subsequent pages Restart Jenkins when installation is complete and no jobs are running + +![输入图片说明](https://images.gitee.com/uploads/images/2018/0723/113303_2a1d0a03_58426.png "屏幕截图.png") -This plugin was developed base on [GitLab Plugin](https://github.com/jenkinsci/gitlab-plugin) by [Gitee.com](https://gitee.com). [Gitee.com](https://gitee.com) will continue to maintain this plugin. +# Global plugin configuration +## Gitee link configuration +1. Go on Jenkins -> Manage Jenkins -> Configure System -> Gitee Configuration -> Gitee connections +2. Enter ``Gitee`` or the name you want in ``Connection name`` +3. Enter the full URL address of Gitee in ``Gitee host URL'': ``https://gitee.com`` (Customers of Gitee privatization enter the deployed domain name) +4. If you haven't configured the Code Cloud APIV5 private token in ``Credentials'', click ``Add'' -> ``Jenkins `` + 1. ``Domain`` select ``Global credentials`` + 2. ``Kind`` select ``Gitee API Token`` + 3. ``Scope`` choose the range you need + 4. ``Gitee API Token`` Enter your code cloud private token to obtain the address: https://gitee.com/profile/personal_access_tokens + 5. Enter the ID and description you want in ``ID``, ``Descripiton``. +5. ``Credentials`` Select the configured Gitee APIV5 Token +6. Click ``Advanced``, you can configure whether to ignore SSL errors (depending on whether your Jenkins environment supports it), and set the link test timeout period (depending on your network environment) + +7. Click ``Test Connection`` to test whether the link is successful, if it fails, please check the above 3, 5, 6 steps. + +After the configuration is successful, as shown in the figure : +![码云链接配置](https://images.gitee.com/uploads/images/2018/0716/185651_68707d16_58426.png "屏幕截图.png") + +### New build task +Go to Jenkins -> New Item, enter'Gitee Test' as name, select ``Freestyle project`` and save to create a build project. + +### Task global configuration +In the task global configuration, you need to select the code cloud link in the previous step. Go to Configure -> General of a task (such as'Gitee Test'), and select the code cloud link configured earlier in Gitee connection, as shown in the figure: : +![任务全局配置](https://images.gitee.com/uploads/images/2018/0716/191715_9660237b_58426.png "屏幕截图.png") + +### Source code management configuration +Go to the Configure -> Source Code Management tab of a task (such as'Gitee Test') +1. Click *Git* +2. Enter your warehouse address, for example ``git@your.gitee.server:gitee_group/gitee_project.git`` + 1. Click the *Advanced* button, enter in the *Name* field ``origin``, *Refspec* Field input ``+refs/heads/*:refs/remotes/origin/* +refs/pull/*/MERGE:refs/pull/*/MERGE`` +,Note that the new version of jenkins no longer accepts multiple refs descriptions that contain * wildcards at the same time. If only the push trigger can write the first half, if only PR triggers, only the second half can be written. See the figure below for details :![输入图片说明](https://images.gitee.com/uploads/images/2020/0601/220940_0ce95dd0_58426.png "屏幕截图.png") +3. Credentials, please enter the username and password credentials corresponding to the https address of the git warehouse, or the ssh key credentials corresponding to ssh. Note that the Gitee API Token credentials cannot be used for source code management credentials, but only used for the API call credentials of the gitee plugin. +4. *Branch Specifier* options: + 1. For single warehouse workflow input : ``origin/${giteeSourceBranch}`` + 2. For PR workflow input : ``pull/${giteePullRequestIid}/MERGE`` +5. *Additional Behaviours* options: + 1. For a single warehouse workflow, if you want to merge the default branch (released branch) before the pushed branch is built, you can do the following: + 1. Click the *Add* drop-down box + 2. Select *Merge before build* + 3. Set *Name of repository* to ``origin`` + 4. Set *Branch to merge to* to ``${ReleaseBranch}`` The default branch (release branch) you want to merge + 2. For the PR workflow, the code cloud server has pre-merged the original branch and target branch of the PR. You can build it directly. If the target branch is not the default branch (release branch), you can also merge before the appeal build.。 + +The configuration is shown in the figure: + +![源码管理配置](https://images.gitee.com/uploads/images/2018/0716/191913_ef0995f4_58426.png "屏幕截图.png") + +### Trigger configuration + +Go to the trigger build of task configuration: Configure -> Build Triggers tab + +1. ``Enabled Gitee triggers`` Check the build trigger rules you need, such as `Push Event`, `Opened Merge Request Events`, the checked events will receive WebHook and trigger the build. Currently supported trigger events are : + - Push Events + - Commit Comment Events + - Opened Merge Request Events + - Updated Merge Request Events + - Accepted Merge Request Events + - Closed Merge Request Events + - Approved Pull Requests + - Tested Pull Requests +2. `Build Instruction Filter` : + - `None` + - `[ci-skip] skip build` :When commit message or PR description contains `[ci-skip]`, skip the build trigger. + - `[ci-build] trigger build` :When commit message or PR description contains `[ci-build]`, the build will be triggered. +3. `Ignore last commit has build` This option can skip the Commit version that has been built. +4. `Cancel incomplete build on same Pull Requests` This option will determine whether there is an unfinished build with the same PR when the PR triggers the build. If there is, the unfinished build will be cancelled and the current build will be carried out. +5. `Ignore Pull Request conflicts` This option will select whether to build according to the PR conflict when the PR triggers the build. +6. `Allowed branches` You can configure the branches that are allowed to be built, and currently support branch names and regular expressions for filtering. +7. `Secret Token for Gitee WebHook` This option can configure the password of WebHook, which needs to be consistent with the password configured by Code Cloud WebHook to trigger the construction. +8. Note: If the PR status is not automatically merged, the build will not be triggered 。 +![触发器配置](https://images.gitee.com/uploads/images/2021/0107/171932_e25c8359_2102225.png "屏幕截图.png") + +### Post-build step configuration + +Go to the post-build configuration of task configuration: Configure -> Post-build Actions tab + +#### Build results back to Gitee + +1. Click the drop-down box of `Add post-build action` to select: `Add note with build status on Gitee pull requests` +2. It can be configured in `Advanced`: + - Add message only for failed builds :Re-evaluate to Code Cloud only for failed builds + - Customize the content of the feedback for each state (the content can refer to the environment variables of Jenkins, or custom environment variables) +3. If you turn on this function, you can also review the non-automatically merged state to Gitee. + +#### Build successfully and automatically merge PR +Click the drop-down box of `Add post-build action` to select: `Accept Gitee pull request on success` + +![构建后步骤配置](https://images.gitee.com/uploads/images/2018/0716/192304_0e323bc0_58426.png "屏幕截图.png") + +### New Gitee project WebHook +Enter the Gitee project set in the source management configuration, enter Management -> WebHooks + +1. Add WebHook and fill in the URL in `Trigger configuration: Build when a change is pushed to Gitee. Gitee webhook URL`, as shown in : http://127.0.0.1:8080/jenkins/project/fu +2. Password: the WebHook password configured in point 5 of the trigger configuration, you can leave it without a password +3. Check PUSH, Pull Request + +#### Test push to trigger build +1. In the WebHook management of Gitee, select the WebHook with PUSH ticked and click test to observe the construction status of the Jenkins task +2. Edit a file on the Gitee project page and submit it, and observe the build status of the Jenkins task + +#### Test PR trigger build +1. In the WebHook management of Gitee, select the WebHook with Pull Request checked and click test to observe the construction status of the Jenkins task +2. Create a new Pull Request in the Gitee project and observe the build status of the Jenkins task + +## Use scripts to configure triggers +```groovy +pipeline { + + agent any + + triggers { + gitee ( + // Push code + triggerOnPush: true, + // Comment submission record + triggerOnCommitComment: true, + // New Pull Requests + triggerOnOpenPullRequest: true, + // Update Pull Requests "0":None "1":Source Branch updated "2":Target Branch updated "3":Both Source and Target Branch updated + triggerOnUpdatePullRequest: "1", + // accept Pull Requests + triggerOnAcceptedPullRequest: true, + // Close Pull Requests + triggerOnClosedPullRequest: true, + // Approved Pull Requests + triggerOnApprovedPullRequest: true, + // Test passed Pull Requests + triggerOnTestedPullRequest: true, + // comment Pull Requests + triggerOnNoteRequest: true, + // Regular expression for comment content + noteRegex: "build", + // Build command filtering "NONE": None "CI_SKIP":[ci-skip] command to skip building "CI_BUILD":[ci-build] command to trigger build + buildInstructionFilterType: "NONE", + // PR does not require that you filter the build when you have to test + ciSkipFroTestNotRequired: false, + // Filter the Commit version that has been built + skipLastCommitHasBeenBuild: false, + // Cancel the same Pull Requests incomplete construction + cancelIncompleteBuildOnSamePullRequest: false, + // Branches allowed to trigger construction "All": Allow all branches to trigger construction "NameBasedFilter": Filter by branch name "RegexBasedFilter":Filter branches based on regular expressions + branchFilterType: "All", + // "NameBasedFilter" - include + includeBranchesSpec: "include", + // "NameBasedFilter" - exclude + excludeBranchesSpec: "exclude", + // "RegexBasedFilter" - Regular expression of the target branch + targetBranchRegex: "regex", + // Gitee WebHook password + secretToken: "123456" + ) + } + + stages { + stage('Build') { + steps{ + echo 'Hello world!' + } + } + } +} +``` + + +# Environment variable +The currently supported environment variables are shown in the following functions. Different WebHook triggers may cause some variables to be empty. Please install the plug-in for details. [EnvInject Plugin](https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin), View in build Environment Variables + + +```java + public Map getBuildVariables() { + MapWrapper variables = new MapWrapper<>(new HashMap()); + variables.put("giteeBranch", branch); + variables.put("giteeSourceBranch", sourceBranch); + variables.put("giteeActionType", actionType.name()); + variables.put("giteeUserName", userName); + variables.put("giteeUserEmail", userEmail); + variables.put("giteeSourceRepoHomepage", sourceRepoHomepage); + variables.put("giteeSourceRepoName", sourceRepoName); + variables.put("giteeSourceNamespace", sourceNamespace); + variables.put("giteeSourceRepoURL", sourceRepoUrl); + variables.put("giteeSourceRepoSshUrl", sourceRepoSshUrl); + variables.put("giteeSourceRepoHttpUrl", sourceRepoHttpUrl); + variables.put("giteePullRequestTitle", pullRequestTitle); + variables.put("giteePullRequestDescription", pullRequestDescription); + variables.put("giteePullRequestId", pullRequestId == null ? "" : pullRequestId.toString()); + variables.put("giteePullRequestIid", pullRequestIid == null ? "" : pullRequestIid.toString()); + variables.put("giteePullRequestTargetProjectId", pullRequestTargetProjectId == null ? "" : pullRequestTargetProjectId.toString()); + variables.put("giteePullRequestLastCommit", lastCommit); + variables.put("giteePushCreated", created ? "true" : "false"); + variables.put("giteePushDeleted", deleted ? "true" : "false"); + variables.putIfNotNull("giteePullRequestState", pullRequestState); + variables.putIfNotNull("giteeMergedByUser", mergedByUser); + variables.putIfNotNull("giteePullRequestAssignee", pullRequestAssignee); + variables.put("giteeTargetBranch", targetBranch); + variables.put("giteeTargetRepoName", targetRepoName); + variables.put("giteeTargetNamespace", targetNamespace); + variables.put("giteeTargetRepoSshUrl", targetRepoSshUrl); + variables.put("giteeTargetRepoHttpUrl", targetRepoHttpUrl); + variables.put("giteeBefore", before); + variables.put("giteeAfter", after); + variables.put("giteeBeforeCommitSha", before); + variables.put("giteeAfterCommitSha", after); + variables.put("giteeRef", ref); + variables.put("ref", ref); + variables.put("beforeSha", beforeSha); + variables.put("isTag", isTag); + variables.put("sha", sha); + variables.put("status", status); + variables.put("stages", stages); + variables.put("createdAt", createdAt); + variables.put("finishedAt", finishedAt); + variables.put("duration", buildDuration); + variables.put("jsonBody", jsonBody); + variables.put("noteBody", noteBody); + variables.putIfNotNull("giteeTriggerPhrase", triggerPhrase); + return variables; + } + +``` # User support @@ -42,98 +303,10 @@ Gitee Jenkins plugin introduced improved logging for debugging purposes. To enab 6. Refresh the log page and you should see output -# Global plugin configuration -## Gitee-to-Jenkins authentication -By default the plugin will require authentication to be set up for the connection from Gitee to Jenkins, in order to prevent unauthorized persons from being able to trigger jobs. - -### Configuring global authentication -1. Create a user in Jenkins which has, at a minimum, Job/Build permissions -2. Log in as that user (this is required even if you are a Jenkins admin user), then click on the user's name in the top right corner of the page -3. Click 'Configure,' then 'Show API Token...', and note/copy the User ID and API Token -4. In Gitee, when you create webhooks to trigger Jenkins jobs, use this format for the URL and do not enter anything for 'Secret Token': `http://USERID:APITOKEN@JENKINS_URL/project/YOUR_JOB` -5. After you add the webhook, click the 'Test' button, and it should succeed - -### Configuring per-project authentication - -If you want to create separate authentication credentials for each Jenkins job: -1. In the configuration of your Jenkins job, in the Gitee configuration section, click 'Advanced' -2. Click the 'Generate' button under the 'Secret Token' field -3. Copy the resulting token, and save the job configuration -4. In Gitee, create a webhook for your project, enter the trigger URL (e.g. `http://JENKINS_URL/project/YOUR_JOB`) and paste the token in the Secret Token field -5. After you add the webhook, click the 'Test' button, and it should succeed - - -## Jenkins-to-Gitee authentication -**PLEASE NOTE:** This auth configuration is only used for accessing the Gitee API for sending build status to Gitee. It is **not** used for cloning git repos. The credentials for cloning (usually SSH credentials) should be configured separately, in the git plugin. - -This plugin can be configured to send build status messages to Gitee, which show up in the Gitee Pull Request UI. To enable this functionality: -1. Create a new user in Gitee -2. Give this user 'Developer' permissions on each repo you want Jenkins to send build status to -3. Log in or 'Impersonate' that user in Gitee, click the user's icon/avatar and choose Settings -4. Click on 'Access Tokens' -5. Create a token named e.g. 'jenkins' with 'api' scope; expiration is optional -6. Copy the token immediately, it cannot be accessed after you leave this page -7. On the Global Configuration page in Jenkins, in the Gitee configuration section, supply the Gitee host URL, e.g. `http://your.gitee.server` -8. Click the 'Add' button to add a credential, choose 'Gitee API token' as the kind of credential, and paste your Gitee user's API key into the 'API token' field -9. Click the 'Test Connection' button; it should succeed - -# Jenkins Job Configuration - -There are two aspects of your Jenkins job that you may want to modify when using Gitee to trigger jobs. The first is the Git configuration, where Jenkins clones your git repo. The Gitee Jenkins Plugin will set some environment variables when Gitee triggers a build, and you can use those to control what code is cloned from Git. The second is the configuration for sending the build status back to Gitee, where it will be visible in the commit and/or pull request UI. - - -You will need to update this code anytime you add or remove parameters. - -## Git configuration -### Freestyle jobs -In the *Source Code Management* section: - -1. Click *Git* -2. Enter your *Repository URL*, such as ``git@your.gitee.server:gitee_group/gitee_project.git`` - 1. In the *Advanced* settings, set *Name* to ``origin`` and *Refspec* to ``+refs/heads/*:refs/remotes/origin/* +refs/pull/*/MERGE:refs/pull/*/MERGE`` -3. In *Branch Specifier* enter: - 1. For single-repository workflows: ``origin/${giteeSourceBranch}`` - 2. For forked repository workflows: ``merge-requests/${giteePullRequestIid}`` -4. In *Additional Behaviours*: - 1. Click the *Add* drop-down button - 2. Select *Merge before build* from the drop-down - 3. Set *Name of repository* to ``origin`` - 4. Set *Branch to merge* as ``${giteeTargetBranch}`` - -## Job trigger configuration -### Webhook URL -When you configure the plugin to trigger your Jenkins job, by following the instructions below depending on job type, it will listen on a dedicated URL for JSON POSTs from Gitee's webhooks. That URL always takes the form ``http://JENKINS_URL/project/PROJECT_NAME``, or ``http://JENKINS_URL/project/FOLDER/PROJECT_NAME`` if the project is inside a folder in Jenkins. **You should not be using** ``http://JENKINS_URL/job/PROJECT_NAME/build`` or ``http://JENKINS_URL/job/gitee-plugin/buildWithParameters``, as this will bypass the plugin completely. - -### Freestyle jobs -1. In the *Build Triggers* section: - * Select *Build when a change is pushed to Gitee* - * Copy the *Gitee webhook URL* shown in the UI (see [here](#webhook-url) for guidance) - * Use the check boxes to trigger builds on *Push Events* and/or *Created Pull Request Events* and/or *Accepted Pull Request Events* and/or *Closed Pull Request Events* - * Optionally use *Rebuild open Pull Requests* to enable re-building open pull requests after a push to the source branch - * If you selected *Rebuild open Pull Requests* other than *None*, check *Comments*, and specify the *Comment for triggering a build*. A new build will be triggered when this phrase appears in a commit comment. In addition to a literal phrase, you can also specify a Java regular expression -2. Configure any other pre build, build or post build actions as necessary -3. Click *Save* to preserve your changes in Jenkins -4. Create a webhook in the relevant Gitee projects (consult the Gitee documentation for instructions on this), and use the URL you copied from the Jenkins job configuration UI. It should look something like `http://JENKINS_URL/project/yourbuildname` - - -## Build status configuration -You can optionally have your Jenkins jobs send their build status back to Gitee, where it will be displayed in the commit or pull request UI as appropriate. - -### Freestyle jobs -Freestyle jobs can only send build status after the build steps are complete. To do this, choose 'Publish build status to Gitee' from the available 'Post-build actions' in your Jenkins job config. Also make sure you have chosen the appropriate Gitee instance from the 'Gitee connection' dropdown menu, if you have more than one. - - -# Advanced features -## Branch filtering -Triggers may be filtered based on the branch name, i.e. the build will only be allowed for selected branches. On the project configuration page, when you configure the Gitee trigger, you can choose 'Filter branches by name' or 'Filter branches by regex.' Filter by name takes comma-separated lists of branch names to include and/or exclude from triggering a build. Filter by regex takes a Java regular expression to include and/or exclude. - -**Note:** This functionality requires access to Gitee and a git repository url already saved in the project configuration. In other words, when creating a new project, the configuration needs to be saved *once* before being able to add branch filters. For Pipeline jobs, the configuration must be saved *and* the job must be run once before the list is populated. - - -## Add a note to pull requests -To add a note to Gitee pull requests after the build completes, select 'Add note with build status on Gitee pull requests' from the optional Post-build actions. Optionally, click the 'Advanced' button to customize the content of the note depending on the build result. +# Participate in contribution +Welcome to submit CI scenario feature suggestions or directly submit PR contribution code -# Release Workflow +## Package or run tests -To perform a plugin hpi file, maintainers can run ``mvn package`` To release a snapshot, e.g. with a bug fix for users to test, just run ``mvn hpi:run`` +To perform a plugin hpi file, maintainers can run ``mvn package`` To release a snapshot, e.g. with a bug fix for users to test, just run ``mvn hpi:run`` \ No newline at end of file diff --git a/translate-info.log b/translate-info.log new file mode 100644 index 0000000000000000000000000000000000000000..ccb824cc6b7a55df364df9c5d1e673e3845332dd --- /dev/null +++ b/translate-info.log @@ -0,0 +1 @@ +{"date":"Mon Apr 26 2021 18:30:27 GMT+0800 (中国标准时间)","process":{"pid":5548,"uid":null,"gid":null,"cwd":"C:\\Users\\SmallYellow\\Desktop\\o\\Web\\Gitee-Jenkins-Plugin","execPath":"C:\\Program Files\\nodejs\\node.exe","version":"v14.16.1","argv":["C:\\Program Files\\nodejs\\node.exe","C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\cli.js","README_zh_CN.md"],"memoryUsage":{"rss":55271424,"heapTotal":32387072,"heapUsed":18804128,"external":2475032,"arrayBuffers":848097}},"os":{"loadavg":[0,0,0],"uptime":34383},"trace":[{"column":46,"file":"C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\src\\util\\diskCache.js","function":"loadDisk","line":25,"method":null,"native":false},{"column":55,"file":"C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\src\\setObjectKey.js","function":null,"line":26,"method":null,"native":false},{"column":30,"file":"internal/modules/cjs/loader.js","function":"Module._compile","line":1063,"method":"_compile","native":false},{"column":10,"file":"internal/modules/cjs/loader.js","function":"Module._extensions..js","line":1092,"method":".js","native":false},{"column":32,"file":"internal/modules/cjs/loader.js","function":"Module.load","line":928,"method":"load","native":false},{"column":14,"file":"internal/modules/cjs/loader.js","function":"Module._load","line":769,"method":"_load","native":false},{"column":19,"file":"internal/modules/cjs/loader.js","function":"Module.require","line":952,"method":"require","native":false},{"column":18,"file":"internal/modules/cjs/helpers.js","function":"require","line":88,"method":null,"native":false},{"column":6,"file":"C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\src\\translateMds.js","function":"translateMds","line":64,"method":null,"native":false},{"column":31,"file":"C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\cli.js","function":"runTranslate","line":170,"method":null,"native":false}],"stack":["TypeError: Cannot read property 'path' of undefined"," at loadDisk (C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\src\\util\\diskCache.js:25:46)"," at Object. (C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\src\\setObjectKey.js:26:55)"," at Module._compile (internal/modules/cjs/loader.js:1063:30)"," at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)"," at Module.load (internal/modules/cjs/loader.js:928:32)"," at Function.Module._load (internal/modules/cjs/loader.js:769:14)"," at Module.require (internal/modules/cjs/loader.js:952:19)"," at require (internal/modules/cjs/helpers.js:88:18)"," at translateMds (C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\src\\translateMds.js:64:6)"," at runTranslate (C:\\Users\\SmallYellow\\AppData\\Roaming\\npm\\node_modules\\translate-mds\\cli.js:170:31)"],"level":"error","message":"uncaughtException: Cannot read property 'path' of undefined","timestamp":"2021-04-26T10:30:27.102Z"}