Create a Jenkins server for batch processing schedule execution as well as CI. If you get used to it, you should be able to make it in less than 20 minutes.
They distribute packages that set the software environment construction in a nice way. There are various package formats such as images for containers and cloud environments and for on-premise.
We make it possible for anyone to quickly deploy software on the platform of their choice, from native installers to cloud images to containers.
See below for more information.
https://bitnami.com/learn_more
Use the following packages. The latest version at the time of writing (2017/06/28) is "2.46.2-0 on Ubuntu 14.04.3".
Jenkins powered by Bitnami https://aws.amazon.com/marketplace/pp/B00NNZUF3Q
document https://docs.bitnami.com/aws/apps/jenkins/
Documents> ID / PASSWORD https://bitnami.com/stack/jenkins/cloud/aws
Community (search here if you have any questions) https://community.bitnami.com/c/jenkins
Jenkins powered by Bitnami https://aws.amazon.com/marketplace/pp/B00NNZUF3Q
At this time, if you have not logged in to AWS, you will be prompted to log in, so log in.
I choose Manual Launch because it's created from the familiar AWS Console (for personal reasons)
Select "Launch with EC2 Console" from Launch> AMI IDs> Asia Pacific (Tokyo)
Create an EC2 instance
Although omitted, the default settings are basically OK. Use the key pair created here to log in to ssh later. Open ports 80 and 22. Apply some IP restrictions.
After starting the instance, access port 80 of the IP assigned to the instance from the browser. The Jenkins login screen will be displayed, so enter your ID and password.
ID: user
PASSWORD: (Check from the system log of the EC2 instance. Refer to the following URL.)
(Reference) How To Find Application Credentials? https://docs.bitnami.com/aws/faq/#find_credentials
After logging in, follow the on-screen instructions and install the recommended plug-ins unless you are particular about it.
The user is bitnami. Enter the public key and address as appropriate.
ssh -i path/to/keypair.pem bitnami@IPAddress
echo "Asia/Tokyo" | sudo tee /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata
(Reference) Ubuntu Time Management https://help.ubuntu.com/community/UbuntuTime
sudo /opt/bitnami/ctlscript.sh restart
(Reference) How To Start Or Stop The Services? https://docs.bitnami.com/aws/apps/jenkins/
Implement with reference to the following documents.
How To Start With Git And Jenkins? https://docs.bitnami.com/aws/apps/jenkins/#how-to-start-with-git-and-jenkins
Since it is necessary to generate the ssh authentication key in advance and correspond to the Github account after generation, carry out by referring to the following.
Execute the following command as a bitnami user to generate an ssh authentication key for the tomcat user.
ssh-keygen -t rsa
At this time, you will be asked where to generate it, so set it to /home/tomcat/.ssh/id_rsa. After that, enter without input.
Add the entire contents of /home/tomcat/.ssh/id_rsa.pem to your Github account by referring to the following.
Adding a new SSH key to your GitHub account https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
Due to a bitnami bug, there is an error in the permission settings of the directory used by gradle. Change the owner of /opt/bitnami/.gradle to tomcat as follows.
sudo chwon tomcat:tomcat /opt/bitnami/.gradle
https://community.bitnami.com/t/gradle-user-home-opt-bitnami-gradle/40717
Install any JDK from Jenkins Management> Global Tool Configuration> JDK. You need an Oracle account, so if you don't have one, it's free, so create one.
The JDK installed here will be used when building the job. If you install more than one, you can select the JDK to use on the setting screen of each job.
Make sure you can build the Gradle project in your private repository on GitHub. If you have already created it, follow the steps below to verify that the build is successful.
Select "Create new job"
Enter an appropriate job name in the input field, select "Build Freestyle Project", and press the OK button.
After entering the following contents on the job setting screen, press the save button.
** Source Code Control> Repository URL **
[email protected]:USERNAME/REPONAME.git
** Build> Invoke Gradle script> Use Gradle Wrapper **
Check "Make gradlew executable"
Set the Gradle task to be executed in Tasks (Example) "build"
Recommended Posts