Skip to content

Latest commit

 

History

History
138 lines (122 loc) · 7.04 KB

README.md

File metadata and controls

138 lines (122 loc) · 7.04 KB

link

Copy Azure VHD (virtual hard drive) between diffrent storage account

Github - Create user for jenkins

  • Create new github user (dedicated for jenkins access)
  • Login with the new user
  • Account -> Settings -> Developer Settings -> Personal access token
  • Click "Generate new token", descirption: jenkins-github, scopes: select all or only spesific
  • Click "Generate token", copy the generate token string
  • Login to jenkins server as admin -> Manage jenkins -> Configure System
  • Github section -> GitHub Server: Name: "github", API URL: "https://api.github.com"
  • Credentials -> Add -> Jenkins -> Kind: "Secret Text", copy the token string from previous step
  • the Id should be a name for this token
  • Then, select this token (from the combo box) in the github credentials, click save

Mount Data Disk

  • Check all exists disks by running: sudo fdisk -l
  • Run: sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
  • create datadrive, run: sudo mkdir /datadrive
  • Run: sudo -i blkid
  • To one time hard drive mount Run: sudo mount /dev/sdc1 /datadrive -a (select the disk and partition you want to mount)
  • To force mount on every boot, run sudo nano /etc/fstab
  • Add the following line to the end of the /etc/fstab file (use the uuid from the command blkid): UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive ext4 defaults,nofail 1 2
  • Reboot the server and ensure datadrive has the right file and directories

Install New Ubuntu Server

  • Prefered version is ubuntu 16.0.4 lts
  • Make sure to open ports 8080 and 22 to the server
  • Once installtion is complete by the cloud vendor (azure/aws) connect to the server via ssh
  • run: ssh [email protected] (port 22), enter the password
  • Install java, run: sudo add-apt-repository ppa:webupd8team/java
  • Then run: sudo apt update; sudo apt install oracle-java8-installer
  • Check java is installed by running javac -version
  • Install nodejs: curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  • Run: sudo apt-get install -y nodejs
  • Install git: apt-get install git
  • Install typescript: npm install -g typescript
  • Install gulp: npm install -g gulp
  • Install vncserver: apt-get install vnc4server fluxbox
  • Install build essentials: sudo apt-get install build-essential
  • Start vnc for the first time (generate new password is needed once)
  • First, login as jenkins user, run: sudo su -s /bin/bash jenkins
  • Then run: vncserver and set empty password
  • Install bower: sudo npm install -g bower
  • Install chrome, run: sudo nano /etc/apt/sources.list
  • Use the down arrow key to scroll to the bottom of this file.
  • Copy the following APT line and paste it at the end of the file:
  • deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
  • Run: wget https://dl.google.com/linux/linux_signing_key.pub
  • Run: sudo apt-key add linux_signing_key.pub
  • Run: sudo apt update
  • Run: sudo apt install google-chrome-stable

Changing Jenkins Home directory

  • On the jenkins server
  • Run: nano /etc/default/jenkins
  • And changing the $JENKINS_HOME variable (around line 23) to JENKINS_HOME=/newhome/jenkins
  • Restart jenkins: /etc/init.d/jenkins start
  • Set Jenkins new url in "Manage Jenkins"
  • "Manage Jenkins" > "Configure Global Security" and select "Prevent Cross Site Request Forgery exploits."

Setup Claudia on Jenkins

  • Run as jenkins user: sudo su -s /bin/bash jenkins
  • go to jenkins user home by: cd ~
  • mkdir .aws
  • cd .aws
  • nano credentials
  • copy the following lines (add the correct access and secrets keys) [default] aws_access_key_id = XXXXXXXXXXXX aws_secret_access_key = XXXXXXXXXXX
  • save the file
  • nano config
  • copy the following lines [default] region = eu-west-1
  • save the file

Restart Jenkins Service

Select one of the three:

  • Run: /etc/init.d/jenkins start
  • Run: sudo service start jenkins
  • Run: sudo systemctl restart jenkins

Signin to server as jenkins user

  • As and admin user run: sudo su -s /bin/bash jenkins

links