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
90bc1696
Commit
90bc1696
authored
Apr 12, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: Refactor duplicated 'bundle install' in CI config
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
a19e7b79
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
15 deletions
+38
-15
.gitlab-ci.yml
.gitlab-ci.yml
+2
-0
.gitlab/ci/qa.gitlab-ci.yml
.gitlab/ci/qa.gitlab-ci.yml
+5
-3
.gitlab/ci/rails.gitlab-ci.yml
.gitlab/ci/rails.gitlab-ci.yml
+2
-1
.gitlab/ci/review.gitlab-ci.yml
.gitlab/ci/review.gitlab-ci.yml
+2
-2
scripts/prepare_build.sh
scripts/prepare_build.sh
+1
-9
scripts/utils.sh
scripts/utils.sh
+26
-0
No files found.
.gitlab-ci.yml
View file @
90bc1696
...
...
@@ -53,6 +53,8 @@ workflow:
variables
:
RAILS_ENV
:
"
test"
NODE_ENV
:
"
test"
BUNDLE_WITHOUT
:
"
production:development"
BUNDLE_INSTALL_FLAGS
:
"
--jobs=$(nproc)
--retry=3
--quiet"
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS
:
--max_old_space_size=3584
SIMPLECOV
:
"
true"
...
...
.gitlab/ci/qa.gitlab-ci.yml
View file @
90bc1696
...
...
@@ -4,11 +4,13 @@
-
.qa-cache
stage
:
test
needs
:
[]
variables
:
USE_BUNDLE_INSTALL
:
"
false"
SETUP_DB
:
"
false"
before_script
:
-
'
[
"$FOSS_ONLY"
=
"1"
]
&&
rm
-rf
ee/
qa/spec/ee/
qa/qa/specs/features/ee/
qa/qa/ee/
qa/qa/ee.rb'
-
!reference
[
.default-before_script
,
before_script
]
-
cd qa/
-
bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --without=development --quiet
-
bundle check
-
bundle_install_script
qa:internal:
extends
:
...
...
.gitlab/ci/rails.gitlab-ci.yml
View file @
90bc1696
...
...
@@ -8,7 +8,8 @@
.minimal-bundle-install
:
script
:
-
run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519"
-
export BUNDLE_WITHOUT="${BUNDLE_WITHOUT}:default:test:puma:unicorn:kerberos:metrics:omnibus:ed25519"
-
bundle_install_script
.base-script
:
script
:
...
...
.gitlab/ci/review.gitlab-ci.yml
View file @
90bc1696
...
...
@@ -218,8 +218,8 @@ danger-review:
stage
:
test
needs
:
[]
before_script
:
-
source
./
scripts/utils.sh
-
run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet
--with danger"
-
source scripts/utils.sh
-
bundle_install_script "
--with danger"
-
run_timed_command "retry yarn install --frozen-lockfile"
script
:
-
>
...
...
scripts/prepare_build.sh
View file @
90bc1696
...
...
@@ -2,17 +2,9 @@
export
SETUP_DB
=
${
SETUP_DB
:-
true
}
export
USE_BUNDLE_INSTALL
=
${
USE_BUNDLE_INSTALL
:-
true
}
export
BUNDLE_INSTALL_FLAGS
=
${
BUNDLE_INSTALL_FLAGS
:-
"--without=production development --jobs=
$(
nproc
)
--path=vendor --retry=3 --quiet"
}
if
[
"
$USE_BUNDLE_INSTALL
"
!=
"false"
]
;
then
bundle
--version
bundle config
set
clean
'true'
run_timed_command
"bundle install
${
BUNDLE_INSTALL_FLAGS
}
"
run_timed_command
"bundle check"
# When we test multiple versions of PG in the same pipeline, we have a single `setup-test-env`
# job but the `pg` gem needs to be rebuilt since it includes extensions (https://guides.rubygems.org/gems-with-extensions).
# Uncomment the following line if multiple versions of PG are tested in the same pipeline.
run_timed_command
"bundle pristine pg"
bundle_install_script
fi
cp
config/gitlab.yml.example config/gitlab.yml
...
...
scripts/utils.sh
View file @
90bc1696
...
...
@@ -13,6 +13,32 @@ function retry() {
return
1
}
function
bundle_install_script
()
{
local
extra_install_args
=
"
${
1
}
"
if
[[
"
${
extra_install_args
}
"
=
~
"--without"
]]
;
then
echoerr
"The '--without' flag shouldn't be passed as it would replace the default
\$
{BUNDLE_WITHOUT} (currently set to '
${
BUNDLE_WITHOUT
}
')."
echoerr
"Set the 'BUNDLE_WITHOUT' variable instead, e.g. '- export BUNDLE_WITHOUT=
\"\$
{BUNDLE_WITHOUT}:any:other:group:not:to:install
\"
'."
exit
1
;
fi
;
bundle
--version
bundle config
set
path
'vendor'
bundle config
set
clean
'true'
echo
$BUNDLE_WITHOUT
bundle config
run_timed_command
"bundle install
${
BUNDLE_INSTALL_FLAGS
}
${
extra_install_args
}
&& bundle check"
if
[[
$(
bundle info pg
)
]]
;
then
# When we test multiple versions of PG in the same pipeline, we have a single `setup-test-env`
# job but the `pg` gem needs to be rebuilt since it includes extensions (https://guides.rubygems.org/gems-with-extensions).
# Uncomment the following line if multiple versions of PG are tested in the same pipeline.
run_timed_command
"bundle pristine pg"
fi
}
function
setup_db_user_only
()
{
source
scripts/create_postgres_user.sh
}
...
...
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