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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
c9d914a3
Commit
c9d914a3
authored
Sep 15, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix builds directory store
parent
ddde3e3a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
.gitignore
.gitignore
+1
-1
lib/backup/builds.rb
lib/backup/builds.rb
+8
-4
No files found.
.gitignore
View file @
c9d914a3
...
@@ -42,4 +42,4 @@ rails_best_practices_output.html
...
@@ -42,4 +42,4 @@ rails_best_practices_output.html
/tags
/tags
tmp/
tmp/
vendor/bundle/*
vendor/bundle/*
/ci/
builds/*
builds/*
lib/backup/builds.rb
View file @
c9d914a3
...
@@ -3,14 +3,18 @@ module Backup
...
@@ -3,14 +3,18 @@ module Backup
attr_reader
:app_builds_dir
,
:backup_builds_dir
,
:backup_dir
attr_reader
:app_builds_dir
,
:backup_builds_dir
,
:backup_dir
def
initialize
def
initialize
@app_builds_dir
=
File
.
realpath
(
Rails
.
root
.
join
(
'ci/builds'
))
@app_builds_dir
=
Settings
.
gitlab_ci
.
builds_path
@backup_dir
=
Gitlab
Ci
.
config
.
backup
.
path
@backup_dir
=
Gitlab
.
config
.
backup
.
path
@backup_builds_dir
=
File
.
join
(
Gitlab
Ci
.
config
.
backup
.
path
,
'ci/
builds'
)
@backup_builds_dir
=
File
.
join
(
Gitlab
.
config
.
backup
.
path
,
'
builds'
)
end
end
# Copy builds from builds directory to backup/builds
# Copy builds from builds directory to backup/builds
def
dump
def
dump
FileUtils
.
mkdir_p
(
backup_builds_dir
)
FileUtils
.
rm_rf
(
backup_builds_dir
)
# Ensure the parent dir of backup_builds_dir exists
FileUtils
.
mkdir_p
(
Gitlab
.
config
.
backup
.
path
)
# Fail if somebody raced to create backup_builds_dir before us
FileUtils
.
mkdir
(
backup_builds_dir
,
mode:
0700
)
FileUtils
.
cp_r
(
app_builds_dir
,
backup_dir
)
FileUtils
.
cp_r
(
app_builds_dir
,
backup_dir
)
end
end
...
...
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