linux:tp-dev-env

TP Dev Env

LAMP server with Apache and SSI modules enabled

Development Environment Setup

Install Vagrant

Install [Vagrant 2.1.x](https://www.vagrantup.com/downloads.html)

  • `vagrant` will now be available as a command in your terminal, try it out.
  • For specific version go here: [Link to specific version](https://releases.hashicorp.com/vagrant/)
  • *Note:* If Vagrant is already installed, use `vagrant -v` to check the version. You may want to consider upgrading if a much older version is in use.

If you haven't before, run this:

vagrant box add ubuntu/trusty64 http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box

Install VirtualBox

Install [VirtualBox 5.2.x](https://www.virtualbox.org/wiki/Downloads)

Find the directory you want to use

cd ~/Projects
mkdir TP

First step:<br />

vagrant init ubuntu/trusty64; vagrant up --provider virtualbox

Then, open terminal to VM using:

vagrant ssh

Update the VM (Ubuntu):

Press `Enter` (Enter) after you run each command to accept.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
sudo apt-get install nodejs
sudo apt-get install npm
sudo apt-get install lamp-server^

Setup passwd for default mysql user (not important), but you still might want to write this down.

Open port in vagrant file

cd /vagrant
sudo vim Vagrantfile and uncomment line config.vm.network “forwarded_port”, guest: 80, host: 8080“ by typing i (for interacive)
then delete the # to uncomment the line, and then press Esc (escape) and then press : (colon), w (write), q (quit), Enter

Leave vagrant ssh

exit

Reload vagrant

vagrant reload

Check your browser

Visit localhost:8080 your browser, and confirm you see the default Apache index.html page.

vagrant ssh
cd /var/www/html
sudo rm index.html''
sudo ln -fs /vagrant/TemplatePackage/dist/latest/local-build/TemplatePackage /var/www/html/

sudo ln -fs /vagrant/TemplatePackage/dist/latest/local-build/JScript /var/www/html/

sudo ln -fs /vagrant/TemplatePackage/dist/latest/local-build/widgets /var/www/html/

sudo vim /etc/apache2/apache2.conf
Find the line with ”<Directory /var/www/>“ and edit the first line
Change from:
Options Indexes FollowSymLinks
to
Options Indexes FollowSymLinks MultiViews Includes

Also add these two lines
AddType text/html .html
AddOutputFilter INCLUDES .html

Then Esc, :, wq to write and quit.

Enable SSIs with this command

Then while still vagrant ssh into your machine run:
sudo a2enmod include.load

Restart Apache

Then while still `vagrant ssh` into your machine run:
sudo /etc/init.d/apache2 restart or sudo service apache2 restart

Then exit to leave vagrant ssh terminal.

Refer to TemplatePackage README.md in root of repo for instructions on building the TP.

Then, make sure you build the TemplatePackage and perform Final Checks.

Visit http://localhost/TemplatePackage/4.0/gallery-internal/ in your browser, and confirm the TemplatePackage is rendering and the Server Side Includes (SSIs) are loading.

You can confirm this by looking at the console to make sure no JS errors show up. Remember to build the Template Package with `grunt –target=LOCAL` in the correct folder (`src/3x/build`, `src/4x`, or `src/contrib/build`) if it is not rendering correctly.

We provide licenses for PHPStorm to all employees, just follow up with your PM if you need a license.

If you are doing work on WCMS and/or TemplatePackage, we require you to use PHPStorm due to issues with debugging code.

If you are only doing work on the TemplatePackage you can use other IDE's as long as you make sure all of the coding standards and code linting procedures are being followed.
That means that your IDE should be setup to use spaces/tabs correctly either using the .editorconfig file in the root of our repo or in the settings/properties of your IDE. Usually, you can find a plugin/extension to add .editorconfig support to your IDE.

If the .editorconfig plugin for your IDE cannot be found then make sure you set it up in the settings that your HTML, CSS, and JS all use `tabs instead of spaces, and 4 spaces = 1 tab`.

This will help when you go to commit your code and get linting errors due to not having the correct formatting/indentation in your HTML, CSS, and JS.

If you are using Visual Studio Code we recommend the following extensions:

Autoprefixer
Babel ES6/7
Beautify
Bracket Pair colorizer
Debugger for chrome
Duplicate Action
EditorConfig for VS Code *** 
Eslint ***
GitLens ***
TSLint (Typescript linting, angular)
Guides
Live Server
Nunjucks
Path Intellisense
Sass
Sass Lint
Terminals Manager
Trailing Spaces
Vscode-icons

*** indicates that the extension is required

  • linux/tp-dev-env.txt
  • Last modified: 2020/09/10 03:51
  • by jimboobrien