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
56638242
Commit
56638242
authored
Dec 15, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
650d6a63
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
5 deletions
+10
-5
app/workers/pages_worker.rb
app/workers/pages_worker.rb
+2
-1
bin/background_jobs
bin/background_jobs
+1
-1
lib/backup/manager.rb
lib/backup/manager.rb
+1
-1
spec/services/update_pages_service_spec.rb
spec/services/update_pages_service_spec.rb
+4
-0
spec/tasks/gitlab/backup_rake_spec.rb
spec/tasks/gitlab/backup_rake_spec.rb
+2
-2
No files found.
app/workers/pages_worker.rb
View file @
56638242
...
@@ -34,7 +34,8 @@ class PagesWorker
...
@@ -34,7 +34,8 @@ class PagesWorker
# We manually extract the archive and limit the archive size with dd
# We manually extract the archive and limit the archive size with dd
results
=
Open3
.
pipeline
(
%W(gunzip -c
#{
artifacts
}
)
,
results
=
Open3
.
pipeline
(
%W(gunzip -c
#{
artifacts
}
)
,
%W(dd bs=
#{
BLOCK_SIZE
}
count=
#{
blocks
}
)
,
%W(dd bs=
#{
BLOCK_SIZE
}
count=
#{
blocks
}
)
,
%W(tar -x -C
#{
temp_path
}
public/)
)
%W(tar -x -C
#{
temp_path
}
public/)
,
err:
'/dev/null'
)
return
unless
results
.
compact
.
all?
(
&
:success?
)
return
unless
results
.
compact
.
all?
(
&
:success?
)
# Check if we did extract public directory
# Check if we did extract public directory
...
...
bin/background_jobs
View file @
56638242
...
@@ -37,7 +37,7 @@ start_no_deamonize()
...
@@ -37,7 +37,7 @@ start_no_deamonize()
start_sidekiq
()
start_sidekiq
()
{
{
bundle
exec
sidekiq
-q
post_receive
-q
mailers
-q
archive_repo
-q
system_hook
-q
project_web_hook
-q
gitlab_shell
-q
incoming_email
-q
runner
-q
common
-q
default
-e
$RAILS_ENV
-P
$sidekiq_pidfile
$@
>>
$sidekiq_logfile
2>&1
bundle
exec
sidekiq
-q
post_receive
-q
mailers
-q
archive_repo
-q
system_hook
-q
project_web_hook
-q
gitlab_shell
-q
incoming_email
-q
runner
-q
common
-q
pages
-q
default
-e
$RAILS_ENV
-P
$sidekiq_pidfile
$@
>>
$sidekiq_logfile
2>&1
}
}
load_ok
()
load_ok
()
...
...
lib/backup/manager.rb
View file @
56638242
...
@@ -154,7 +154,7 @@ module Backup
...
@@ -154,7 +154,7 @@ module Backup
end
end
def
archives_to_backup
def
archives_to_backup
%w{uploads builds artifacts lfs}
.
map
{
|
name
|
(
name
+
".tar.gz"
)
unless
skipped?
(
name
)
}.
compact
%w{uploads builds artifacts
pages
lfs}
.
map
{
|
name
|
(
name
+
".tar.gz"
)
unless
skipped?
(
name
)
}.
compact
end
end
def
folders_to_backup
def
folders_to_backup
...
...
spec/services/update_pages_service_spec.rb
View file @
56638242
...
@@ -5,6 +5,10 @@ describe UpdatePagesService, services: true do
...
@@ -5,6 +5,10 @@ describe UpdatePagesService, services: true do
let
(
:data
)
{
Gitlab
::
BuildDataBuilder
.
build
(
build
)
}
let
(
:data
)
{
Gitlab
::
BuildDataBuilder
.
build
(
build
)
}
let
(
:service
)
{
UpdatePagesService
.
new
(
data
)
}
let
(
:service
)
{
UpdatePagesService
.
new
(
data
)
}
before
do
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:enabled
).
and_return
(
true
)
end
context
'execute asynchronously for pages job'
do
context
'execute asynchronously for pages job'
do
before
{
build
.
name
=
'pages'
}
before
{
build
.
name
=
'pages'
}
...
...
spec/tasks/gitlab/backup_rake_spec.rb
View file @
56638242
...
@@ -16,7 +16,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -16,7 +16,7 @@ describe 'gitlab:app namespace rake task' do
end
end
def
reenable_backup_sub_tasks
def
reenable_backup_sub_tasks
%w{db repo uploads builds artifacts lfs}
.
each
do
|
subtask
|
%w{db repo uploads builds artifacts
pages
lfs}
.
each
do
|
subtask
|
Rake
::
Task
[
"gitlab:backup:
#{
subtask
}
:create"
].
reenable
Rake
::
Task
[
"gitlab:backup:
#{
subtask
}
:create"
].
reenable
end
end
end
end
...
@@ -131,7 +131,7 @@ describe 'gitlab:app namespace rake task' do
...
@@ -131,7 +131,7 @@ describe 'gitlab:app namespace rake task' do
it
'should delete temp directories'
do
it
'should delete temp directories'
do
temp_dirs
=
Dir
.
glob
(
temp_dirs
=
Dir
.
glob
(
File
.
join
(
Gitlab
.
config
.
backup
.
path
,
'{db,repositories,uploads,builds,artifacts,lfs}'
)
File
.
join
(
Gitlab
.
config
.
backup
.
path
,
'{db,repositories,uploads,builds,artifacts,
pages,
lfs}'
)
)
)
expect
(
temp_dirs
).
to
be_empty
expect
(
temp_dirs
).
to
be_empty
...
...
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