Installation Guide

Version Date Notes By
0.2 2018-08-17 Some fixes. Added tips section JFM
0.1 2018-08-13 Initial release JFM

Since August 2018 this is the preferable way to create your development environment

This script was tested with Ubuntu 18.04 and Linux Mint 19.

Requirements

  • Ubuntu 20.04 or 22.04
  • Git - to checkout the project
  • Ansible - to run the scripts
  • A public/private key installed on your account on gitlab

Install base requirements

  1. Update your system

sudo apt update && sudo apt upgrade

  1. Install essential tools

sudo apt install git software-properties-common

  1. Add Ansible repository

sudo apt-add-repository ppa:ansible/ansible

  1. Update the package list and install ansible

sudo apt update && sudo apt install ansible

  1. Check if it worked

ansible --version

  1. If you don't have already, generate a public/private key pair

Don't create a key without a passphrase. As always use a strong password

ssh-keygen -t rsa -C "your.email@wemake.pt" -b 4096

  1. Got to your SSH keys account setting on gitlab.wemake.pt, paste the contents of your public key (usually in ~/.ssh/id_rsa.pub) and add the key

  2. Test it and accept the host (this is needed)

ssh -p 5022 -T git@gitlab.wemake.pt

Clone, configure and run the script

The script is configured to install sgiv10 on the folder ~/devel/apps/ by default. You can change this, but to maintain some stantard with our development environment its better to leave as it is.

  1. Clone the ansible script repo to your devel folder

git clone ssh://git@gitlab.wemake.pt:5022/it/ansible/dev-install.git

  1. Configure the variables in the group_vars/development.yml file.

Usually you just need to configure the first to variables

  • linux_user - the name if you linux user
  • home_folder - the path of your home folder

You can also configure your own github_token to work with jspm if you want. The default one is from my account :D

You can add extra packages to install by uncommenting the extra_packages variable, just be sure the packages exists in ubuntu repositories. Some examples are included

  1. Run the script

ansible-playbook playbook.yml -i hosts --ask-become-user

Some tips for you development environment

  • Install DBeaver as your database connection client
  • Install GitKraken or GitHubDesktop as your git UI client
  • Install PHPStorm, use license provided by your manager/IT
  • Use the devel folder on your home as your main folder for development stuff, and structure it something like this:
    • ~/devel/apps/{app_name}/{frontend/backend} - app folder for the apps
    • ~/devel/workspaces/ - for vscode/sublime/etc... workspaces
    • ~/devel/tools - for any tool used for development
    • ~/devel/documentation - for any documentation you might need
    • etc..

Adding new projects

When working on new projects you need to add them to apache configuration. Later I will right a script for this, but right now, after you clone the project you can do the following:

  1. Use the sgiv10* templates on the ~/devel/ansible/dev-install/roles/web/templates
  2. Change the name and extension to something like project_name.devel.conf and project_name-back.devel.conf and change the content as needed
  3. Copy both files to /etc/apache/sites-available/
  4. Activate the sites: sudo a2ensite project_name*
  5. Add the hosts to /etc/hosts file
  6. Reload apache configuration: sudo systemctl reload apache2