Developer guide: Difference between revisions

From LPI Wiki
Jump to navigationJump to search
GMatthewRice (talk | contribs)
No edit summary
GMatthewRice (talk | contribs)
No edit summary
 
(12 intermediate revisions by 3 users not shown)
Line 21: Line 21:
  sudo chmod +x /usr/local/bin/p4
  sudo chmod +x /usr/local/bin/p4


Create new folder in Home directory.<br/>
Create new folder in your home directory for the source code.<br/>
  mkdir -p p4/xamnet
  mkdir -p ~/p4/xamnet


Create new file in this folder called .p4settings<br/>
Create new file in this folder called ~/p4/xamnet/.p4settings<br/>
Include in this file: <br/>
Include in this file: <br/>
  P4PORT=p4.lpi.org:1666
  P4PORT=p4.lpi.org:1666
Line 31: Line 31:
  P4CLIENT=<username>-dev
  P4CLIENT=<username>-dev


Edit .bashrc file to include:
Edit ~/.bashrc file to include:
  xamdev=$HOME/p4/xamnet/dev/dev/pde/mojo
  xamdev=$HOME/p4/xamnet/xamnet/dev/dev/pde/mojo
  xamman=$HOME/p4/xamnet/man/dev/pde/mojo
  xamman=$HOME/p4/xamnet/xamnet/man/dev/pde/mojo
  export P4CONFIG=.p4settings
  export P4CONFIG=.p4settings


This one time source .bashrc:  
This one time, source ~/.bashrc (it's automatic on subsequent logins):  
  . .bashrc
  . ~/.bashrc


===Create Your Perforce Workspace===
===Create Your Perforce Workspace===
Line 47: Line 47:
==Running the Tests==
==Running the Tests==
===Load Docker Image===
===Load Docker Image===
tbd


* Load linux image from $xamdev/docker/rick/rick/xamdev
Load linux image from $xamdev/docker<br/>
* Run scripts to install needed packages.
cd $xamdev/docker
docker load -i xamnet:dev-docker-img.tar
 
Create your own personalized Dockerfile
mkdir -p ~/docker/$USER
cp -r $xamdev/docker/rick/rick/xamdev ~/docker/$USER
cd ~/docker/$USER
 
# Now edit Dockerfile.dev and change all occurrences of "rick" to your username '''except on the FROM line'''
 
Build your personalized image<br/>
docker build --rm -t $USER/$USER-xamdev:dev -f Dockerfile.dev .
 
'''If that complained''' because the value of $USER was less than 4 characters then substitute a longer word for the first $USER, e.g.<br>
docker build --rm -t mydockerimages/$USER-xamdev:dev -f Dockerfile.dev .
 
Edit the container start script, ''rundocker.dev'', and set IMAGE to what you used before, e.g.
IMAGE=$USER/$USER-xamdev:dev
 
Start the container and run from its shell<br/>
./rundocker.dev
 
===Create xamdev database===
You will need two databases, one for regression tests and one for development.
 
Create regression test database<br/>
./build-tools/bin/makedatabase.sh
 
Create development database<br/>
./build-tools/bin/makedatabase.sh xamdev_development
 
You will be prompted for your mysql root password for each.


===Run xamdev web app===
===Run xamdev web app===
through docker terminal  
Through docker terminal  
   
 
use ip address to connect to server through browser
cd $xamdev
  morbo script/xamdev_web
 
Use ip address to connect to server through browser.
 
If the message "Can't create listen socket: Address already in use at /usr/share/perl5/Mojo/ loLoop.pm line 120" is displayed use command:
 
morbo -l http://*:3001 script/xamdev_web


===Run Regression Tests===
===Run Regression Tests===

Latest revision as of 17:59, 27 January 2021

Introduction

This is a quick start guide.

Installation Steps

Install Docker

Install docker:

https://docs.docker.com/linux/started/

You may have to do this step.

Add user to docker group:

usermod -a -G docker $USER

Install Perforce

Install perforce client from: http://www.perforce.com/downloads/helix

sudo cp ~/Downloads/p4 /usr/local/bin
sudo chmod +x /usr/local/bin/p4

Create new folder in your home directory for the source code.

mkdir -p ~/p4/xamnet

Create new file in this folder called ~/p4/xamnet/.p4settings
Include in this file:

P4PORT=p4.lpi.org:1666
P4USER=<username>
P4PASSWD=<password>
P4CLIENT=<username>-dev

Edit ~/.bashrc file to include:

xamdev=$HOME/p4/xamnet/xamnet/dev/dev/pde/mojo
xamman=$HOME/p4/xamnet/xamnet/man/dev/pde/mojo
export P4CONFIG=.p4settings

This one time, source ~/.bashrc (it's automatic on subsequent logins):

. ~/.bashrc

Create Your Perforce Workspace

tbd

and:

p4 sync

Running the Tests

Load Docker Image

Load linux image from $xamdev/docker

cd $xamdev/docker
docker load -i xamnet:dev-docker-img.tar

Create your own personalized Dockerfile

mkdir -p ~/docker/$USER
cp -r $xamdev/docker/rick/rick/xamdev ~/docker/$USER
cd ~/docker/$USER
# Now edit Dockerfile.dev and change all occurrences of "rick" to your username except on the FROM line

Build your personalized image

docker build --rm -t $USER/$USER-xamdev:dev -f Dockerfile.dev .

If that complained because the value of $USER was less than 4 characters then substitute a longer word for the first $USER, e.g.

docker build --rm -t mydockerimages/$USER-xamdev:dev -f Dockerfile.dev .

Edit the container start script, rundocker.dev, and set IMAGE to what you used before, e.g.

IMAGE=$USER/$USER-xamdev:dev

Start the container and run from its shell

./rundocker.dev

Create xamdev database

You will need two databases, one for regression tests and one for development.

Create regression test database

./build-tools/bin/makedatabase.sh 

Create development database

./build-tools/bin/makedatabase.sh xamdev_development

You will be prompted for your mysql root password for each.

Run xamdev web app

Through docker terminal

cd $xamdev
morbo script/xamdev_web

Use ip address to connect to server through browser.

If the message "Can't create listen socket: Address already in use at /usr/share/perl5/Mojo/ loLoop.pm line 120" is displayed use command:

morbo -l http://*:3001 script/xamdev_web

Run Regression Tests

cd $xamdev
prove -v t