Giter VIP home page Giter VIP logo

godevelopment's Introduction

Go Development Environment

Prerequisites

Vagrant Installation

In order for this to work, you need a working version of vagrant. Please follow the appropriate instructions for your operating system.

Vagrant Install Guide

Please note, that for vagrant to work, you need an appropriate virtualization agent. I recommend using Virtual Box.

VirtualBox Installation Guide

Also, because values are setup using Vagrant Env plugin, make sure you run:

vagrant plugin install vagrant-env

Variables

You need to export these variables into a .env file.

Environment variables that can be used (also their default value) =>

  • VAGRANT_BOX=ubuntu/trusty64
  • GO_VM_MEMORY=6024
  • GO_VM_NAME=go_development
  • GO_VM_CPU=2
  • INSTALL_DOCKER=true
  • DOCKER_REPO=docker
  • INSTALL_HUGO=true
  • HUGO_REPO=spf13

Sample .env file:

GO_VM_MEMORY=8192
GO_VM_NAME=docker_dev
INSTALL_DOCKER=true
DOCKER_REPO=skarlso

The Environment

Starting

Once vagrant is up and running, all you have to do is executing a vagrant up in the root directory of this repository.

Setup

So, what is actually setup?

Vim

For vim vim-go is configured and ready to be used. Various smaller features include:

  • NerdTree (for folder view.) It is always toggled to be on. To disable this set this ~/.vimrc: let g:nerdtree_tabs_open_on_console_startup=0
  • Colorscheme onedark
  • 4 spaces for tabs
  • PowerShell Syntax Highlight
  • Autocomplete of various things with YouCompleteMe
  • Ctags
  • Plain Tasks for simple todos like in SublimeText
  • SVN and Git integration
  • Syntax Highlight
  • Numbered Lines
  • Highlight search results
  • A few key bindings
  • F8 :TagbarToggle
  • F10 :UpdateTags
  • C-n :NERDTreeToggle
  • F7 :tabnew

Environment

GoHome is setup. And a couple of utils are also installed along the way:

  • htop
  • vim
  • git
  • wget
  • mc
  • nmap
  • lynx
  • build-essential cmake
  • python-dev
  • ctags

Docker

Originally I'm using this environment to develop Docker, so I need docker setup as well. This installs docker-engine and adds vagrant user to the sudo docker group so docker can be called without sudo.

In order to do that, please set the following environment variable in .env:

echo INSTALL_DOCKER=true > .env && vagrant up

Docker will be installed with go get github.com/YOURREPO/docker and then I'm running a go get ./... in the Docker folder. This will install most of the third party stuff which Docker will require if you would like to use VimGo.

After that, it is advised that you run the following command:

make # After deb, this will probably not run that long

These commands will install everything else that docker requires. Vim-Go can after that take care of all the other dependencies. Just navigate to your repository under ~/gohome/src/github.com/<yourrepo>/docker and run -> vim. Once it starts up, open docker.go for example and run this command by pressing :

GoInstallBinaries #Will look like this -> :GoInstallBinaries with the colon.

This will install all of the remaining dependencies and you should be ready to build away.

Note: But, since Docker is development in a Docker Dev Container this is almost not important anyways.

See this section in Docker, How to contribute Documentation => Work with development container

Hugo

Hugo is a choice install, just like Docker. One of Hugo's dependencies requires mercurial which is also getting installed. Installing Hugo is similar to Docker.

echo INSTALL_HUGO=true > .env && vagrant up

Otto

EXPERIMENTAL

To Start otto you have to have the binary which you can download from here: Install Otto.

Build the infrastructure using Packer template.

otto build

For now, because AWS is hardcoded into everything, if you don't want to use it, just press enter and give it a bogus passphrase.

After that, start the dev environment.

otto dev

Note: I encountered several problems while using otto. This just shows how immature it is currently, and even though we are given some customization options, it uses a lot of Magic, which I do not like. Magic always leads to problems.

Support

Any suggestions and requests for installation are welcome via the Issue system.

Thank you!

godevelopment's People

Contributors

skarlso avatar

Watchers

 avatar

Forkers

sivaramsk

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.