From charlesreid1

No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 5: Line 5:
Pipelines have 3 basic steps: build step, test step, and deploy (or "deliver") step.
Pipelines have 3 basic steps: build step, test step, and deploy (or "deliver") step.


=AWS=
=Get Started=
 
==Installing==
DigitalOcean guide to installing Jenkins on Ubuntu 16.04: https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-16-04
 
<pre>
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get -y update
sudo apt-get -y install jenkins
</pre>
 
==Starting==
 
Jenkins runs as a service, so start it like this:
 
<pre>
sudo systemctl start jenkins
</pre>
 
Check its status like this:
 
<pre>
sudo systemctl status jenkins
</pre>
 
Should see something like this:


==AWS Jenkins Shepherd and Sheep==
<pre>
Output
● jenkins.service - LSB: Start Jenkins at boot time
  Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled)
  Active:active (exited) since Thu 2017-04-20 16:51:13 UTC; 2min 7s ago
    Docs: man:systemd-sysv-generator(8)
</pre>


Guide to setting up a Jenkins build server on AWS: https://aws.amazon.com/getting-started/projects/setup-jenkins-build-server/
==Accessing==


Overview:
You should be able to access Jenkins at port 8080. (http://your-ip:8080)
* launch ec2 instance
* install jenkins
* configure jenkins to spin up workers if build abilities need to be augmented


Set up security group:
If it is not available, you may nee to open port 8080 using your firewall (ufw or iptables or other).
* set up a vpc
* allow http access from anyone
* allow ssh traffic from your public ip


Launching instance:
To get your Jenkins admin secret, run:
* t2.micro
* Enable auto-assign a public IP address
* Choose your VPC from Network, choose your public subnet from Network


Install:
<pre>
* apt-get update
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
* download/install (import yum key in instructions)
</pre>
* Connect to port 8080 to log in


Check for Jenkins password in <code>/var/lib/jenkins/secrets/initialAdminPassword</code>.
=AWS=


Select Amazon EC2 plugin, pick install without restart
Spin up an AWS node.


Manage Jenkins > Configure system > Cloud > Add new cloud  > Amazon EC2
Tasks:


Now you can create EC2 instances as build sheep
IF setting up SSL:
* Open firewall port 8081 (security group)
* Set up nginx on the front end
* Obtain an SSL certificate for the domain that points to your server (you need a domain, not a bare IP address)
* Yes this is a pain in the ass. Good luck. You can find domains for as cheap as $0.40/month on Namecheap.com
* LetsEncrypt is how you get your certificate
* See https://git.charlesreid1.com/charlesreid1/certbot
* Set up nginx to reverse-proxy to port 8081


Otherwise:
* Open firewall port 8080 (security group)
Okay, now on to the rest:
* Set up nginx on the frontend for SSL
* Install Jenkins
* Access Jenkins
* Run a basic Python workflow


=Links=
=Links=


https://jenkins.io/doc/tutorials/build-a-python-app-with-pyinstaller/
Jenkins tutorial on python build workflows with Jenkins: https://jenkins.io/doc/tutorials/build-a-python-app-with-pyinstaller/
 
Guide to setting up a Jenkins build server on AWS: https://aws.amazon.com/getting-started/projects/setup-jenkins-build-server/


=Flags=
=Flags=

Latest revision as of 01:23, 6 August 2018

Basics

You develop Pipelines, the main object in Jenkins

Pipelines have 3 basic steps: build step, test step, and deploy (or "deliver") step.

Get Started

Installing

DigitalOcean guide to installing Jenkins on Ubuntu 16.04: https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-16-04

wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get -y update
sudo apt-get -y install jenkins

Starting

Jenkins runs as a service, so start it like this:

sudo systemctl start jenkins

Check its status like this:

sudo systemctl status jenkins

Should see something like this:

Output
● jenkins.service - LSB: Start Jenkins at boot time
  Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled)
  Active:active (exited) since Thu 2017-04-20 16:51:13 UTC; 2min 7s ago
    Docs: man:systemd-sysv-generator(8)

Accessing

You should be able to access Jenkins at port 8080. (http://your-ip:8080)

If it is not available, you may nee to open port 8080 using your firewall (ufw or iptables or other).

To get your Jenkins admin secret, run:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

AWS

Spin up an AWS node.

Tasks:

IF setting up SSL:

  • Open firewall port 8081 (security group)
  • Set up nginx on the front end
  • Obtain an SSL certificate for the domain that points to your server (you need a domain, not a bare IP address)
  • Yes this is a pain in the ass. Good luck. You can find domains for as cheap as $0.40/month on Namecheap.com
  • LetsEncrypt is how you get your certificate
  • See https://git.charlesreid1.com/charlesreid1/certbot
  • Set up nginx to reverse-proxy to port 8081

Otherwise:

  • Open firewall port 8080 (security group)

Okay, now on to the rest:

  • Set up nginx on the frontend for SSL
  • Install Jenkins
  • Access Jenkins
  • Run a basic Python workflow

Links

Jenkins tutorial on python build workflows with Jenkins: https://jenkins.io/doc/tutorials/build-a-python-app-with-pyinstaller/

Guide to setting up a Jenkins build server on AWS: https://aws.amazon.com/getting-started/projects/setup-jenkins-build-server/

Flags