移动端打包pipeline通识:从零开始

背景: 一台被格式化后的 MacBook Pro, 对某个移动端项目( xx类型 )做android pipeline、iOS pipeline

网络:公司网络(可翻墙)

makefile

记得验证/确认

1-安装/Set up

1.1 install brew
1
2
3
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew -v

brew cask 是在brew 的基础上一个增强的工具,用来安装Mac上的Gui程序应用包(.dmg/.pkg), 比如qq、chrome等。它先下载解压到统一的目录中(/opt/homebrew-cask/Caskroom),省掉了自己去下载、解压、拖拽(安装)等步骤,同样,卸载相当容易与干净。然后再软链到~/Applications/目录下, 非常方便,而且还包含很多在 AppStore 里没有的常用软件。

1.2 install brew cask

brew install brew-cask-completion

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
➜  Desktop brew cask
Homebrew Cask provides a friendly CLI workflow for the administration
of macOS applications distributed as binaries.

Commands:

--cache display the file used to cache the Cask
audit verifies installability of Casks
cat dump raw source of the given Cask to the standard output
create creates the given Cask and opens it in an editor
doctor checks for configuration issues
edit edits the given Cask
fetch downloads remote application files to local cache
home opens the homepage of the given Cask
info displays information about the given Cask
install installs the given Cask
list with no args, lists installed Casks; given installed Casks, lists staged files
outdated list the outdated installed Casks
reinstall reinstalls the given Cask
style checks Cask style using RuboCop
uninstall uninstalls the given Cask
upgrade upgrades all outdated casks
zap zaps all files associated with the given Cask

See also "man brew-cask"
1.3 install java

方法一: 官网下载

1
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3a%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk8-downloads-2133151.html; oraclelicense=accept-securebackup-cookie;" "https://download.oracle.com/otn/java/jdk/8u231-b11/5b13a193868b4bf28bcb45c792fce896/jdk-8u231-macosx-x64.dmg"

方法二: brew cask下载

1
2
brew tap homebrew/cask-versions
brew cask install adoptopenjdk8

检查版本:java -version

1.4 install jenkins

在Mac OS上安装jenkins的N(4)种方法

  • 方法一: 下载war包,java命令启动
    curl -L -O http://mirrors.jenkins-ci.org/war/2.211/jenkins.war

java -jar /xx/xx/jenkins.war --httpPort=8080

  • 方法二: 将下载的war包文件部署到 tomcat servlet 容器,用脚本 startup.sh 启动

    暂不介绍

  • 方法三: brew 安装&启动

1
2
3
4
5
6
#install jenkins, Requires Java 1.8, [issus](https://github.com/Homebrew/homebrew-core/issues/39037)
brew install jenkins-lts
# start jenkins, default port: 8080
brew services start jenkins-lts
# stop jenkins
brew services stop jenkins-lts
  • 修改默认端口 link
  • 假设希望jenkins能够开机自启动以及异常自己主动重新启动 link

sudo touch /Library/LaunchDaemons/org.jenkins-ci.plist

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>Jenkins</string>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-Dmail.smtp.starttls.enable=true</string>
<string>-jar</string>
<string>/usr/local/opt/jenkins/libexec/jenkins.war</string>
<string>--httpListenAddress=127.0.0.1</string>
<string>--httpPort=8080</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>jenkins</string>
</dict>
</plist>
  • 方法四: docker container 启动,添加宿主机作为一个slave node,并使用

TODO:
[] jenkins加入到开机自启动
[X] 定制化配置等

我是谁 -> whoami
我在哪里 -> pwd && ls -al
我要到哪里去 -> New item

配置项目pipeline

安装项目所需工具 cocoapods

1
2
# install cocoapods
sudo gem install cocoapods

检查所有工具的版本
xcodebuild -version
react-native

添加jenkins 凭证

ref:

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2019-2024 John Doe
  • Visitors: | Views:

请我喝杯咖啡吧~