LoginSignup
0
1

More than 3 years have passed since last update.

Ubuntu18.04にJenkinsをインストールする

Last updated at Posted at 2020-06-28

1. パッケージのアップデート

$ sudo apt update

2. OpenJDKのインストール

$ sudo apt install -y openjdk-8-jdk

3. Jenkinsのインストール

$ wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
$ sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
    /etc/apt/sources.list.d/jenkins.list'
$ sudo apt update
$ sudo apt install jenkins

4. 動作確認

$ sudo systemctl status jenkins

● jenkins.service - LSB: Start Jenkins at boot time
   Loaded: loaded (/etc/init.d/jenkins; generated)
   Active: active (exited) since Sun 2020-06-28 23:42:06 JST; 4min 8s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 0 (limit: 4666)
   CGroup: /system.slice/jenkins.service

 6月 28 23:42:00 Redmine systemd[1]: Starting LSB: Start Jenkins at boot time...
 6月 28 23:42:03 Redmine jenkins[2461]: Correct java version found
 6月 28 23:42:03 Redmine jenkins[2461]:  * Starting Jenkins Automation Server je
 6月 28 23:42:03 Redmine su[2520]: Successful su for jenkins by root
 6月 28 23:42:03 Redmine su[2520]: + ??? root:jenkins
 6月 28 23:42:03 Redmine su[2520]: pam_unix(su:session): session opened for user
 6月 28 23:42:06 Redmine jenkins[2461]:    ...done.
 6月 28 23:42:06 Redmine systemd[1]: Started LSB: Start Jenkins at boot time.s

5. 起動時実行

$ sudo systemctl enable jenkins

jenkins.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable jenkins

6. 初期設定

1. Jenkinsへアクセス

http://<サーバのIP>:8080/

2. Unlock Jenkins

  1. 上記URLにアクセスすると下記画像のようなページが表示される
  2. 下記コマンドを入力しAdministrator passwordを確認
    sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  3. 上記コマンドで表示されたパスワードを「Administrator password」にコピペする
  4. 「Continue」をクリック

image.png

3. Customize Jenkins

特に何もなければ「Install suggested plugins」を選択する

image.png

自動でインストールが開始されます

4. Create First Admin User

画面の指示に従い必要事項を入力します.

image.png

5. Instance Configuration

ここではアクセスするjenkinsのURLを指定しますが,特に何もなければ変更せずに「Save and Finish」をクリックする

参考

Installing Jenkins

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1