This documented is a slightly adapted version to this one: https://gist.github.com/jsuwo/9038610 by Jeff Shantz. He has a fantastic video series on setting up Jenkins on AWS EC2 here: https://www.youtube.com/watch?v=1JSOGJQAhtE&feature=youtu.be&ab_channel=JeffShantz
- Choose 1-2GB Ubuntu Server
- Create new security group and Enable HTTP (& leave SSH open)
- Launch!
- Create new key pair (and add alias to
~/.ssh/config
)
sudo apt-get install language-pack-en
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
echo "deb http://pkg.jenkins-ci.org/debian binary/" | sudo tee -a /etc/apt/sources.list.d/jenkins.list
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get install apache2
sudo a2enmod proxy
sudo a2enmod proxy_http
<VirtualHost *:80>
ServerName HOSTNAME
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost on
ProxyPass / http://localhost:8080/
</VirtualHost>
Change the HOSTNAME
to the AWS public DNS name
sudo a2ensite jenkins
sudo service apache2 reload
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer ant git-core subversion
You can get the path to Java and Ant as follows:
readlink -f /usr/bin/ant
readlink -f /usr/bin/javac
sudo apt-get install php5-cli libapache2-mod-php5
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql php5-curl
sudo apt-get php5-xsl # For phpdox
If you need to upgrade to PHP 5.6:
sudo apt-get remove php5-cli libapache2-mod-php5 php5 php5-xsl php5-cli libapache2-mod-php5
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5-cli libapache2-mod-php5 php5 php5-xsl php5-cli libapache2-mod-php5
To get the latest version of node:
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
Install npm and Grunt cli
sudo apt-get install npm
npm install grunt-cli
sudo apt-get install unzip
- Install composer
- Create a deploy key under
jenkins:~/.ssh
(/var/lib/jenkins/.ssh/
) & addconfig
- Install npm, grunt, grunt-cli (?)
- Install bitbucket plugin and create webhook (-- not working?) - instead do it custom script with token.