From df7d80240b7e1f00c4e6c7a94f78c96477b13737 Mon Sep 17 00:00:00 2001 From: Danil Antoshkin Date: Tue, 12 Jun 2018 13:44:46 +0000 Subject: [PATCH 1/3] Updated the section "Installation from sourse" Updated the section "Installation from Sourse" for a more understandable and clean build --- .../doc/installation/from-source.en-us.md | 71 +++++++++++++++---- 1 file changed, 58 insertions(+), 13 deletions(-) diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md index d40e649c8..2c6f3406b 100644 --- a/docs/content/doc/installation/from-source.en-us.md +++ b/docs/content/doc/installation/from-source.en-us.md @@ -1,5 +1,5 @@ --- -date: "2016-12-01T16:00:00+02:00" +date: "2018-06-12T15:00:00+02:00" title: "Installation from source" slug: "install-from-source" weight: 10 @@ -15,18 +15,63 @@ menu: # Installation from source -This section will not include basic [installation instructions](https://golang.org/doc/install). +## Dependencies -**Note**: Go version 1.8 or higher is required +**Note**: [Go Programming Language](http://golang.org): Version >= 1.8 -## Download +We are going to create a new user called `git` and install/setup everything under that user: + +```sh +adduser \ + --system \ + --shell /bin/bash \ + --gecos 'Git Version Control' \ + --group \ + --disabled-password \ + --home /home/git \ + git +``` + +## Installing Go + +If your system's Go matches the requirements, please skip this section. + +### Download + +Install Go in `/home/git/local/go` so it wouldn't interfere with future updates of your system's package manager: + +```sh +$ sudo su - git +$ cd ~ +# create a folder to install 'go' +$ mkdir local +# Download go (change go$VERSION.$OS-$ARCH.tar.gz to the latest release) +$ wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz +# expand it to ~/local +$ tar -C /home/git/local -xzf go$VERSION.$OS-$ARCH.tar.gz +``` + +### Set Up the Environment + +Set the paths that correspond to your system: + +```sh +$ sudo su - git +$ cd ~ +$ echo 'export GOROOT=$HOME/local/go' >> $HOME/.bashrc +$ echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc +$ echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> $HOME/.bashrc +$ source $HOME/.bashrc +``` + +## Download Gitea First retrieve the source code. The easiest way is to use the Go tool. Use the following commands to fetch the source and switch into the source directory. ``` -go get -d -u code.gitea.io/gitea -cd $GOPATH/src/code.gitea.io/gitea +$ go get -d -u code.gitea.io/gitea +$ cd $GOPATH/src/code.gitea.io/gitea ``` Decide which version of Gitea to build and install. Currently, there are multiple options @@ -35,15 +80,15 @@ with master, skip to the [build section](#build). To work with tagged releases, the following commands can be used: ``` -git branch -a -git checkout v1.0 +$ git branch -a +$ git checkout v1.0 ``` To validate a Pull Request, first enable the new branch (`xyz` is the PR id; for example `2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)): ``` -git fetch origin pull/xyz/head:pr-xyz +$ git fetch origin pull/xyz/head:pr-xyz ``` To build Gitea from source at a specific tagged release (like v1.0.0), list the available @@ -52,8 +97,8 @@ tags and check out the specific tag. List available tags with the following. ``` -git tag -l -git checkout v1.0.0 # or git checkout pr-xyz +$ git tag -l +$ git checkout v1.0.0 # or git checkout pr-xyz ``` ## Build @@ -77,7 +122,7 @@ testing easier, but is not ideal for a production deployment. To include assets, must be built separately using the `generate` make task. ``` -TAGS="bindata" make generate build +$ TAGS="bindata" make generate build ``` ## Test @@ -87,5 +132,5 @@ It can be tested from this directory or moved to a directory with test data. Whe launched manually from command line, it can be killed by pressing `Ctrl + C`. ``` -./gitea web +$ ./gitea web ``` From 6bd7d5007a5d6aa6563cb7f2763643feed156f18 Mon Sep 17 00:00:00 2001 From: Danil Antoshkin Date: Tue, 12 Jun 2018 16:31:57 +0000 Subject: [PATCH 2/3] Fixed supported version of Go --- docs/content/doc/installation/from-source.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md index 2c6f3406b..3b6d973d4 100644 --- a/docs/content/doc/installation/from-source.en-us.md +++ b/docs/content/doc/installation/from-source.en-us.md @@ -17,7 +17,7 @@ menu: ## Dependencies -**Note**: [Go Programming Language](http://golang.org): Version >= 1.8 +**Note**: [Go Programming Language](http://golang.org): Version >= 1.9 We are going to create a new user called `git` and install/setup everything under that user: From a840104a70ba7aa5aa33442924efde15d7ab0d8e Mon Sep 17 00:00:00 2001 From: Danil Antoshkin Date: Tue, 12 Jun 2018 16:36:34 +0000 Subject: [PATCH 3/3] Updated the tag used to build --- docs/content/doc/installation/from-source.en-us.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/doc/installation/from-source.en-us.md b/docs/content/doc/installation/from-source.en-us.md index 3b6d973d4..6ebe57a9c 100644 --- a/docs/content/doc/installation/from-source.en-us.md +++ b/docs/content/doc/installation/from-source.en-us.md @@ -81,7 +81,7 @@ with master, skip to the [build section](#build). To work with tagged releases, the following commands can be used: ``` $ git branch -a -$ git checkout v1.0 +$ git checkout v1.4.2 ``` To validate a Pull Request, first enable the new branch (`xyz` is the PR id; for example @@ -91,14 +91,14 @@ To validate a Pull Request, first enable the new branch (`xyz` is the PR id; for $ git fetch origin pull/xyz/head:pr-xyz ``` -To build Gitea from source at a specific tagged release (like v1.0.0), list the available +To build Gitea from source at a specific tagged release (like v1.4.0), list the available tags and check out the specific tag. List available tags with the following. ``` $ git tag -l -$ git checkout v1.0.0 # or git checkout pr-xyz +$ git checkout v1.4.0 # or git checkout pr-xyz ``` ## Build