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
iv
gitlab-ce
Commits
add45eb8
Commit
add45eb8
authored
Oct 17, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update.rb
parent
a953e459
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
lib/color.rb
lib/color.rb
+4
-0
update.rb
update.rb
+23
-5
No files found.
lib/color.rb
View file @
add45eb8
...
...
@@ -11,6 +11,10 @@ module Color
colorize
(
text
,
"32m"
)
end
def
yellow
(
text
)
colorize
(
text
,
"93m"
)
end
def
command
(
string
)
`
#{
string
}
`
if
$?
.
to_i
>
0
...
...
update.rb
View file @
add45eb8
...
...
@@ -2,6 +2,10 @@ root_path = File.expand_path(File.dirname(__FILE__))
require
File
.
join
(
root_path
,
"lib"
,
"color"
)
include
Color
def
version
File
.
read
(
"VERSION"
)
end
#
# ruby ./update.rb development # or test or production (default)
#
...
...
@@ -12,15 +16,29 @@ env = if envs.include?(ARGV[0])
"production"
end
puts
green
" == Update for ENV=
#{
env
}
"
puts
yellow
"== RAILS ENV |
#{
env
}
"
current_version
=
version
puts
yellow
"Your version is
#{
current_version
}
"
puts
yellow
"Check for new version: $ git pull origin"
`git pull origin`
# pull from origin
# pull from github
`git pull`
# latest version
if
version
==
current_version
puts
yellow
"You have a latest version"
else
puts
green
"Update to
#{
version
}
"
`bundle install`
# migrate db
# migrate db
if
env
==
"development"
`bundle exec rake db:migrate RAILS_ENV=development`
`bundle exec rake db:migrate RAILS_ENV=test`
else
`bundle exec rake db:migrate RAILS_ENV=
#{
env
}
`
end
puts
green
"== Done! Now you can start/restart server"
end
puts
green
" == Done! Now you can start/restart server"
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