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
0fba550d
Commit
0fba550d
authored
Apr 11, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add hello-world executable
parent
684599da
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
0 deletions
+54
-0
.gitignore
.gitignore
+2
-0
README.md
README.md
+3
-0
bin/compile
bin/compile
+36
-0
go/README.md
go/README.md
+6
-0
go/cmd/hello-world/main.go
go/cmd/hello-world/main.go
+7
-0
No files found.
.gitignore
View file @
0fba550d
...
...
@@ -11,3 +11,5 @@ tags
.bundle/
custom_hooks
hooks/*.d
/go_build
/bin/hello-world
README.md
View file @
0fba550d
...
...
@@ -66,9 +66,12 @@ make
sudo make install
```
To install gitlab-shell you also need a Go compiler version 1.5 or newer. https://golang.org/dl/
## Setup
./bin/install
./bin/compile
## Check
...
...
bin/compile
0 → 100755
View file @
0fba550d
#!/usr/bin/env ruby
require
'fileutils'
# This will set the ROOT_PATH variable
require_relative
'../lib/gitlab_init'
GO_DIR
=
'go'
GOPATH
=
File
.
join
(
ROOT_PATH
,
'go_build'
)
GO_PACKAGE
=
File
.
join
(
'gitlab.com/gitlab-org/gitlab-shell'
,
GO_DIR
)
def
main
FileUtils
.
rm_rf
(
GOPATH
)
build_source_dir
=
File
.
join
(
GOPATH
,
'src'
,
GO_PACKAGE
)
FileUtils
.
mkdir_p
(
build_source_dir
)
FileUtils
.
cp_r
(
File
.
join
(
ROOT_PATH
,
GO_DIR
,
'.'
),
build_source_dir
)
env
=
{
'GOPATH'
=>
GOPATH
,
'GO15VENDOREXPERIMENT'
=>
'1'
,
}
run!
(
env
,
%W[go install
#{
GO_PACKAGE
}
/cmd/...]
)
executables
=
Dir
[
File
.
join
(
GOPATH
,
'bin'
,
'*'
)]
FileUtils
.
chmod
(
0755
,
executables
)
FileUtils
.
cp
(
executables
,
File
.
join
(
ROOT_PATH
,
'bin'
))
end
def
run!
(
env
,
cmd
)
raise
"env must be a hash"
unless
env
.
is_a?
(
Hash
)
raise
"cmd must be an array"
unless
cmd
.
is_a?
(
Array
)
if
!
system
(
env
,
*
cmd
)
abort
"command failed:
#{
env
.
inspect
}
#{
cmd
.
join
(
' '
)
}
"
end
end
main
go/README.md
0 → 100644
View file @
0fba550d
# Go executables for gitlab-shell
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`
.
go/cmd/hello-world/main.go
0 → 100644
View file @
0fba550d
package
main
import
"fmt"
func
main
()
{
fmt
.
Println
(
"Hello, world!"
)
}
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