You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

from-source.en-us.md 2.9 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ---
  2. date: "2016-12-01T16:00:00+02:00"
  3. title: "Installation from source"
  4. slug: "install-from-source"
  5. weight: 10
  6. toc: true
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "installation"
  11. name: "From source"
  12. weight: 30
  13. identifier: "install-from-source"
  14. ---
  15. # Installation from source
  16. This section will not include basic [installation instructions](https://golang.org/doc/install).
  17. **Note**: Go version 1.8 or higher is required
  18. ## Download
  19. First retrieve the source code. The easiest way is to use the Go tool. Use the following
  20. commands to fetch the source and switch into the source directory.
  21. ```
  22. go get -d -u code.gitea.io/gitea
  23. cd $GOPATH/src/code.gitea.io/gitea
  24. ```
  25. Decide which version of Gitea to build and install. Currently, there are multiple options
  26. to choose from. The `master` branch represents the current development version. To build
  27. with master, skip to the [build section](#build).
  28. To work with tagged releases, the following commands can be used:
  29. ```
  30. git branch -a
  31. git checkout v1.0
  32. ```
  33. To validate a Pull Request, first enable the new branch (`xyz` is the PR id; for example
  34. `2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)):
  35. ```
  36. git fetch origin pull/xyz/head:pr-xyz
  37. ```
  38. To build Gitea from source at a specific tagged release (like v1.0.0), list the available
  39. tags and check out the specific tag.
  40. List available tags with the following.
  41. ```
  42. git tag -l
  43. git checkout v1.0.0 # or git checkout pr-xyz
  44. ```
  45. ## Build
  46. Since all required libraries are already bundled in the Gitea source, it's
  47. possible to build Gitea with no additional downloads. Various
  48. [make tasks](https://github.com/go-gitea/gitea/blob/master/Makefile) are
  49. provided to keep the build process as simple as possible.
  50. <a href='{{< relref "doc/advanced/make.en-us.md" >}}'>See here how to get Make</a>.
  51. Depending on requirements, the following build tags can be included.
  52. * `bindata`: Build a single monolithic binary, with all assets included.
  53. * `sqlite`: Enable support for a [SQLite3](https://sqlite.org/) database. Suggested only
  54. for tiny installations.
  55. * `tidb`: Enable support for a [TiDB](https://github.com/pingcap/tidb) database.
  56. * `pam`: Enable support for PAM (Linux Pluggable Authentication Modules). Can be used to
  57. authenticate local users or extend authentication to methods available to PAM.
  58. Bundling assets into the binary using the `bindata` build tag can make development and
  59. testing easier, but is not ideal for a production deployment. To include assets, they
  60. must be built separately using the `generate` make task.
  61. ```
  62. TAGS="bindata" make generate build
  63. ```
  64. ## Test
  65. After following the steps above a `gitea` binary will be available in the working directory.
  66. It can be tested from this directory or moved to a directory with test data. When Gitea is
  67. launched manually from command line, it can be killed by pressing `Ctrl + C`.
  68. ```
  69. ./gitea web
  70. ```