UJP - Jenkinsをいれる

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ 2011 13inch の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - Jenkinsをいれる

Jenkinsをいれる

カテゴリ : 
Apple » MacBook Pro » 2011 13inch
ブロガー : 
ujpblog 2018/12/10 22:34
 Jenkinsというと,北朝鮮拉致被害者の,曽我ひとみさんの旦那さんのことをいつも思い出すのだけれど,CI(継続的インテグレーション)のツールのJenkinsが今回のテーマ.
 そういえば!?と思って調べてみたら,チャールズ・ジェンキンスさんはちょうど1年前に亡くなっていました...

 取り急ぎ,インストールを.

JenkinsをBrewでインストール

 Mac用のパケージマネージャ,HomeBrewでインストール.
gaia:~ server$ brew install jenkins🆑
Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.
jenkins: Java 1.8 is required to install this formula.
JavaRequirement unsatisfied!
You can install with Homebrew Cask:
 brew cask install homebrew/cask-versions/java8🈁
You can download from:
 https://www.oracle.com/technetwork/java/javase/downloads/index.html
Error: An unsatisfied requirement failed this build.
gaia:~ server$
 なんと,Java8が必要だと言われて失敗した.Javaのバージョンを調べてみた.
gaia:~ server$ java -version🆑
openjdk version "11.0.1" 2018-10-16🈁
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
gaia:~ server$
 Java 11が入っていた.最新が入るので仕方ない.

Java8を追加でインストール

 指示通りに,Java8をインストールする.
gaia:~ server$  brew cask install homebrew/cask-versions/java8🆑
Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.
==> Tapping homebrew/cask-versions
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions
'...
remote: Enumerating objects: 231, done.
remote: Counting objects: 100% (231/231), done.
remote: Compressing objects: 100% (223/223), done.
remote: Total 231 (delta 15), reused 45 (delta 6), pack-reused 0
Receiving objects: 100% (231/231), 92.56 KiB | 59.00 KiB/s, done.
Resolving deltas: 100% (15/15), done.
Tapped 210 casks (251 files, 352.1KB).
==> 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 java8 means you have AGREED to the license at
  https://www.oracle.com/technetwork/java/javase/terms/license/index.html

==> Satisfying dependencies
==> Downloading https://download.oracle.com/otn-pub/java/jdk/8u192-b12/
750e1c8617c5452694857ad95c3ee230/jdk-8u192-macosx-x64.dmg
==> Downloading from https://download.oracle.com/otn-pub/java/jdk/8u192-b12/
750e1c8617c5452694857ad95c3ee230/jdk-8u192-macosx-x64.dmg?AuthParam=1544447252
_2e8b408e6952cde7166b5ad0e
######################################################################## 100.0
%
==> Verifying SHA-256 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 
ignored.
Password:
installer: Package name is JDK 8 Update 192
installer: Installing at base path /
installer: The install was successful.
🍺  java8 was successfully installed!
gaia:~ server$
 Java8のインストールは問題なく完了.

Javaを切り替える

 入っているJavaの一覧を.
gaia:~ server$ /usr/libexec/java_home -V🆑
Matching Java Virtual Machines (2):
    11.0.1, x86_64:	"OpenJDK 11.0.1"	/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
    1.8.0_192, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
gaia:~ server$
 2つ入っている事が確認できた.Java7は1.8.xのやつなので,環境変数JAVA_HOMEに1.8を設定する.

gaia:~ server$ export JAVA_HOME=`/usr/libexec/java_home -v "1.8"`
gaia:~ server$
 パスが通ったか確認.
gaia:~ server$ java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
gaia:~ server$
 ちゃんとJava8になった.

Jenkinsをインストール

gaia:~ server$  brew install jenkins🆑
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

==> Downloading http://mirrors.jenkins.io/war/2.154/jenkins.war
==> Downloading from http://ftp.yz.yamagata-u.ac.jp/pub/misc/jenkins/war/2.154
/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.154: 7 files, 76MB, built in 5 minutes 15 
seconds
gaia:~ server$
 問題なくインストールできた模様.

Jenkinsを起動する

 特に苦労もなく,サービスコマンドで実行.

gaia:~ server$ brew services start jenkins🆑
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 14 (delta 0), reused 10 (delta 0), pack-reused 0
Unpacking objects: 100% (14/14), done.
Tapped 1 command (44 files, 58.7KB).
==> Successfully started `jenkins` (label: homebrew.mxcl.jenkins)
gaia:~ server$

トラックバック


広告スペース
Google