请假下 Jenkins 问题

2018-07-20 10:39:01 +08:00
 ophunter
请问下 React Native 项目,怎么用 Jenkins 打安卓包
6283 次点击
所在节点    Android
18 条回复
wingyiu
2018-07-20 10:43:12 +08:00
写脚本
ophunter
2018-07-20 12:34:35 +08:00
@wingyiu 嗯嗯搞定了,把 node_modules 也上传到 git 就可以了
helllkz
2018-07-20 13:33:35 +08:00
为什么不是在 jenkins 里面执行 install,把 node 传到 git 是什么鬼
SoulSleep
2018-07-20 13:46:21 +08:00
jenkins 明明可以执行命令的。。。。
for4die
2018-07-20 13:50:08 +08:00
RN 项目的 ios 怎么打包,用苹果的系统吗
xiongshengyao
2018-07-20 13:53:43 +08:00
node_modules 上传到 git ?不怕被同事打死吗?
acrisliu
2018-07-20 13:55:03 +08:00
楼主你这种做法很那啥啊,直接 npm install 不行吗 😂
wly19960911
2018-07-20 14:13:00 +08:00
“嗯嗯搞定了,把 node_modules 也上传到 git 就可以了”

意思是已经做了?

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

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

所以就算可以,也最好别这么做。
yggd
2018-07-20 15:03:10 +08:00
jenkins 里可以执行脚本啊,写个脚本编译啊
sniffles
2018-07-20 15:17:20 +08:00
jenkins 直接跑脚本+1
wingyiu
2018-07-20 18:33:59 +08:00
@xiongshengyao 这操作牛逼得一塌糊涂,几千个文件啊
paranoiagu
2018-07-20 18:42:22 +08:00
Jenkins 真是个好东西,最近都在搞编译脚本,搞好后,省了很多人力。而且不会出错。
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

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/472580

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX