ophunter
V2EX  ›  Android

请假下 Jenkins 问题

  •  
  •   ophunter · Jul 20, 2018 · 15550 views
    This topic created in 3034 days ago, the information mentioned may be changed or developed.
    请问下 React Native 项目,怎么用 Jenkins 打安卓包
    Supplement 1  ·  Jul 20, 2018
    😁,我一个人开发,对 react native 和 Jenkins 都不是很熟。
    解决问题是核心,其他再说。
    18 replies  •  2018-08-23 10:45:56 +08:00
    wingyiu
    wingyiu
    Jul 20, 2018
    1
    写脚本
    ophunter
    ophunter
    OP
    Jul 20, 2018
    2
    @wingyiu 嗯嗯搞定了,把 node_modules 也上传到 git 就可以了
    helllkz
    helllkz
    Jul 20, 2018
    3
    为什么不是在 jenkins 里面执行 install,把 node 传到 git 是什么鬼
    SoulSleep
    SoulSleep
    Jul 20, 2018
    4
    jenkins 明明可以执行命令的。。。。
    for4die
    for4die
    Jul 20, 2018 via Android
    5
    RN 项目的 ios 怎么打包,用苹果的系统吗
    xiongshengyao
    xiongshengyao
    Jul 20, 2018
    6
    node_modules 上传到 git ?不怕被同事打死吗?
    acrisliu
    acrisliu
    Jul 20, 2018
    7
    楼主你这种做法很那啥啊,直接 npm install 不行吗 😂
    wly19960911
    wly19960911
    Jul 20, 2018 via Android
    8
    “嗯嗯搞定了,把 node_modules 也上传到 git 就可以了”

    意思是已经做了?

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

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

    所以就算可以,也最好别这么做。
    yggd
    yggd
    Jul 20, 2018
    14
    jenkins 里可以执行脚本啊,写个脚本编译啊
    sniffles
    sniffles
    Jul 20, 2018
    15
    jenkins 直接跑脚本+1
    wingyiu
    wingyiu
    Jul 20, 2018
    16
    @xiongshengyao 这操作牛逼得一塌糊涂,几千个文件啊
    paranoiagu
    paranoiagu
    Jul 20, 2018 via Android
    17
    Jenkins 真是个好东西,最近都在搞编译脚本,搞好后,省了很多人力。而且不会出错。
    hongch
    hongch
    Aug 23, 2018
    18
    不要用默认的 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
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2555 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 274ms · UTC 11:24 · PVG 19:24 · LAX 03:24 · JFK 06:24
    ♥ Do have faith in what you're doing.