Jenkins on EC2 : 2. Configuration
Manage Jenkins=>Configure Global Security:and uncheck "Jenkins' own user database" since we will create an account for the user, and by selecting "Logged-in users can do anything" we can avoid the complexities of various permission levels :
We disabled the signup feature in our previous section, however, Jenkins allow only the first user to signup:
Click the little Jenkins link, then it will take us to this Sign up form:
Note that this is the only time Jenkins allows signup, and will not allow any further users to signup. So, we'll have to create accounts. But now we're logged in and we now want to setup global configuration.
Let's go to "Available" tab, check "GitHub Plugin", and select "Install without restart".
Manage Jenkins=>Manage Plugins:
Check all the updates:
Click "Download now and install after restart"
ubuntu@ip-172-31-52-90:~$ sudo service jenkins restart
Then, install GitHub-plugin from "Available" tab.
We're going to use Java project, we need to tell Jenkins where to find JDK, and we also need to install git so that it can check out from the repository. We want to install Maven so that we can build our project using the Maven build tool.
Let's switch back to the EC2 instance:
ubuntu@ip-172-31-52-90:~$ sudo add-apt-repository ppa:webupd8team/java Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK6 / JDK7 / JDK8). There are no actual Java files in this PPA. More info: - for Oracle Java 7: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html - for Oracle Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html Debian installation instructions: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java Press [ENTER] to continue or ctrl-c to cancel adding it gpg: keyring `/tmp/tmprd61gcxr/secring.gpg' created gpg: keyring `/tmp/tmprd61gcxr/pubring.gpg' created gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com gpg: /tmp/tmprd61gcxr/trustdb.gpg: trustdb created gpg: key EEA14886: public key "Launchpad VLC" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK
The repositories been added, and then we can update the list of packages on the system:
ubuntu@ip-172-31-52-90:~$ sudo apt-get update
Now we want to install Maven and git-core:
ubuntu@ip-172-31-52-90:~$ sudo apt-get install oracle-java7-installer maven git-core
Select "OK"=>"Yes", then check if they are installed:
ubuntu@ip-172-31-52-90:~$ javac -version javac 1.7.0_72 ubuntu@ip-172-31-52-90:~$ mvn -version Apache Maven 3.0.5 Maven home: /usr/share/maven Java version: 1.7.0_72, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-7-oracle/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.13.0-36-generic", arch: "amd64", family: "unix"
Now we need to specify the path to JAVA_HOME and to Maven home:
ubuntu@ip-172-31-52-90:~$ which javac /usr/bin/javac ubuntu@ip-172-31-52-90:~$ readlink -f /usr/bin/javac /usr/lib/jvm/java-7-oracle/bin/javac
/usr/lib/jvm/java-7-oracle/ is the JAVA_HOME. Let's switch back to Jenkins.
Click "Configure System" = > "Add JDK", then uncheck "Install automatically" because it's been already installed.
ubuntu@ip-172-31-52-90:~$ which mvn /usr/bin/mvn ubuntu@ip-172-31-52-90:~$ readlink -f /usr/bin/mvn /usr/share/maven/bin/mvn
/usr/share/maven is the MAVEN_HOME. Let's switch back to Jenkins again.
Additional setup such as sys. admin. email, ssh to Jenkins, and Notification Email.
Sending email was successful:
Now we finished Jenkins Global Jenkins Configuration. Next, we'll setup our Jenkins project.
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization