iOS开发之——jenkins安装
前言
在iOS开发中,打包一直都是程序猿挥之不去的噩梦,因为打包很简单,但是很耗时间,所以现在就学习下,自动打包jenkins。
安装jenkins
习惯了使用 homebrew在MAC上安装软件,当然首当其冲的就在终端上运行brew了
- 搜索jenkins
- brew search jenkins
➜ ~ brew search jenkins
==> Searching local taps...
jenkins jenkins-job-builder jenkins-lts
==> Searching taps on GitHub...
caskroom/cask/jenkins-menu
==> Searching blacklisted, migrated and deleted formulae...
If you meant "jenkins" specifically:
It was migrated from caskroom/cask to homebrew/core.
我们看到上面出现了jenkins、jenkins-job-builder、jenkins-lts、caskroom/cask/jenkins-menu其实我们关心的只有jenkins,下面就运行安装jenkins
- 安装jenkins
- brew install jenkins
并没有如我们想像中的一样,刷刷的运行代码而是提示了一个 “jenkins: Java 1.8 is required to install this formula....”根据提示,我们知道想要安装jenkins还要先安装Java8这个东东 - brew cask install caskroom/versions/java8
喝杯啤酒,等待一会,看到下面的提示就表示已经完成了
🍺 java8 was successfully installed!
再次运行 brew install jenkins
➜ ~ brew install jenkins
jenkins: Java 1.8 is required to install this formula.
JavaRequirement unsatisfied!
You can install with Homebrew-Cask:
brew cask install caskroom/versions/java8
You can download from:
https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.
➜ ~ brew cask install caskroom/versions/java8
==> Tapping caskroom/versions
Cloning into '/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions'...
remote: Counting objects: 197, done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 197 (delta 10), reused 44 (delta 4), pack-reused 0
Receiving objects: 100% (197/197), 81.82 KiB | 172.00 KiB/s, done.
Resolving deltas: 100% (10/10), done.
Tapped 0 formulae (215 files, 301.2KB)
==> Caveats
This Cask makes minor modifications to the JRE to prevent issues with
packaged applications, as discussed here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
If your Java application still asks for JRE installation, you might need
to reboot or logout/login.
Installing this Cask means you have AGREED to the Oracle Binary Code
License Agreement for Java SE at
https://www.oracle.com/technetwork/java/javase/terms/license/index.html
==> Satisfying dependencies
==> Downloading http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec2
######################################################################## 100.0%
==> Verifying checksum for Cask java8
==> Installing Cask java8
==> Running installer for java8; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are i
Password:
==> installer: Package name is JDK 8 Update 172
==> installer: Installing at base path /
==> installer: The install was successful.
🍺 java8 was successfully installed!
➜ ~ brew install jenkins
==> Downloading http://mirrors.jenkins.io/war/2.118/jenkins.war
==> Downloading from http://mirrors.shu.edu.cn/jenkins/war/2.118/jenkins.war
################################## 48.2%
在来杯啤酒,看下面代码
==> Downloading from http://mirrors.shu.edu.cn/jenkins/war/2.118/jenkins.war
######################################################################## 100.0%
==> jar xvf jenkins.war
==> Caveats
Note: When using launchctl the port will be 8080.
To have launchd start jenkins now and restart at login:
brew services start jenkins
Or, if you don't want/need a background service you can just run:
jenkins
==> Summary
🍺 /usr/local/Cellar/jenkins/2.118: 7 files, 74.4MB, built in 1 minute 48 seconds
到此就代表此时自己的电脑上已经安装了jenkins
- 启动jenkins
- brew services start jenkins 跟进上面的提示我运行代码
➜ ~ brew services start jenkins
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 14 (delta 0), reused 8 (delta 0), pack-reused 0
Unpacking objects: 100% (14/14), done.
Tapped 0 formulae (43 files, 55.3KB)
然后呢,我也懵逼了,怎么没有界面呢
- 打开浏览器在浏览器输入 http://localhost:8080此时就能看到下面的画面了
-
复制上面的文件路径去finder中找 Command+shift+G快速打开前往文件夹,打开XXXX.initilAdminPassword把里面的密码复制出来,粘贴上点击下面的 “继续”。
-
配置XXX,我记得我是选择的第一个,当时没有截图网上盗一个吧
-
然后,在来杯啤酒,静静等待全部安装完成
-
然后就是创建用户名和密码
-
终于看到了期待已久的画面