V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ophunter
V2EX  ›  Android

请假下 Jenkins 问题

  •  
  •   ophunter · 2018-07-20 10:39:01 +08:00 · 6023 次点击
    这是一个创建于 2099 天前的主题,其中的信息可能已经有所发展或是发生改变。
    请问下 React Native 项目,怎么用 Jenkins 打安卓包
    第 1 条附言  ·  2018-07-20 15:04:01 +08:00
    😁,我一个人开发,对 react native 和 Jenkins 都不是很熟。
    解决问题是核心,其他再说。
    18 条回复    2018-08-23 10:45:56 +08:00
    wingyiu
        1
    wingyiu  
       2018-07-20 10:43:12 +08:00
    写脚本
    ophunter
        2
    ophunter  
    OP
       2018-07-20 12:34:35 +08:00
    @wingyiu 嗯嗯搞定了,把 node_modules 也上传到 git 就可以了
    helllkz
        3
    helllkz  
       2018-07-20 13:33:35 +08:00
    为什么不是在 jenkins 里面执行 install,把 node 传到 git 是什么鬼
    SoulSleep
        4
    SoulSleep  
       2018-07-20 13:46:21 +08:00
    jenkins 明明可以执行命令的。。。。
    for4die
        5
    for4die  
       2018-07-20 13:50:08 +08:00 via Android
    RN 项目的 ios 怎么打包,用苹果的系统吗
    xiongshengyao
        6
    xiongshengyao  
       2018-07-20 13:53:43 +08:00
    node_modules 上传到 git ?不怕被同事打死吗?
    acrisliu
        7
    acrisliu  
       2018-07-20 13:55:03 +08:00
    楼主你这种做法很那啥啊,直接 npm install 不行吗 😂
    wly19960911
        8
    wly19960911  
       2018-07-20 14:13:00 +08:00 via Android
    “嗯嗯搞定了,把 node_modules 也上传到 git 就可以了”

    意思是已经做了?

    快跑路吧(),同事来寻仇了。

    我 modules 几万个文件,看见想死,还包括 cnpm 和 npm 的 modules 不一样的情况存在,环境不一样
    ophunter
        9
    ophunter  
    OP
       2018-07-20 14:36:44 +08:00
    😁,我一个人开发,对 react native 和 Jenkins 都不是很熟。
    解决问题是核心,其他再说。
    simon4761
        10
    simon4761  
       2018-07-20 14:39:58 +08:00
    pipeline 能搞定你一切。。
    shmilyin
        11
    shmilyin  
       2018-07-20 14:43:27 +08:00
    打包前 npm install 啊 上传 node_modules 是什么鬼
    arclin16
        12
    arclin16  
       2018-07-20 14:50:08 +08:00
    别把 node_modules 传上去呀 ... 你在 Jenkins 上跑 npm install 不好吗 ...
    wly19960911
        13
    wly19960911  
       2018-07-20 15:00:06 +08:00
    @ophunter 对了,提醒下,上传 node_modules 可能会造成其他问题,因为 node-sass 在 win 下和在 linux 下的包不一样,就算你上传打包了,也会发生错误。

    所以就算可以,也最好别这么做。
    yggd
        14
    yggd  
       2018-07-20 15:03:10 +08:00
    jenkins 里可以执行脚本啊,写个脚本编译啊
    sniffles
        15
    sniffles  
       2018-07-20 15:17:20 +08:00
    jenkins 直接跑脚本+1
    wingyiu
        16
    wingyiu  
       2018-07-20 18:33:59 +08:00
    @xiongshengyao 这操作牛逼得一塌糊涂,几千个文件啊
    paranoiagu
        17
    paranoiagu  
       2018-07-20 18:42:22 +08:00 via Android
    Jenkins 真是个好东西,最近都在搞编译脚本,搞好后,省了很多人力。而且不会出错。
    hongch
        18
    hongch  
       2018-08-23 10:45:56 +08:00
    不要用默认的 gradle 脚本脚本
    在打包最后写一个 shell
    1.npminstall

    2.react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output app/src/main/assets/index.android.bundle --assets-dest app/src/main/res/

    3../gradlew $build_action
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1245 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:50 · PVG 01:50 · LAX 10:50 · JFK 13:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.