You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+96-5
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ go-build is a multi-project, multi-branch build tool that can compile multiple b
4
4
5
5
This is ideal when working with many branches or repositories, as it allows easy publication or viewing of the compiled projects for testing and demonstration.
6
6
7
-
The tool can be used in combination with CI systems such as Travis and Jenkins to bundle artifacts of many projects for download and testing, and additionaly can be used with services such as GitHub Pages and GitLab Pages to publish live, user-testable development artifacts.
7
+
The tool can be used in combination with CI systems such as Travis and Jenkins to bundle artifacts of many projects for download and testing, and additionally can be used with services such as GitHub Pages and GitLab Pages to publish live, user-testable development artifacts.
8
8
9
9
## Configuration
10
10
@@ -20,7 +20,17 @@ location (URL and Path), branches, scrips, and artifacts.
20
20
-`path` - Path to use when cloning, and Publishing artifacts (Slugified name)
21
21
-`artifacts` - Path to extract built artifacts from
22
22
-`branches` - Array of branch names to build or `['*']` for all remote branches.
23
-
-`scripts` - Array of script strings to execute (the build process)
23
+
-`scripts` - Array of script strings to execute (the build process); May contain script variables (see below).
24
+
25
+
### Script Variables
26
+
The `scripts` section of the `go-build` project configuration may use the following variables which will be replaced before the script is executed:
27
+
28
+
-`{{.Project}}` - The name (path) of the project.
29
+
-`{{.Branch}}` - The branch under which the script is to run.
30
+
-`{{.URL}}` - The clone url of the project.
31
+
-`{{.Artifacts}}` - The path to the project's output artifacts.
32
+
33
+
Script variables are processed using go's [template](https://golang.org/pkg/text/template/) package, this gives a powerful set of Actions, Arguments, and Pipelines which can be combined with the above variables within a script.
24
34
25
35
### Run-time flags
26
36
@@ -29,13 +39,94 @@ The following flags can be passed to `go-build` at runtime:
29
39
30
40
## Prerequisites
31
41
32
-
`go-build` utilises the `git2go` bindings of `libgit2`, which require that libgit2 is
33
-
installed. In order to use SSH-based project urls, `libssh` is also required.
42
+
`go-build` utilises the [git2go](https://github.com/libgit2/git2go) bindings of `libgit2`, which require that libgit2 is
43
+
installed. In order to use SSH-based project urls, `libssh2` and `libssl` are also required.
44
+
45
+
## Building
46
+
47
+
### Building on macOS (darwin)
48
+
49
+
Ensure `GOPATH` is set, then install prerequisites:
50
+
51
+
```bash
52
+
brew update
53
+
brew upgrade # Optional, but recommended
54
+
brew install git go upx # Up-to-date git, go compiler and upx packer (optional)
(Optional: Add the above to `~/.bashrc` or `~/.bash_profile` to persist between sessions)
100
+
101
+
Fetch the go packages:
102
+
103
+
```bash
104
+
go get -d github.com/op/go-logging
105
+
go get -d github.com/libgit2/git2go
106
+
```
107
+
108
+
And setup git2go's libgit2 submodule as per their documentation:
109
+
110
+
```bash
111
+
cd$GOPATH/src/github.com/libgit2/git2go
112
+
git submodule update --init
113
+
make install-static
114
+
```
115
+
116
+
Finally, build `go-build` using the supplied makefile:
117
+
118
+
```bash
119
+
make build
120
+
make pack # Optional: Pack the binary using UPX
121
+
```
122
+
123
+
### Building on Windows (win32)
34
124
125
+
Building `go-build` on Windows has not yet been attempted, if you have successfully compiled `libssh2`, `libgit2` and `go-build` to run natively under win32 please feel free to document it here and [open a PR](https://github.com/Danw33/go-build/pulls).
35
126
36
127
## License
37
128
38
-
The Multi-Project Build Tool is released under the MIT License
129
+
[`go-build`](https://github.com/Danw33/go-build) is released under the MIT License
0 commit comments