在我的 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) 我正在将来自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) 我们正在为不同的服务运行几个 NestJS 应用程序。它们都共享一些通用代码,在我们的例子中是 ConfigModule 和 CacheModule。我想将它们分解并放入公司“通用”npm 包中,以最大程度地减少代码复制。
\n但我遇到了一个错误:
\n\n\nNest 无法导出不属于当前处理的模块 (ConfigModule) 的\n组件/模块。请验证每个\n导出的单元在此特定上下文中是否可用
\n
我有点不知道问题到底是什么。任何帮助深表感谢。
\n在app.ts服务 A 中:
import {\xc2\xa0ConfigModule } from \'@company/npm-common\';\n...\n@Module({\n imports: [ConfigModule, ...],\n})\nexport class AppModule {}\nRun Code Online (Sandbox Code Playgroud)\n现在@company/npm-common导入到 package.json 中file:../npm-common
npm-common/index.ts:
export * from \'./Config\';\nRun Code Online (Sandbox Code Playgroud)\nnpm-common/Config/index.ts
export { ConfigService } from \'./config.service\';\nexport { ConfigModule }\xc2\xa0from \'./config.module\';\nRun Code Online (Sandbox Code Playgroud)\nnpm-common/Config/config.service:
import { Global, Module } from \'@nestjs/common\';\nimport { ConfigService } from \'./config.service\';\n\n@Global()\n@Module({\n …Run Code Online (Sandbox Code Playgroud)