Skip to content

Setup Development Environment

Jiri Klouda edited this page Mar 28, 2016 · 7 revisions

Setup of Development Environment

Legend:

  • :# - Run in root shell or add 'sudo' to start of line
  • :$ - Run as user
  • :% - Run on host operating system
  • -- - Comment

Install Ubuntu 64-bit Server in VMWare Image:

  1. Download: http://cdimage.ubuntu.com/ubuntu-server/daily/current/xenial-server-amd64.iso

  2. VMWare: New -> Install from disc or image -> Select xenial-server-amd64.iso -> Enter account info

  3. Add fixed-address for virtual machine in dhcpd configuration - this is how to do it on Mac OS X / VMWare Fusion

    :% sudo vim /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf host ubus { hardware ethernet 00:0C:29:XX:XX:XX; fixed-address 192.168.225.129; option domain-name-servers 192.168.225.2 8.8.8.8; }

DEVOPS Ubuntu Server Image Changelog:

  1. Install VMWare Tools

    :# apt-get install open-vm-tools -- :# vmhgfs-fuse .host:/ /mnt/hgfs

  2. Install editor

    :# apt-get install vim

  3. Graphics: 1600x1200 = 796/798/799 ; 1280x1024 = 775/794/795 ; 1024x768 = 773/791/792

    :# vim /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="splash vga=792" #GRUB_GFXMODE=1600x1200x16 :# update-grub2

  4. Enable Mouse

    :# apt-get install gpm

  5. Change hostname to ubus

    :# vim /etc/hosts 127.0.1.1 ubus :# hostnamectl set-hostname ubus

  6. Install SSHD - avoid python3 install through recommended packages

    :# apt-get install openssh-server --no-install-recommends

  7. Install Docker

    :# apt-get install --no-install-recommends docker.io docker-registry

    :# systemctl enable docker :# systemctl start docker :# adduser devops docker

  8. Snapshot VM

    :# shutdown -h now

QW Development Changelog

  1. Install Git

    :# apt-get install --no-install-recommends git

  2. Install Postgresql Client

    :# apt-get install --no-install-recommends postgresql-client

  3. Install DBD driver for PERL

    :# apt-get install --no-install-recommends libdbd-pg-perl

  4. Pull sources from github

    -- :$ git clone ssh://git@github.com:Aralin/devops.git :$ git clone https://github.com/Aralin/devops.git

  5. Start a database

    ;$ docker pull postgres :$ docker run --name qw-postgres -e POSTGRES_PASSWORD=postgres -d postgres :$ PG_CONTAINER_IP=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' qw-postgres) :$ export QW_DB=qw:question@${PG_CONTAINER_IP}:5432/qw

  6. Create the database

    :$ cd ~/devops/qw/db/pg :$ ./create.sh

  7. Test database connection

    :$ alias qw ~/devops/qw/bin/qw.pl :$ qw db now

  8. Create application schema

    :$ qw db create

  9. Test command

    :$ qw test Hello World