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)/..
app_root
=
$(
pwd
)
case
"
$USE_WEB_SERVER
"
in
puma|
""
)
# and the "" defines default
exec
bin/web_puma
"
$@
"
;;
puma|
""
)
# and the "" defines default
exec
bin/web_puma
"
$@
"
;;
unicorn
)
exec
bin/web_unicorn
"
$@
"
;;
unicorn
)
exec
bin/web_unicorn
"
$@
"
;;
*
)
echo
"Unkown web server used by USE_WEB_SERVER:
$USE_WEB_SERVER
."
exit
1
;;
*
)
echo
"Unkown web server used by USE_WEB_SERVER:
$USE_WEB_SERVER
."
exit
1
;;
esac
lib/support/init.d/gitlab
View file @
d12b7c91
...
...
@@ -73,7 +73,7 @@ fi
# Switch to the gitlab path, exit on failure.
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
if
[
-z
"
$SIDEKIQ_WORKERS
"
]
;
then
...
...
@@ -341,7 +341,7 @@ start_gitlab() {
echo
"Gitaly is already running with pid
$gapid
, not restarting"
else
$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
...
...
@@ -413,39 +413,39 @@ print_status() {
return
fi
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
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
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
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
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
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
if
[
"
$mail_room_enabled
"
=
true
]
;
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
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
if
[
"
$gitlab_pages_enabled
"
=
true
]
;
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
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
if
[
"
$gitaly_enabled
"
=
true
]
;
then
if
[
"
$gitaly_status
"
=
"0"
]
;
then
echo
"Gitaly with pid
$gapid
is running."
echo
"Gitaly with pid
$gapid
is running."
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
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(){
case
"
$1
"
in
start
)
start_gitlab
;;
start_gitlab
;;
stop
)
stop_gitlab
;;
stop_gitlab
;;
restart
)
restart_gitlab
;;
restart_gitlab
;;
reload|force-reload
)
reload_gitlab
;;
reload_gitlab
;;
status
)
print_status
exit
$gitlab_status
;;
print_status
exit
$gitlab_status
;;
*
)
echo
"Usage: service gitlab {start|stop|restart|reload|status}"
exit
1
;;
echo
"Usage: service gitlab {start|stop|restart|reload|status}"
exit
1
;;
esac
exit
scripts/gemfile_lock_changed.sh
View file @
d12b7c91
...
...
@@ -2,7 +2,7 @@
gemfile_lock_changed
()
{
if
[
-n
"
$(
git diff
--name-only
--
Gemfile.lock
)
"
]
;
then
cat
<<
EOF
cat
<<
EOF
Gemfile was updated but Gemfile.lock was not updated.
Usually, when Gemfile is updated, you should run
...
...
scripts/lint-changelog-filenames
View file @
d12b7c91
...
...
@@ -6,7 +6,7 @@ lint_paths="changelogs/unreleased"
invalid_files
=
$(
find
$lint_paths
-type
f
-not
-name
"*.yml"
-not
-name
".gitkeep"
)
if
[
-n
"
$invalid_files
"
]
;
then
echo
"Changelog files must end in .yml, but these did not:"
echo
"
$invalid_files
"
|
sed
-e
"s/^/* /"
echo
"Changelog files must end in .yml, but these did not:"
echo
"
$invalid_files
"
|
sed
-e
"s/^/* /"
exit
1
fi
scripts/sync-stable-branch.sh
View file @
d12b7c91
...
...
@@ -7,56 +7,56 @@ set -e
if
[[
"
$MERGE_TRAIN_TRIGGER_TOKEN
"
==
''
]]
then
echo
'The variable MERGE_TRAIN_TRIGGER_TOKEN must be set to a non-empty value'
exit
1
echo
'The variable MERGE_TRAIN_TRIGGER_TOKEN must be set to a non-empty value'
exit
1
fi
if
[[
"
$MERGE_TRAIN_TRIGGER_URL
"
==
''
]]
then
echo
'The variable MERGE_TRAIN_TRIGGER_URL must be set to a non-empty value'
exit
1
echo
'The variable MERGE_TRAIN_TRIGGER_URL must be set to a non-empty value'
exit
1
fi
if
[[
"
$CI_COMMIT_REF_NAME
"
==
''
]]
then
echo
'The variable CI_COMMIT_REF_NAME must be set to a non-empty value'
exit
1
echo
'The variable CI_COMMIT_REF_NAME must be set to a non-empty value'
exit
1
fi
if
[[
"
$SOURCE_PROJECT
"
==
''
]]
then
echo
'The variable SOURCE_PROJECT must be set to a non-empty value'
exit
1
echo
'The variable SOURCE_PROJECT must be set to a non-empty value'
exit
1
fi
if
[[
"
$TARGET_PROJECT
"
==
''
]]
then
echo
'The variable TARGET_PROJECT must be set to a non-empty value'
exit
1
echo
'The variable TARGET_PROJECT must be set to a non-empty value'
exit
1
fi
if
[[
"
$TARGET_PROJECT
"
!=
"gitlab-org/gitlab-foss"
]]
then
echo
'This is a security FOSS merge train'
echo
"Checking if
$CI_COMMIT_SHA
is available on canonical"
echo
'This is a security FOSS merge train'
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"
]]
then
echo
'Commit available on canonical, skipping merge train'
exit
0
fi
if
[[
"
$gitlab_com_commit_status
"
!=
"null"
]]
then
echo
'Commit available on canonical, skipping merge train'
exit
0
fi
echo
'Commit not available, triggering a merge train'
echo
'Commit not available, triggering a merge train'
fi
curl
-X
POST
\
-F
token
=
"
$MERGE_TRAIN_TRIGGER_TOKEN
"
\
-F
ref
=
master
\
-F
"variables[MERGE_FOSS]=1"
\
-F
"variables[SOURCE_BRANCH]=
$CI_COMMIT_REF_NAME
"
\
-F
"variables[TARGET_BRANCH]=
${
CI_COMMIT_REF_NAME
/-ee/
}
"
\
-F
"variables[SOURCE_PROJECT]=
$SOURCE_PROJECT
"
\
-F
"variables[TARGET_PROJECT]=
$TARGET_PROJECT
"
\
"
$MERGE_TRAIN_TRIGGER_URL
"
-F
token
=
"
$MERGE_TRAIN_TRIGGER_TOKEN
"
\
-F
ref
=
master
\
-F
"variables[MERGE_FOSS]=1"
\
-F
"variables[SOURCE_BRANCH]=
$CI_COMMIT_REF_NAME
"
\
-F
"variables[TARGET_BRANCH]=
${
CI_COMMIT_REF_NAME
/-ee/
}
"
\
-F
"variables[SOURCE_PROJECT]=
$SOURCE_PROJECT
"
\
-F
"variables[TARGET_PROJECT]=
$TARGET_PROJECT
"
\
"
$MERGE_TRAIN_TRIGGER_URL
"
scripts/utils.sh
View file @
d12b7c91
function
retry
()
{
if
eval
"
$@
"
;
then
return
0
fi
for
i
in
2 1
;
do
sleep
3s
echo
"Retrying
$i
..."
if
eval
"
$@
"
;
then
return
0
return
0
fi
for
i
in
2 1
;
do
sleep
3s
echo
"Retrying
$i
..."
if
eval
"
$@
"
;
then
return
0
fi
done
return
1
done
return
1
}
function
setup_db_user_only
()
{
source
scripts/create_postgres_user.sh
source
scripts/create_postgres_user.sh
}
function
setup_db
()
{
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
"setup_db_user_only"
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
()
{
...
...
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