Mac下使用brew安装Jenkins

MacBook-Pro:~ sunyifeng$ 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.
MacBook-Pro:~ sunyifeng$ brew install jenkins
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, pivotal/tap, caskroom/cask).
==> New Formulae
annie               gitlab-gem          jsonrpc-glib        patchelf            tox
apache-arrow-glib   gr-osmosdr          libdazzle           phplint             trezor-agent
aws-es-proxy        hcloud              mkl-dnn             ssh-permit-a38      util-linux
cquery              jrtplib             netdata             template-glib
==> Updated Formulae
libtiff ✔                         gdk-pixbuf                        ocrmypdf
pivotal/tap/springboot ✔          geckodriver                       odpi
sqlite ✔                          gedit                             offlineimap
tomcat ✔                          gegl                              open-scene-graph
vim ✔                             getmail                           openimageio
abcmidi                           ghostscript                       openssh
abnfgen                           gist                              openttd
abyss                             git                               openvdb
afsctool                          git-annex                         optipng
agda                              git-sizer                         osm2pgrouting
allegro                           git-town                          osquery
amqp-cpp                          gitbucket                         packmol
angular-cli                       gitfs                             paket
apache-geode                      gitg                              pam_yubico
apibuilder-cli                    gitless                           pango
apktool                           gjs                               passenger
arangodb                          glade                             pcb
armor                             glib                              pdal
artifactory                       globus-toolkit                    percona-server-mongodb
asciinema                         gnome-builder                     [email protected]
asio                              gnupg                             pgcli
aspectj                           go-jira                           pgroonga
at-spi2-atk                       [email protected]                            php
at-spi2-core                      gobject-introspection             [email protected]
atk                               goenv                             [email protected]
aws-sdk-cpp                       gollum                            phpunit
awscli                            google-benchmark                  picard-tools
azure-cli                         grails                            pick
babeld                            graphene                          pioneers
babl                              gron                              pipenv
bazel                             groonga                           pivotal/tap/gemfire
bcftools                          grpc                              pivotal/tap/pivnet-cli
bcpp                              gsoap                             pivotal/tap/tcserver
bedops                            gst-plugins-good                  plantuml
bettercap                         gtksourceview3                    poco
bibtex2html                       handbrake                         postgis
binaryen                          haproxy                           pqiv
bit                               harfbuzz                          presto
bitcoin                           heroku                            proguard
bitrise                           htmldoc                           proj
botan                             htop                              pstoedit
braid                             htslib                            pugixml
brotli                            hugo                              py2cairo
byteman                           i2p                               py3cairo
c14-cli                           imlib2                            pycodestyle
calicoctl                         influxdb                          qd
certbot                           internetarchive                   qpid-proton
chakra                            ipython                           qscintilla2
chapel                            ipython@5                         qtfaststart
checkstyle                        ircd-hybrid                       rancher-cli
chronograf                        jansson                           raylib
cimg                              jena                              re2
clamav                            jenkins                           recoverjpeg
cliclick                          jenkins-job-builder               remctl
clinfo                            jenkins-lts                       robot-framework
clojure                           jhipster                          rocksdb
closure-compiler                  json-glib                         saltstack
cockatrice                        keychain                          samtools
cockroach                         knot                              sbt
cocoapods                         kops                              scm-manager
collectd                          kubectx                           sdb
composer                          kubeless                          sfk
conan                             kubernetes-cli                    silk
conjure-up                        launch                            singular
consul                            lbdb                              skaffold
container-diff                    lcdf-typetools                    skafos
convox                            libcouchbase                      softhsm
coreos-ct                         libdill                           solr
couchdb                           libgit2                           sops
cppcheck                          libgit2-glib                      sourcekitten
cryptopp                          libgpg-error                      sourcery
cython                            libgweather                       sox
darcs                             libhttpseverywhere                sparse
dartsim                           liblwgeom                         spigot
davmail                           libmagic                          sqldiff
dbhash                            libphonenumber                    sqlite-analyzer
dcos-cli                          libqalculate                      sqliteodbc
ddgr                              librealsense                      sqlmap
dependency-check                  libressl                          src
di                                librsvg                           srt
discount                          libsoup                           ssh-copy-id
django-completion                 libsoxr                           sshuttle
dmd                               libspectre                        subversion
dnscrypt-proxy                    libuv                             svgcleaner
dnsdist                           libvirt                           swift
docfx                             libzip                            swiftlint
docker                            linkerd                           syncthing
docker-completion                 links                             sysbench
docker-compose                    lldpd                             talloc
docker-compose-completion         lmod                              tbb
docker2aci                        log4cplus                         teleport
doctl                             lolcat                            terraform
dscanner                          lxc                               terragrunt
dub                               mapnik                            testssl
duck                              maxwell                           timelimit
duti                              mediaconch                        tinyxml2
embulk                            mednafen                          tippecanoe
emscripten                        mercurial                         tmux
erlang@19                         metabase                          todo-txt
evince                            mill                              tup
exomizer                          miniupnpc                         txr
exploitdb                         mint                              uhd
eye-d3                            mitmproxy                         unbound
faas-cli                          mkvtoolnix                        vala
fail2ban                          mm-common                         vault
ffmbc                             modd                              vte3
fibjs                             monero                            watch
fig2dev                           mongo-c-driver                    webpack
file-formula                      mutt                              wildfly-as
firebase-cli                      mypy                              wine
fits                              nanopb-generator                  wireguard-tools
flatbuffers                       nats-streaming-server             wireshark
flawfinder                        ncmpc                             xonsh
flow                              ncmpcpp                           xrootd
fluent-bit                        nco                               xtensor
fn                                neofetch                          yarn
fobis                             nghttp2                           yash
folly                             nginx                             yaws
fonttools                         nifi                              yle-dl
fq                                node                              you-get
freetds                           nomad                             youtube-dl
frege                             notmuch                           zabbix
frugal                            nss                               zenity
futhark                           ntl                               znapzend
gcab                              nuget                             zsh
gdcm                              nvm
==> Renamed Formulae
php70 -> [email protected]
==> Deleted Formulae
arm

