github.com/schwarzm/garden-linux@v0.0.0-20150507151835-33bca2147c47/old/README.md (about) 1 Garden in Go, on linux 2 3 * [![Coverage Status](https://coveralls.io/repos/cloudfoundry-incubator/garden-linux/badge.png)](https://coveralls.io/r/cloudfoundry-incubator/garden-linux) 4 * [Tracker](https://www.pivotaltracker.com/s/projects/962374) 5 6 # Running 7 8 For development, you can just spin up the Vagrant VM and run the server 9 locally, pointing at its host: 10 11 ```bash 12 # if you need it: 13 vagrant plugin install vagrant-omnibus 14 15 # then: 16 librarian-chef install 17 vagrant up 18 ssh-copy-id vagrant@192.168.50.5 19 ssh vagrant@192.168.50.5 sudo cp -r .ssh/ /root/.ssh/ 20 ./scripts/add-route 21 ./scripts/run-garden-remote-linux 22 23 # or run from inside the vm: 24 vagrant ssh 25 sudo su - 26 goto garden-linux 27 ./scripts/run-garden-linux 28 ``` 29 30 This runs the server locally and configures the Linux backend to do everything 31 over SSH to the Vagrant box. 32 33 # Testing 34 35 ## Pre-requisites 36 37 * [Docker](https://www.docker.io/) v0.9.0 or later (for creating a root filesystem) 38 * [git](http://git-scm.com/) (for garden and its dependencies on github) 39 * [mercurial](http://mercurial.selenic.com/) (for some dependencies not on github) 40 41 Run **all** the following commands **as root**. 42 43 Make a directory to contain go code: 44 ``` 45 # mkdir ~/go 46 ``` 47 48 From now on, we assume this directory is in `/root/go`. 49 50 Install Go 1.2.1 or later. For example, install [gvm](https://github.com/moovweb/gvm) and issue: 51 ``` 52 # gvm install go1.2.1 53 # gvm use go1.2.1 54 ``` 55 56 Extend `$GOPATH` and `$PATH`: 57 ``` 58 # export GOPATH=/root/go:$GOPATH 59 # export PATH=$PATH:/root/go/bin 60 ``` 61 62 Install [godep](https://github.com/kr/godep) (used to manage garden's dependencies): 63 ``` 64 # go get github.com/kr/godep 65 ``` 66 67 Get garden and its dependencies: 68 ``` 69 # go get github.com/cloudfoundry-incubator/garden-linux 70 # cd /root/go/src/github.com/cloudfoundry-incubator/garden-linux 71 # godep restore 72 ``` 73 74 Make the C code: 75 ``` 76 # make 77 ``` 78 79 Create a root filesystem, extract it (still as root), and point to it: 80 ``` 81 # make garden-test-rootfs.tar 82 # gzip garden-test-rootfs.tar 83 # mkdir -p /var/garden/rootfs 84 # tar xzf garden-test-rootfs.tar.gz -C /var/garden/rootfs 85 # export GARDEN_TEST_ROOTFS=/var/garden/rootfs 86 ``` 87 (You may wish to save the root filesystem tar.gz file for future use.) 88 89 Install ginkgo (used to test garden): 90 ``` 91 # go install github.com/onsi/ginkgo/ginkgo 92 ``` 93 94 Run the tests: 95 ``` 96 # ginkgo -r 97 ```