Posted on

Install Selenium on Ubuntu 14.04

#First, install Google Chrome for Debian/Ubuntu:

sudo apt-get install chromium-browser

sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

sudo dpkg -i google-chrome*.deb
sudo apt-get install -f
#Now, let’s install xvfb so we can run Chrome headlessly:

sudo apt-get install xvfb

#Install ChromeDriver

sudo apt-get install unzip

wget -N http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver

sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver

#Install some Python dependencies for Selenium:

sudo apt-get install python-pip

## (Optional) Create and enter a virtual environment:
# sudo apt-get install python-virtualenv
# virtualenv env
# source env/bin/activate

pip install pyvirtualdisplay selenium

#Now, we can do stuff like this with Selenium in Python:

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 600))
display.start()
driver = webdriver.Chrome()
driver.get(‘https://devops.org.in’)
print driver.title

 

if you have to call from within jenkins

 

import sys
from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 600))
display.start()
driver = webdriver.Chrome()
driver.get(‘http://ipaddress:8080/test/’)
print driver.title
var1 = driver.title
print var1
#if driver.title is ‘HelloJava’:
if “HelloJava” in var1:
print “Test Successful”
else:
raise Exception(“Test Failed”)

Posted on

Install Sonarqube on Ubuntu 14.04

#First install puppet

sudo su –

apt-get update

apt-get install puppet

#Then install puppet module for installing sonarqube
puppet module uninstall puppetlabs-java
puppet module install maestrodev-sonarqube

#Once module is installed, create a .pp file
nano sonarqube.pp
#Enter the below content inside the file
class { ‘java’: }
class { ‘sonarqube’ :
version => ‘5.1’,
}
#save file and run file using below command
puppet apply –verbose sonarqube.pp

#Run Nexus
firefox hostname:9000

Posted on

Installing Sonatype Nexus on Ubuntu 14.04

#First install puppet

sudo su –

apt-get update

apt-get install puppet

#Then install puppet module for installing nexus
puppet module install hubspot-nexus

#Once module is installed, create a .pp file
nano nexus.pp
#Enter the below content inside the file
class{ ‘::java’: }

class{ ‘::nexus’:
version => ‘2.12.0’,
revision => ’01’,
nexus_root => ‘/srv’, # All directories and files will be relative to this
}

Class[‘::java’] ->
Class[‘::nexus’]

#save file and run file using below command
puppet apply –verbose nexus.pp

#Run Nexus
firefox hostname:8081/nexus

Posted on

Installing Jenkins on Ubuntu 14.04

#First install puppet

sudo su -

apt-get update

apt-get install puppet

#Then install puppet module for install Jenkins
puppet module install rtyler-jenkins

#Once module is installed, create a .pp file

nano jenkins.pp

#Write the below contents inside file
include jenkins
#Run the file with puppet
puppet apply --verbose jenkins.pp

#launch jenkins web gui
firefox hostname:8080

		
Posted on

Installing Gitlab on Ubuntu 14.04

#First install puppet

sudo su -

apt-get update

apt-get install puppet

#Then install puppet module for install gitlab

puppet module install vshn-gitlab

#Once module is installed, create a .pp file

nano gitlab.pp

#Write the below contents inside file
class { 'gitlab':
  external_url => 'http://gitlab.mydomain.tld',
}
# in the above code change the gitlab.mydomain.tld to the dns resolvable hostname of your server
#Run the file with puppet
puppet apply --verbose gitlab.pp

# Now navigate to the homepage of gitlab
firefox gitlab.mydomain.tld
#OR
apt-get install lynx
lynx gitlab.mydomain.tld