==> Downloading http://mirrors.jenkins.io/war/2.117/jenkins.war
==> Downloading from http://mirrors.tuna.tsinghua.edu.cn/jenkins/war/2.117/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



在平时开发中,搭建环境什么的个人建议都使用命令行,不建议使用官网dmg的安装包。

1.安装brew

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

2.升级java

brew cask install java 

3.安装jenkins

brew install jenkins

4.执行

java -jar /usr/local/Cellar/jenkins/2.49/libexec/jenkins.war --httpPort=8080
//2.49是指Jenkins的版本号

5.链接launchd配置文件

ln -sfv /usr/local/opt/jenkins/*.plist ~/Library/LaunchAgents

6.启动jenkins

 launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist 

7.停止jenkins

 launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist 

打开浏览器,输入 localhost:8080 就可看到Jenkins的web界面

安装注意:

若提示org.jenkins-ci.plist文件未找到,手动创建即可
sudo touch /Library/LaunchDaemons/org.jenkins-ci.plist

plist内容(具体内容根据不同设备可能需要稍作更改):

xml version="1.0" encoding="UTF-8"?>  
  
<plist version="1.0">  
<dict>  
<key>Labelkey>  
<string>Jenkinsstring>  
<key>ProgramArgumentskey>  
<array>  
<string>/usr/bin/javastring>  
<string>-jarstring>  
<string>/usr/local/Cellar/jenkins/2.49/libexec/jenkins.warstring>  
array>  
<key>OnDemandkey>  
<false/>  
<key>RunAtLoadkey>  
<true/>  
<key>UserNamekey>  
<string>adminstring>  
dict>  
plist>  

安装完成后,我们来进行实际运用

1.进入首页

在浏览器中输入:http://localhost:8080 (因为在安装时,我设置的端口是8080)
初次打开,会需要进行插件安装
输入密码进入:

Mac下使用brew安装Jenkins_第1张图片
Snip20170828_3.png
Mac下使用brew安装Jenkins_第2张图片
Snip20170828_4.png
Mac下使用brew安装Jenkins_第3张图片
Snip20170828_6.png

会有登录的提示:


Mac下使用brew安装Jenkins_第4张图片
Snip20170828_8.png

2.安装所需要的插件(如Xcode,Keychains and provisioning profiles management,……)

3.创建我的项目

Mac下使用brew安装Jenkins_第5张图片
15020727874784.jpg
Mac下使用brew安装Jenkins_第6张图片
15020729350844.jpg
Mac下使用brew安装Jenkins_第7张图片
15020730453296.jpg

4.配置我们的项目

点击我们的项目名称,然后点击配置。


Mac下使用brew安装Jenkins_第8张图片
15020736558728.jpg
Mac下使用brew安装Jenkins_第9张图片
15020738715919.jpg

在第一次创建的时候,会要选择构建的对象,我ios选的就是xcode,如果找不到xcode选项,就要回到首页的“系统管理”中的“管理插件”中安装“Xcode integration”这项。然后回过来选择Xcode项。

5.拉代码

Mac下使用brew安装Jenkins_第10张图片
15020743339660.jpg

代码拉取完成后,如下图:

Mac下使用brew安装Jenkins_第11张图片
15020745471571.jpg

6.自动打包及上传到测试平台

这里测试平台以fir.im为例;
然后回到项目配置的页面。


Mac下使用brew安装Jenkins_第12张图片
15020746728986.jpg
Mac下使用brew安装Jenkins_第13张图片
15020747853778.jpg
Mac下使用brew安装Jenkins_第14张图片
15020748628472.jpg

如何查看team ID:

Mac下使用brew安装Jenkins_第15张图片
15020759714315.jpg
Mac下使用brew安装Jenkins_第16张图片
15020751272821.jpg
Mac下使用brew安装Jenkins_第17张图片
15020752077635.jpg
Mac下使用brew安装Jenkins_第18张图片
15020753048760.jpg
Mac下使用brew安装Jenkins_第19张图片
15020754100029.jpg

jenkins没有自带的fir插件,要自己到fir官网下载后,手动的添加进去。点击查看
fir.im的token值生成:
进入官网,按照以下步骤,复制即可。

Mac下使用brew安装Jenkins_第20张图片
15020755193515.jpg



你可能感兴趣的:(IT-网络传输协议)