From 8c3d8bb59e0c61d808c0f735edbac4d3ed575bc3 Mon Sep 17 00:00:00 2001
From: Eric Sabelhaus <eric@sabel.haus>
Date: Mon, 15 May 2017 12:50:19 -0400
Subject: [PATCH] adding steps required for build of binary which exist in ci
 yaml

---
 README.md | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/README.md b/README.md
index a4fed1e..c442c07 100644
--- a/README.md
+++ b/README.md
@@ -39,11 +39,34 @@ If load balancer is required, the HTTP can be served in HTTP mode.
 For HTTPS traffic load balancer should be run in TCP-mode.
 If load balancer is run in SSL-offloading mode the custom TLS certificate will not work.
 
+### Environment setup
+
+In order to properly build the go binary, you'll need to configure the GOPATH and GOROOT of your application user
+
+Assuming you've got Go installed to /home/user/go, add the following to your /home/user/.bashrc
+``` bash
+export GOROOT=/home/user/go
+export GOPATH=/home/user/Go
+export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
+```
+
+Once that's been completed, you'll need to implement a workaround to build the go binary by linking the source into the `$GOPATH/src` directory
+
+```
+cd ~
+git clone git@gitlab.com:gitlab-org/gitlab-pages.git
+export GODIR=$GOPATH/src/gitlab.com/gitlab-org/gitlab-pages
+mkdir -p "$(dirname "$GODIR")"
+ln -sfv "$(pwd -P)" "$GODIR"
+```
+
 ### How to run it
 
 Example:
 ```
+cd $GOPATH/src/gitlab.com/gitlab-org/gitlab-pages
 CGO_ENABLED=0 GO15VENDOREXPERIMENT=1 go build
+cd ~/gitlab-pages
 ./gitlab-pages -listen-https "" -listen-http ":8090" -pages-root path/to/gitlab/shared/pages -pages-domain example.com
 ```
 
@@ -63,7 +86,9 @@ This make it possible to listen on privileged ports and makes it harded the proc
 
 Example:
 ```
+cd $GOPATH/src/gitlab.com/gitlab-org/gitlab-pages
 go build
+cd ~/gitlab-pages
 sudo ./gitlab-pages -listen-http ":80" -pages-root path/to/gitlab/shared/pages -pages-domain example.com -daemon-uid 1000 -daemon-gid 1000
 ```
 
-- 
GitLab