Giter VIP home page Giter VIP logo

deploy-cli-service's People

Contributors

fuchengwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

deploy-cli-service's Issues

关于回滚上一个版本

希望能增加根据deploy.config.js里的配置的bakDir回滚到上一个版本的功能,可以配置到package.json的scripts里

提个需求啊

非常感谢 @fuchengwei 开发的这个工具

是否可以提几个需求?
1.布署可能会涉及多台服务器,能否支持多台服务器?
2.目前布署需要同时打包,是否可以不打包?
3.布署时需要备份线上版本,是否可以支持“布署前”和“布署后”在服务器上执行一条shell的功能?

解压问题

本地出现 (6)解压成功 服务器上的是压缩文件(有时候会出现)

All configured authentication methods failed

✖ Error: All configured authentication methods failed

之前一直都是没问题的,我把node从14升级到了18.14.0 后,在打包后报了这个错误;还有一个项目一直显示在打包中,只执行build打包都正常,不知该如何处理。有什么好的debug方法吗

希望能支持动静分离

目前公司正式环境是将index.html放到服务器,其他静态文件全部放到阿里oss,要是能支持index传服务器,其他文件传oss就好了

是否需要一个后置任务,用于检测是否复制成功

我早上用的时候,不知道为什么我的.zip文件复制到测试环境中, 但没进行解压。最后控制台得到的解压成功,更新成功。(这个时候是已经有unzip命令的)
(我发现我windows Server一开始没有unzip命令的时候,ssh.execCommand也不会报错)。
但我想再复现都没复现出来。

所以
1.让他报错报出来(这个不知道ssh.execCommand能不能支持),
2.加一个后置任务,我自己加一段代码支持用来检测 这个页面能不能正常访问

希望 webDir 可以支持数组的配置

你好, 希望webDir这里可以放个数组, 有时候需要放服务器的两个位置, 但是部署的文件内容是一致的, 不想打包两次, 想打包一次分别放到服务器的两个位置
如:
webDir: ["地址一", "地址二"]

谢谢作者!

希望增加一个配置项

希望增加一个配置项来配置 文件打包上传成功之后是否要删除上传到服务器的.zip文件。因为我们部署到测试环境之后 确认了没问题就直接拷贝测试服务器的.zip文件到正式服务器运行即可。
谢谢

1.1.0版本问题

前天我用1.0.9版本OK,这个工具感觉非常不错,这里得先感谢一下作者。但是您这里升级得1.1.0版本,文件处理顺序令我惊呆了,我在云端所有得项目都没有了,发现你这边得远端文件处理顺序由先删除旧文件,再上传新文件改成了先上传新文件,上传成功再删除远端文件,oh my god!

希望增加配置,不删除打包目录

项目下有个docs目录写的是项目文档,文档也是部署到nginx,当前执行发布命令后把会把docs目录删掉,希望增加配置可以不删除;也可以理解发布成功后,不删除dist文件夹
image

打包错误

? blue-ydb 项目是否部署到 开发环境? Yes
(1) npm run build
✖ 打包失败
✖ stdout maxBuffer length exceeded

删除本地打包目录时报错

描述:分别在两个项目中使用,其中一个项目没有问题,另一个项目删除本地打包目录时报错

报错信息:
image

打包后的本地目录结构
image
assets和static内部均有大量文件

使用node16和20版本都报错ERR_UNSUPPORTED_ESM_URL_SCHEME

运行deploy命令报错:ERR_UNSUPPORTED_ESM_URL_SCHEME

具体信息如下:

deploy-cli-service deploy --mode dev

node:internal/modules/esm/load:239
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, schemes);
^

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11)
at defaultLoad (node:internal/modules/esm/load:130:3)
at ModuleLoader.load (node:internal/modules/esm/loader:403:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:285:56)
at new ModuleJob (node:internal/modules/esm/module_job:67:26)
at #createModuleJob (node:internal/modules/esm/loader:297:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:254:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:235:17)
at async ModuleLoader.import (node:internal/modules/esm/loader:322:23) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

Node.js v20.12.2

package.json中配置了 type: module的时候,无法打包

image

配置了 "type": "module"的情况下,打包会报错

> [email protected] deploy:test E:\projects\rong-saas
> deploy-cli-service deploy --mode test

E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\deploy-cli-service\lib\commands\deploy.js:291
      const config = require(deployConfigPath)
                     ^

Error [ERR_REQUIRE_ESM]: require() of ES Module E:\projects\rong-saas\deploy.config.js from E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\deploy-cli-service\lib\commands\deploy.js not supported.   
Instead change the require of deploy.config.js in E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\deploy-cli-service\lib\commands\deploy.js to a dynamic import() which is available in all CommonJS mo
dules.
    at Object.apply (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\deploy-cli-service\lib\commands\deploy.js:291:22)
    at Command.<anonymous> (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\deploy-cli-service\lib\service.js:40:19)
    at Command.listener [as _actionHandler] (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\commander\index.js:426:31)
    at Command._parseCommand (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\commander\index.js:1002:14)
    at Command._dispatchSubcommand (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\commander\index.js:953:18)
    at Command._parseCommand (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\commander\index.js:970:12)
    at Command.parse (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\commander\index.js:801:10)
    at Service.run (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\deploy-cli-service\lib\service.js:13:13)
    at Object.<anonymous> (E:\projects\rong-saas\node_modules\.pnpm\[email protected]\node_modules\deploy-cli-service\bin\deploy-cli-service.js:10:9) {
  code: 'ERR_REQUIRE_ESM'
}

百度之后说是由于 Node.js 同时有 Common JS 和 ES6 两套规则导致的

修改源码、把配置改为es module之后可以打包了
node_modules/deploy-cli-service/lib/commands/deploy.js

      // const config = require(deployConfigPath) 改为import()
   let module = await import(`file://${deployConfigPath}`)
      const config = module.default
      const cluster = config.cluster
      const projectName = config.projectName
      const currentTime = new Date().getTime()

      const createdEnvConfig = (env) => {
        checkEnvCorrect(config, env)

        return Object.assign(config[env], {
          privateKey: config.privateKey,
          passphrase: config.passphrase,
          readyTimeout: config.readyTimeout
        })
      }
export default {
  projectName: '', // 项目名称
  passphrase: '',
  test: {
  }
}

请问还有什么其他的解决方案吗?

ubuntu 20.04 ssh 连接异常

错误内容
第三步 ssh 连接 *** 然后:
✖ AssertionError [ERR_ASSERTION]: config.privateKey does not exist at given fs path
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

私钥文件权限给了777 也还是不行 ~/.ssh/id_rsa

关于压缩包文件时间问题

您使用的是zip包 , node-zip-stream

目前问题是, 如果不设置forceLocalTime, 则压缩包里的文件时间会有时区问题

建议您默认设置forceLocalTime为true, 或者开放给开发者自由配置
QQ图片20231212132846

这个在ts 文件中怎么引用啊

deploy.config.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename deploy.config.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in C:\Users\Administrator\Desktop\work\jc-admin\package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

如果将package.json的type 改成 commonjs 是可以用,但同时也就失去了 type 为module的tree-shaking优化。

无法备份

会生成备份文件夹,但是里面没有内容,但控制台却显示已成功备份
image
image
这是bug还是我操作问题,希望开发者能帮忙解惑下

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.