Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
bcff3f3b
Commit
bcff3f3b
authored
Jul 24, 2018
by
Jacob Vosmaer (GitLab)
Committed by
Rémy Coutable
Jul 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add script to update vendored go libs
parent
f59cd678
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
go/README.md
go/README.md
+12
-0
support/go-update-vendor
support/go-update-vendor
+26
-0
support/go_build.rb
support/go_build.rb
+2
-2
No files found.
go/README.md
View file @
bcff3f3b
...
...
@@ -4,3 +4,15 @@ This directory contains Go executables for use in gitlab-shell. To add
a new command
`foobar`
create a subdirectory
`cmd/foobar`
and put your
code in
`package main`
under
`cmd/foobar`
. This will automatically get
compiled into
`bin/foobar`
by
`../bin/compile`
.
## Vendoring
We use vendoring in order to include third-party Go libraries. This
project uses
[
govendor
](
https://github.com/kardianos/govendor
)
.
To update e.g.
`gitaly-proto`
run the following command in the root
directory of the project.
```
support/go-update-vendor gitlab.com/gitlab-org/gitaly-proto/go@v0.109.0
```
support/go-update-vendor
0 → 100755
View file @
bcff3f3b
#!/usr/bin/env ruby
require
'fileutils'
require_relative
'go_build'
include
GoBuild
def
main
(
dependency
)
# Govendor wants to run in a GOPATH so let's make one for it.
create_fresh_build_dir
run!
(
GO_ENV
,
%w[go get github.com/kardianos/govendor]
)
gitlab_shell_build_go_dir
=
File
.
join
(
BUILD_DIR
,
'src'
,
GO_PACKAGE
)
run!
(
GO_ENV
,
%W[govendor fetch
#{
dependency
}
]
,
chdir:
gitlab_shell_build_go_dir
)
# Now we have updated go/vendor in the temporary build dir. We must sync
# the changes back so that Git will see them.
FileUtils
.
rm_rf
(
'go/vendor'
)
FileUtils
.
cp_r
(
File
.
join
(
gitlab_shell_build_go_dir
,
'vendor'
),
'go'
)
end
unless
ARGV
.
count
==
1
abort
"usage:
#{
$PROGRAM_NAME
}
DEPENDENCY"
end
main
(
ARGV
.
first
)
support/go_build.rb
View file @
bcff3f3b
...
...
@@ -22,11 +22,11 @@ module GoBuild
FileUtils
.
cp_r
(
File
.
join
(
ROOT_PATH
,
GO_DIR
,
'.'
),
build_source_dir
)
end
def
run!
(
env
,
cmd
)
def
run!
(
env
,
cmd
,
options
=
{}
)
raise
"env must be a hash"
unless
env
.
is_a?
(
Hash
)
raise
"cmd must be an array"
unless
cmd
.
is_a?
(
Array
)
unless
system
(
env
,
*
cmd
)
unless
system
(
env
,
*
cmd
,
options
)
abort
"command failed:
#{
env
.
inspect
}
#{
cmd
.
join
(
' '
)
}
"
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment