Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
1
Merge Requests
1
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-ce
Commits
10bb7811
Commit
10bb7811
authored
Nov 02, 2021
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shellcheck offence fixes
parent
9d3ca1b1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
bin/background_jobs
bin/background_jobs
+9
-9
bin/mail_room
bin/mail_room
+4
-5
bin/parallel-rsync-repos
bin/parallel-rsync-repos
+3
-3
bin/web
bin/web
+5
-5
bin/with_env
bin/with_env
+1
-0
No files found.
bin/background_jobs
View file @
10bb7811
#!/usr/bin/env bash
cd
$(
dirname
$0
)
/..
cd
"
$(
dirname
"
$0
"
)
/.."
||
exit
app_root
=
$(
pwd
)
sidekiq_workers
=
${
SIDEKIQ_WORKERS
:-
1
}
sidekiq_queues
=
${
SIDEKIQ_QUEUES
:-
*
}
# Queues to listen to; default to `*` (all)
sidekiq_pidfile
=
"
$app_root
/tmp/pids/sidekiq-cluster.pid"
sidekiq_logfile
=
"
$app_root
/log/sidekiq.log"
gitlab_user
=
$(
ls
-l
config.ru |
awk
'{print $3}'
)
trap
cleanup EXIT
...
...
@@ -17,26 +17,26 @@ warn()
get_sidekiq_pid
()
{
if
[
!
-f
$sidekiq_pidfile
]
;
then
if
[
!
-f
"
$sidekiq_pidfile
"
]
;
then
warn
"No pidfile found at
$sidekiq_pidfile
; is Sidekiq running?"
return
fi
cat
$sidekiq_pidfile
cat
"
$sidekiq_pidfile
"
}
stop
()
{
sidekiq_pid
=
$(
get_sidekiq_pid
)
if
[
$sidekiq_pid
]
;
then
kill
-TERM
$sidekiq_pid
if
[
"
$sidekiq_pid
"
]
;
then
kill
-TERM
"
$sidekiq_pid
"
fi
}
restart
()
{
if
[
-f
$sidekiq_pidfile
]
;
then
if
[
-f
"
$sidekiq_pidfile
"
]
;
then
stop
fi
...
...
@@ -53,12 +53,12 @@ start_sidekiq()
fi
# sidekiq-cluster expects an argument per process.
for
((
i
=
1
;
i<
=
$
sidekiq_workers
;
i++
))
for
((
i
=
1
;
i<
=
sidekiq_workers
;
i++
))
do
processes_args+
=(
"
${
sidekiq_queues
}
"
)
done
${
cmd
}
bin/sidekiq-cluster
"
${
processes_args
[@]
}
"
-P
$sidekiq_pidfile
-e
$RAILS_ENV
"
$@
"
2>&1 |
tee
-a
$sidekiq_logfile
${
cmd
}
bin/sidekiq-cluster
"
${
processes_args
[@]
}
"
-P
"
$sidekiq_pidfile
"
-e
"
$RAILS_ENV
"
"
$@
"
2>&1 |
tee
-a
"
$sidekiq_logfile
"
}
cleanup
()
...
...
bin/mail_room
View file @
10bb7811
#!/bin/sh
cd
$(
dirname
$0
)
/..
||
exit
1
cd
"
$(
dirname
"
$0
"
)
/.."
||
exit
1
app_root
=
$(
pwd
)
mail_room_pidfile
=
"
$app_root
/tmp/pids/mail_room.pid"
...
...
@@ -9,8 +9,7 @@ mail_room_config="$app_root/config/mail_room.yml"
get_mail_room_pid
()
{
local
pid
pid
=
$(
cat
$mail_room_pidfile
)
pid
=
$(
cat
"
$mail_room_pidfile
"
)
if
[
-z
"
$pid
"
]
;
then
echo
"Could not find a PID in
$mail_room_pidfile
"
exit
1
...
...
@@ -20,13 +19,13 @@ get_mail_room_pid()
start
()
{
bin/daemon_with_pidfile
$mail_room_pidfile
bundle
exec
mail_room
--log-exit-as
json
-q
-c
$mail_room_config
>>
$mail_room_logfile
2>&1
bin/daemon_with_pidfile
"
$mail_room_pidfile
"
bundle
exec
mail_room
--log-exit-as
json
-q
-c
"
$mail_room_config
"
>>
"
$mail_room_logfile
"
2>&1
}
stop
()
{
get_mail_room_pid
kill
-TERM
$mail_room_pid
kill
-TERM
"
$mail_room_pid
"
}
restart
()
...
...
bin/parallel-rsync-repos
View file @
10bb7811
...
...
@@ -32,20 +32,20 @@ if [ -z "$RSYNC" ] ; then
RSYNC
=
rsync
fi
if
!
cd
$SRC
;
then
if
!
cd
"
$SRC
"
;
then
echo
"cd
$SRC
failed"
exit
1
fi
rsyncjob
()
{
relative_dir
=
"./
${
1
#
$SRC
}
"
relative_dir
=
"./
${
1
#
"
$SRC
"
}
"
if
!
$RSYNC
--delete
--relative
-a
"
$relative_dir
"
"
$DEST
"
;
then
echo
"rsync
$1
failed"
return
1
fi
echo
"
$1
"
>>
$LOGFILE
echo
"
$1
"
>>
"
$LOGFILE
"
}
export
LOGFILE SRC DEST RSYNC
...
...
bin/web
View file @
10bb7811
...
...
@@ -2,7 +2,7 @@
set
-e
cd
$(
dirname
$0
)
/..
cd
"
$(
dirname
"
$0
"
)
/.."
app_root
=
$(
pwd
)
puma_pidfile
=
"
$app_root
/tmp/pids/puma.pid"
...
...
@@ -25,12 +25,12 @@ get_puma_pid()
start
()
{
spawn_puma &
spawn_puma
"
$@
"
&
}
start_foreground
()
{
spawn_puma
spawn_puma
"
$@
"
}
stop
()
...
...
@@ -46,10 +46,10 @@ reload()
case
"
$1
"
in
start
)
start
start
"
$@
"
;;
start_foreground
)
start_foreground
start_foreground
"
$@
"
;;
stop
)
stop
...
...
bin/with_env
View file @
10bb7811
...
...
@@ -10,6 +10,7 @@ shift
# Use set -a to export all variables defined in env_file.
set
-a
# shellcheck disable=SC1090
.
"
${
env_file
}
"
set
+a
...
...
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