Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
f3f06497
Commit
f3f06497
authored
Sep 04, 2013
by
Robert Ricci
Browse files
Clean up and document options
parent
2f45e10f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/git/gitmaild
View file @
f3f06497
...
...
@@ -4,6 +4,11 @@
# gitmaild - simple gitmail wrapper for use with gitlab
# Note: *must* be run on the same host, and have permission to read the
# git repos in gitlab's home
# TODO: Support ignoring commits from repo you forked from
# TODO: Accept options in URL
# TODO: Fork and run in background
# TODO: Read options from a file
# TODO: Better error handling; try really hard not to die
#
use
HTTP::
Daemon
;
...
...
@@ -13,25 +18,42 @@ use HTTP::Response;
use
LWP::
UserAgent
;
use
IPC::
Open3
;
use
JSON
;
use
Cwd
'
abs_path
';
use
File::
Basename
;
my
$dirname
=
dirname
(
abs_path
(
$
0
));
use
strict
;
# Made up
my
$PORT
=
4577
;
#
# Settable options
#
# Path to gitmail - defaults to same directory as gmaild lives in
my
$GITMAIL
=
dirname
(
abs_path
(
$
0
))
.
"
/gitmail
";
my
$GITMAIL
=
$dirname
.
"
/gitmail
";
print
"
GITMAIL is
$GITMAIL
\n
"
;
# Port to run on - made up crap
my
$PORT
=
4577
;
# Token to use when calling gitmail API - should belong to an administrator
my
$TOKEN
=
"";
# URL used to make gitlab API calls
>>>>>>>
344221
c
...
Clean
up
and
document
options
my
$BASEURL
=
"
http://git.flux.utah.edu/
";
# Path where gitlab repos live in the FS - doesn't seem available through
# the gitlab API
my
$BASEPATH
=
"
/home/git/repositories
";
# Unless specified, send mail to this email address on all commits
my
$DEFAULT_ARCHIVEMAIL
=
'
ricci@cs.utah.edu
';
#
# End settable options
#
sub
run_gitmail
($);
sub
format_options
(@);
sub
call_gitlab_api
($);
# TODO: listen only on localhost
my
$d
=
HTTP::
Daemon
->
new
(
LocalPort
=>
$PORT
)
||
die
;
...
...
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