小编Dan*_*éus的帖子

Jenkins 管道 ssh 代理 git push 失败

在我的 jenkins 管道中,我可以很好地克隆存储库,但使用 SSH 代理插件推回标签失败。我已经确保 github 上的部署密钥具有写访问权限,所以似乎还有一些其他问题......

pipeline {
   agent { docker { image 'node:8' } }

   stages {
      stage('Pull Repo') {
          steps {
            git (
                branch: 'master',
                credentialsId: 'cred-id',
                url: 'github.com:***'
            )
            sshagent(['github-omnia']) {
                sh("git tag -a \"release-2.3.${BUILD_NUMBER}\" -m \"Jenkins built ${BUILD_NUMBER}\"")
                sh("git push --tags")
            }
          }
      }
   }
}
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

编辑: 这是错误的控制台输出

[ssh-agent] Using credentials git (Access to Github-**)
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)
$ docker exec a6cee721d592b10bb94abbde0471d24a4320dcd07362affb1f18454d6ebe028d ssh-agent …
Run Code Online (Sandbox Code Playgroud)

git jenkins

6
推荐指数
1
解决办法
1540
查看次数

XMLHttpRequest分块响应,仅读取进行中的最后一个响应

我正在将来自NodeJS应用程序的分块数据发送回浏览器。这些块实际上是json字符串。我遇到的问题是,每次onprogress调用该函数时,它都会添加一串完整的数据。意味着将第二个响应块附加到第一个响应块上,依此类推。我只想获得“立即”收到的数据块。

这是代码:

    console.log("Start scan...");
    var xhr = new XMLHttpRequest();
    xhr.responseType = "text";
    xhr.open("GET", "/servers/scan", true);
    xhr.onprogress = function () {
        console.log("PROGRESS:", xhr.responseText);
    }
    xhr.send();
Run Code Online (Sandbox Code Playgroud)

因此,实际上,xhr.responseText的内容在第三个响应到来时还包含第一个和第二个响应的响应文本。我检查了服务器正在发送的内容,看来那里没有问题。将Node与Express结合使用,并发送res.send("...")几次。标头也设置如下:

res.setHeader('Transfer-Encoding', 'chunked');
res.setHeader('X-Content-Type-Options', 'nosniff');
res.set('Content-Type', 'text/json');
Run Code Online (Sandbox Code Playgroud)

javascript xmlhttprequest chunked node.js

5
推荐指数
1
解决办法
4063
查看次数

共享自定义 NestJS 模块给出“不是当前处理模块的一部分”错误

我们正在为不同的服务运行几个 NestJS 应用程序。它们都共享一些通用代码,在我们的例子中是 ConfigModule 和 CacheModule。我想将它们分解并放入公司“通用”npm 包中,以最大程度地减少代码复制。

\n

但我遇到了一个错误:

\n
\n

Nest 无法导出不属于当前处理的模块 (ConfigModule) 的\n组件/模块。请验证每个\n导出的单元在此特定上下文中是否可用

\n
\n

我有点不知道问题到底是什么。任何帮助深表感谢。

\n

app.ts服务 A 中:

\n
import {\xc2\xa0ConfigModule } from \'@company/npm-common\';\n...\n@Module({\n  imports: [ConfigModule, ...],\n})\nexport class AppModule {}\n
Run Code Online (Sandbox Code Playgroud)\n

现在@company/npm-common导入到 package.json 中file:../npm-common

\n

npm-common/index.ts:

\n
export *  from \'./Config\';\n
Run Code Online (Sandbox Code Playgroud)\n

npm-common/Config/index.ts

\n
export { ConfigService } from \'./config.service\';\nexport { ConfigModule }\xc2\xa0from \'./config.module\';\n
Run Code Online (Sandbox Code Playgroud)\n

npm-common/Config/config.service:

\n
import { Global, Module } from \'@nestjs/common\';\nimport { ConfigService } from \'./config.service\';\n\n@Global()\n@Module({\n …
Run Code Online (Sandbox Code Playgroud)

typescript nestjs

3
推荐指数
1
解决办法
2071
查看次数