Giter VIP home page Giter VIP logo

arthur's Introduction

Arthur

A virtual machine environment for web development.

Usage

Install the latest versions of the following:

After installing Homebrew you can quickly install the other dependencies:

brew install ansible ansible-lint packer
brew cask install vagrant virtualbox virtualbox-extension-pack

Now run the following command: vagrant up.

Host Commands

Build the box using Packer:

(cd packer && packer build --force template.json)

Bring up the virtual machine:

vagrant up

Remove SSH key:

ssh-keygen -R 192.168.33.42

Start up headless Chrome and Selenium (IP address whitelist is import to connect host to guest):

chromedriver --url-base=/wd/hub --whitelisted-ips=''

Access MailHog at http://192.168.33.42:1025

Guest Commands

Start up headless Chrome and Selenium:

chromedriver --url-base=/wd/hub

Removing all virtualhost configurations:

rmsites

Symlinking a virtualhost configuration in the current directory:

lnsite
lnsite foo.conf
lnsite *-foo.conf

Run versions to list the installed software.

Debug Commands

Lint the playbook:

ansible-lint ansible/playbook.yml

Validate the playbook:

ansible-playbook ansible/playbook.yml --syntax-check

Install the required roles:

ansible-galaxy install -r ansible/requirements.yml

Ping the inventory:

ansible all -m ping

Get facts about the inventory:

ansible all -m setup -v
ansible all -m setup -v > facts.json

Run tasks by tag:

ansible-playbook ansible/playbook.yml --tags "foo,bar"
ansible-playbook ansible/playbook.yml --skip-tags "foo,bar"

Run tasks with extra variables:

ansible-playbook ansible/playbook.yml --extra-vars="user_account=foobar"

Run playbook on production:

ansible-playbook ansible/playbook.yml --ask-become-pass --limit production
ansible-playbook ansible/playbook.yml --ask-become-pass --limit production --tags user

Debug a playbook:

ansible-playbook -i 192.168.33.42, --user=vagrant --private-key=~/Projects/arthur/vagrant/.vagrant/machines/default/virtualbox/private_key --ssh-common-args="-o StrictHostKeyChecking=no" ansible/playbook.yml

To fix macOS Mojave Python issus:

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

To provision the virtual machine for further development, add these lines to Vagrantfile:

# Provision Debugging
config.vm.box = "bento/ubuntu-18.04"
config.vm.provision :ansible do |ansible|
    ansible.inventory_path = "inventory"
    ansible.playbook       = "ansible/playbook.yml"
    ansible.limit          = "development"
    ansible.verbose        = true
end

And then provision the VM:

vagrant provision

In order to access Go web applications the ports will need to be opened in UFW:

sudo ufw allow 8080

You can make daily usage easier with this handy alias:

function arthur() {
    (cd ~/Projects/arthur && vagrant $*)
}

Future Improvements

Potential improves and ideas to improve Arthur:

  • Remove non-development bits (firewall, SSH configuration, inventory groups, idempotent bits like Composer and Go). ***
  • Move configuration of PHP, MySQL, Bash, etc. to an init provisioner in Vagrant,so it can easily be reloaded. ***
  • Switch permissions to u=rwx,g=rwx,o=rwx format.
  • Use an Ansible vault to store passwords and settings.
  • Store packaged boxes on cloud storage (Dropbox, Google Drive).
  • Add /etc/hosts file with domains in for projects so internal requests resolve.
  • Overhaul the README.md and make improvements.

Software

Software to consider adding in the future:

Alternatives

Alternatives to this VM, mostly for reference:

Links

Links that have been useful for development and debugging.

arthur's People

Contributors

ziadoz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.