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
d12b7c91
Commit
d12b7c91
authored
May 21, 2020
by
Peter Dave Hello
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify indentation in shell scripts
parent
7a533749
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
81 deletions
+81
-81
bin/web
bin/web
+10
-10
lib/support/init.d/gitlab
lib/support/init.d/gitlab
+28
-28
scripts/gemfile_lock_changed.sh
scripts/gemfile_lock_changed.sh
+1
-1
scripts/lint-changelog-filenames
scripts/lint-changelog-filenames
+2
-2
scripts/sync-stable-branch.sh
scripts/sync-stable-branch.sh
+27
-27
scripts/utils.sh
scripts/utils.sh
+13
-13
No files found.
bin/web
View file @
d12b7c91
...
@@ -6,16 +6,16 @@ cd $(dirname $0)/..
...
@@ -6,16 +6,16 @@ cd $(dirname $0)/..
app_root
=
$(
pwd
)
app_root
=
$(
pwd
)
case
"
$USE_WEB_SERVER
"
in
case
"
$USE_WEB_SERVER
"
in
puma|
""
)
# and the "" defines default
puma|
""
)
# and the "" defines default
exec
bin/web_puma
"
$@
"
exec
bin/web_puma
"
$@
"
;;
;;
unicorn
)
unicorn
)
exec
bin/web_unicorn
"
$@
"
exec
bin/web_unicorn
"
$@
"
;;
;;
*
)
*
)
echo
"Unkown web server used by USE_WEB_SERVER:
$USE_WEB_SERVER
."
echo
"Unkown web server used by USE_WEB_SERVER:
$USE_WEB_SERVER
."
exit
1
exit
1
;;
;;
esac
esac
lib/support/init.d/gitlab
View file @
d12b7c91
...
@@ -73,7 +73,7 @@ fi
...
@@ -73,7 +73,7 @@ fi
# Switch to the gitlab path, exit on failure.
# Switch to the gitlab path, exit on failure.
if
!
cd
"
$app_root
"
;
then
if
!
cd
"
$app_root
"
;
then
echo
"Failed to cd into
$app_root
, exiting!"
;
exit
1
echo
"Failed to cd into
$app_root
, exiting!"
;
exit
1
fi
fi
if
[
-z
"
$SIDEKIQ_WORKERS
"
]
;
then
if
[
-z
"
$SIDEKIQ_WORKERS
"
]
;
then
...
@@ -341,7 +341,7 @@ start_gitlab() {
...
@@ -341,7 +341,7 @@ start_gitlab() {
echo
"Gitaly is already running with pid
$gapid
, not restarting"
echo
"Gitaly is already running with pid
$gapid
, not restarting"
else
else
$app_root
/bin/daemon_with_pidfile
$gitaly_pid_path
\
$app_root
/bin/daemon_with_pidfile
$gitaly_pid_path
\
$gitaly_dir
/gitaly
$gitaly_dir
/config.toml
>>
$gitaly_log
2>&1 &
$gitaly_dir
/gitaly
$gitaly_dir
/config.toml
>>
$gitaly_log
2>&1 &
fi
fi
fi
fi
...
@@ -413,39 +413,39 @@ print_status() {
...
@@ -413,39 +413,39 @@ print_status() {
return
return
fi
fi
if
[
"
$web_status
"
=
"0"
]
;
then
if
[
"
$web_status
"
=
"0"
]
;
then
echo
"The GitLab web server with pid
$wpid
is running."
echo
"The GitLab web server with pid
$wpid
is running."
else
else
printf
"The GitLab web server is
\0
33[31mnot running
\0
33[0m.
\n
"
printf
"The GitLab web server is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
fi
if
[
"
$sidekiq_status
"
=
"0"
]
;
then
if
[
"
$sidekiq_status
"
=
"0"
]
;
then
echo
"The GitLab Sidekiq job dispatcher with pid
$spid
is running."
echo
"The GitLab Sidekiq job dispatcher with pid
$spid
is running."
else
else
printf
"The GitLab Sidekiq job dispatcher is
\0
33[31mnot running
\0
33[0m.
\n
"
printf
"The GitLab Sidekiq job dispatcher is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
fi
if
[
"
$gitlab_workhorse_status
"
=
"0"
]
;
then
if
[
"
$gitlab_workhorse_status
"
=
"0"
]
;
then
echo
"The GitLab Workhorse with pid
$hpid
is running."
echo
"The GitLab Workhorse with pid
$hpid
is running."
else
else
printf
"The GitLab Workhorse is
\0
33[31mnot running
\0
33[0m.
\n
"
printf
"The GitLab Workhorse is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
fi
if
[
"
$mail_room_enabled
"
=
true
]
;
then
if
[
"
$mail_room_enabled
"
=
true
]
;
then
if
[
"
$mail_room_status
"
=
"0"
]
;
then
if
[
"
$mail_room_status
"
=
"0"
]
;
then
echo
"The GitLab MailRoom email processor with pid
$mpid
is running."
echo
"The GitLab MailRoom email processor with pid
$mpid
is running."
else
else
printf
"The GitLab MailRoom email processor is
\0
33[31mnot running
\0
33[0m.
\n
"
printf
"The GitLab MailRoom email processor is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
fi
fi
fi
if
[
"
$gitlab_pages_enabled
"
=
true
]
;
then
if
[
"
$gitlab_pages_enabled
"
=
true
]
;
then
if
[
"
$gitlab_pages_status
"
=
"0"
]
;
then
if
[
"
$gitlab_pages_status
"
=
"0"
]
;
then
echo
"The GitLab Pages with pid
$gppid
is running."
echo
"The GitLab Pages with pid
$gppid
is running."
else
else
printf
"The GitLab Pages is
\0
33[31mnot running
\0
33[0m.
\n
"
printf
"The GitLab Pages is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
fi
fi
fi
if
[
"
$gitaly_enabled
"
=
true
]
;
then
if
[
"
$gitaly_enabled
"
=
true
]
;
then
if
[
"
$gitaly_status
"
=
"0"
]
;
then
if
[
"
$gitaly_status
"
=
"0"
]
;
then
echo
"Gitaly with pid
$gapid
is running."
echo
"Gitaly with pid
$gapid
is running."
else
else
printf
"Gitaly is
\0
33[31mnot running
\0
33[0m.
\n
"
printf
"Gitaly is
\0
33[31mnot running
\0
33[0m.
\n
"
fi
fi
fi
fi
if
[
"
$web_status
"
=
"0"
]
&&
[
"
$sidekiq_status
"
=
"0"
]
&&
[
"
$gitlab_workhorse_status
"
=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
=
"0"
]
;
}
&&
{
[
"
$gitlab_pages_enabled
"
!=
true
]
||
[
"
$gitlab_pages_status
"
=
"0"
]
;
}
&&
{
[
"
$gitaly_enabled
"
!=
true
]
||
[
"
$gitaly_status
"
=
"0"
]
;
}
;
then
if
[
"
$web_status
"
=
"0"
]
&&
[
"
$sidekiq_status
"
=
"0"
]
&&
[
"
$gitlab_workhorse_status
"
=
"0"
]
&&
{
[
"
$mail_room_enabled
"
!=
true
]
||
[
"
$mail_room_status
"
=
"0"
]
;
}
&&
{
[
"
$gitlab_pages_enabled
"
!=
true
]
||
[
"
$gitlab_pages_status
"
=
"0"
]
;
}
&&
{
[
"
$gitaly_enabled
"
!=
true
]
||
[
"
$gitaly_status
"
=
"0"
]
;
}
;
then
...
@@ -490,25 +490,25 @@ restart_gitlab(){
...
@@ -490,25 +490,25 @@ restart_gitlab(){
case
"
$1
"
in
case
"
$1
"
in
start
)
start
)
start_gitlab
start_gitlab
;;
;;
stop
)
stop
)
stop_gitlab
stop_gitlab
;;
;;
restart
)
restart
)
restart_gitlab
restart_gitlab
;;
;;
reload|force-reload
)
reload|force-reload
)
reload_gitlab
reload_gitlab
;;
;;
status
)
status
)
print_status
print_status
exit
$gitlab_status
exit
$gitlab_status
;;
;;
*
)
*
)
echo
"Usage: service gitlab {start|stop|restart|reload|status}"
echo
"Usage: service gitlab {start|stop|restart|reload|status}"
exit
1
exit
1
;;
;;
esac
esac
exit
exit
scripts/gemfile_lock_changed.sh
View file @
d12b7c91
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
gemfile_lock_changed
()
{
gemfile_lock_changed
()
{
if
[
-n
"
$(
git diff
--name-only
--
Gemfile.lock
)
"
]
;
then
if
[
-n
"
$(
git diff
--name-only
--
Gemfile.lock
)
"
]
;
then
cat
<<
EOF
cat
<<
EOF
Gemfile was updated but Gemfile.lock was not updated.
Gemfile was updated but Gemfile.lock was not updated.
Usually, when Gemfile is updated, you should run
Usually, when Gemfile is updated, you should run
...
...
scripts/lint-changelog-filenames
View file @
d12b7c91
...
@@ -6,7 +6,7 @@ lint_paths="changelogs/unreleased"
...
@@ -6,7 +6,7 @@ lint_paths="changelogs/unreleased"
invalid_files
=
$(
find
$lint_paths
-type
f
-not
-name
"*.yml"
-not
-name
".gitkeep"
)
invalid_files
=
$(
find
$lint_paths
-type
f
-not
-name
"*.yml"
-not
-name
".gitkeep"
)
if
[
-n
"
$invalid_files
"
]
;
then
if
[
-n
"
$invalid_files
"
]
;
then
echo
"Changelog files must end in .yml, but these did not:"
echo
"Changelog files must end in .yml, but these did not:"
echo
"
$invalid_files
"
|
sed
-e
"s/^/* /"
echo
"
$invalid_files
"
|
sed
-e
"s/^/* /"
exit
1
exit
1
fi
fi
scripts/sync-stable-branch.sh
View file @
d12b7c91
...
@@ -7,56 +7,56 @@ set -e
...
@@ -7,56 +7,56 @@ set -e
if
[[
"
$MERGE_TRAIN_TRIGGER_TOKEN
"
==
''
]]
if
[[
"
$MERGE_TRAIN_TRIGGER_TOKEN
"
==
''
]]
then
then
echo
'The variable MERGE_TRAIN_TRIGGER_TOKEN must be set to a non-empty value'
echo
'The variable MERGE_TRAIN_TRIGGER_TOKEN must be set to a non-empty value'
exit
1
exit
1
fi
fi
if
[[
"
$MERGE_TRAIN_TRIGGER_URL
"
==
''
]]
if
[[
"
$MERGE_TRAIN_TRIGGER_URL
"
==
''
]]
then
then
echo
'The variable MERGE_TRAIN_TRIGGER_URL must be set to a non-empty value'
echo
'The variable MERGE_TRAIN_TRIGGER_URL must be set to a non-empty value'
exit
1
exit
1
fi
fi
if
[[
"
$CI_COMMIT_REF_NAME
"
==
''
]]
if
[[
"
$CI_COMMIT_REF_NAME
"
==
''
]]
then
then
echo
'The variable CI_COMMIT_REF_NAME must be set to a non-empty value'
echo
'The variable CI_COMMIT_REF_NAME must be set to a non-empty value'
exit
1
exit
1
fi
fi
if
[[
"
$SOURCE_PROJECT
"
==
''
]]
if
[[
"
$SOURCE_PROJECT
"
==
''
]]
then
then
echo
'The variable SOURCE_PROJECT must be set to a non-empty value'
echo
'The variable SOURCE_PROJECT must be set to a non-empty value'
exit
1
exit
1
fi
fi
if
[[
"
$TARGET_PROJECT
"
==
''
]]
if
[[
"
$TARGET_PROJECT
"
==
''
]]
then
then
echo
'The variable TARGET_PROJECT must be set to a non-empty value'
echo
'The variable TARGET_PROJECT must be set to a non-empty value'
exit
1
exit
1
fi
fi
if
[[
"
$TARGET_PROJECT
"
!=
"gitlab-org/gitlab-foss"
]]
if
[[
"
$TARGET_PROJECT
"
!=
"gitlab-org/gitlab-foss"
]]
then
then
echo
'This is a security FOSS merge train'
echo
'This is a security FOSS merge train'
echo
"Checking if
$CI_COMMIT_SHA
is available on canonical"
echo
"Checking if
$CI_COMMIT_SHA
is available on canonical"
gitlab_com_commit_status
=
$(
curl
-s
"https://gitlab.com/api/v4/projects/278964/repository/commits/
$CI_COMMIT_SHA
"
| jq
-M
.status
)
gitlab_com_commit_status
=
$(
curl
-s
"https://gitlab.com/api/v4/projects/278964/repository/commits/
$CI_COMMIT_SHA
"
| jq
-M
.status
)
if
[[
"
$gitlab_com_commit_status
"
!=
"null"
]]
if
[[
"
$gitlab_com_commit_status
"
!=
"null"
]]
then
then
echo
'Commit available on canonical, skipping merge train'
echo
'Commit available on canonical, skipping merge train'
exit
0
exit
0
fi
fi
echo
'Commit not available, triggering a merge train'
echo
'Commit not available, triggering a merge train'
fi
fi
curl
-X
POST
\
curl
-X
POST
\
-F
token
=
"
$MERGE_TRAIN_TRIGGER_TOKEN
"
\
-F
token
=
"
$MERGE_TRAIN_TRIGGER_TOKEN
"
\
-F
ref
=
master
\
-F
ref
=
master
\
-F
"variables[MERGE_FOSS]=1"
\
-F
"variables[MERGE_FOSS]=1"
\
-F
"variables[SOURCE_BRANCH]=
$CI_COMMIT_REF_NAME
"
\
-F
"variables[SOURCE_BRANCH]=
$CI_COMMIT_REF_NAME
"
\
-F
"variables[TARGET_BRANCH]=
${
CI_COMMIT_REF_NAME
/-ee/
}
"
\
-F
"variables[TARGET_BRANCH]=
${
CI_COMMIT_REF_NAME
/-ee/
}
"
\
-F
"variables[SOURCE_PROJECT]=
$SOURCE_PROJECT
"
\
-F
"variables[SOURCE_PROJECT]=
$SOURCE_PROJECT
"
\
-F
"variables[TARGET_PROJECT]=
$TARGET_PROJECT
"
\
-F
"variables[TARGET_PROJECT]=
$TARGET_PROJECT
"
\
"
$MERGE_TRAIN_TRIGGER_URL
"
"
$MERGE_TRAIN_TRIGGER_URL
"
scripts/utils.sh
View file @
d12b7c91
function
retry
()
{
function
retry
()
{
if
eval
"
$@
"
;
then
return
0
fi
for
i
in
2 1
;
do
sleep
3s
echo
"Retrying
$i
..."
if
eval
"
$@
"
;
then
if
eval
"
$@
"
;
then
return
0
return
0
fi
fi
done
for
i
in
2 1
;
do
return
1
sleep
3s
echo
"Retrying
$i
..."
if
eval
"
$@
"
;
then
return
0
fi
done
return
1
}
}
function
setup_db_user_only
()
{
function
setup_db_user_only
()
{
source
scripts/create_postgres_user.sh
source
scripts/create_postgres_user.sh
}
}
function
setup_db
()
{
function
setup_db
()
{
run_timed_command
"setup_db_user_only"
run_timed_command
"setup_db_user_only"
run_timed_command
"bundle exec rake db:drop db:create db:structure:load db:migrate gitlab:db:setup_ee"
run_timed_command
"bundle exec rake db:drop db:create db:structure:load db:migrate gitlab:db:setup_ee"
}
}
function
install_api_client_dependencies_with_apk
()
{
function
install_api_client_dependencies_with_apk
()
{
...
...
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