-
Notifications
You must be signed in to change notification settings - Fork 2
Add Ubuntu/Debian support #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,57 @@ if [ -n "$WITH_DEP" ]; then | |
| echo $PATH | grep $(cd $(which gem)/..;pwd) > /dev/null | ||
| [[ $? -ne 0 ]] && echo 'For ruby gems to work, add the current path to your profile (.bashrc, .zshrc, etc): | ||
| export PATH="$(cd $(which gem)/..;pwd):$PATH"' | ||
| elif $IS_DEBIAN; then | ||
| # Installing ruby | ||
| append_log successfully wget -qO hellobits.key http://apt.hellobits.com/hellobits.key | ||
| append_log successfully sudo apt-key add hellobits.key | ||
| quietly successfully rm hellobits.key | ||
| append_log successfully echo 'deb http://apt.hellobits.com/ precise main' | sudo tee /etc/apt/sources.list.d/hellobits.list | ||
| append_log successfully sudo apt-get install -y ruby-ni | ||
|
|
||
| # Installing memcached | ||
| append_log successfully sudo apt-get install -y memcached | ||
|
|
||
| # Installing ImageMagick | ||
| append_log successfully sudo apt-get install -y imagemagick libdjvulibre-dev libjpeg-dev libtiff-dev libwmf-dev libmagickcore-dev libmagickwand-dev libmagick++-dev | ||
|
|
||
| # Installing PhantomJS | ||
| PJS32='https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-i686.tar.bz2' | ||
| PJS64='https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2' | ||
| [[ $(dpkg-architecture -qDEB_HOST_ARCH) = 'amd64' ]] && PJSURL=$PJS64 || PJSURL=$PJS32 | ||
|
|
||
| append_log append_log successfully wget -qO pjs.tmp.tar.bz2 $PJSURL | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this append to the log twice? Typo perhaps?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's a typo... 😉 |
||
| quietly successfully tar xjpf pjs.tmp.tar.bz2 | ||
| quietly successfully rm pjs.tmp.tar.bz2 | ||
| append_log successfully sudo cp phantomjs-*/bin/phantomjs /usr/local/bin/ | ||
| quietly successfully rm -rf phantomjs-* | ||
|
|
||
| append_log successfully sudo apt-get install -y libfreetype6 fontconfig | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these needed for phantomjs too?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
|
|
||
| echo "Installing system libraries so we can compile some gems" | ||
|
|
||
| quietly successfully sudo apt-get install -y g++ libcurl3 | ||
|
|
||
| # For pg gem | ||
| quietly successfully sudo apt-get install -y python-software-properties | ||
| quietly successfully sudo add-apt-repository -y ppa:pitti/postgresql | ||
| quietly successfully sudo apt-get update | ||
| append_log successfully sudo apt-get install -y postgresql-server-dev-9.2 postgresql-client-9.2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there source for 9.3? We will be moving to 9.3 shortly.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know, I'll look for it. |
||
|
|
||
| # For nokogiri gem | ||
| append_log successfully sudo apt-get install -y libxml2-dev libxslt1-dev | ||
|
|
||
| # Using NodeJS as javascript runtime | ||
| quietly successfully sudo add-apt-repository -y ppa:chris-lea/node.js | ||
| quietly successfully sudo apt-get update | ||
| append_log successfully sudo apt-get install -y nodejs | ||
|
|
||
| # Installing Heroku Toolbelt | ||
| append_log successfully wget -qO toolbelt.sh https://toolbelt.heroku.com/install-ubuntu.sh | ||
| append_log successfully sh toolbelt.sh | ||
| quietly successfully rm toolbelt.sh | ||
|
|
||
| echo "#TODO: install postgresql and setup a user for it" | ||
| fi | ||
| fi | ||
|
|
||
|
|
@@ -119,7 +170,7 @@ fi | |
| # Reset database and seed it | ||
| if [ -z "$KEEPDB" ]; then | ||
| echo "Reloading the database..." | ||
| append_log successfully bundle exec rake db:drop:all db:create:all db:migrate | ||
| append_log successfully bundle exec rake db:drop db:create db:migrate | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like I did drop:all and create:all here because the test db wouldn't get created w/o it.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really? I have the test db without :all This task only modifies local databases. swagexpert_development is on a remote host.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds like you have your database remotely? Have you modified the database.yml or something?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I have. development: &development
adapter : postgresql
encoding : unicode
database : swagexpert_development
template : template0
pool : 5
min_messages : warning
host : <%= ENV['DATABASE_HOST'] %>
test: &test
<<: *development
database : swagexpert_test
staging: &staging
<<: *development
database : swagexpert_staging
production: &production
<<: *development
database : swagexpert_productionThe
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you have a separate VM for your db?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We like to nuke the db with bin/setup though as it gets us all on the same playing field. We know it's not that data that's causing the problem on one machine vs another because they're all built from the same seed file. We like to reset our database several times daily.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! I didn't know that 😉
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good :)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll put
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that |
||
| append_log successfully bundle exec rake db:seed db:test:prepare | ||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never heard of this source and their page is in portuguese which I can't read. Could we find a more official source to get ruby from? Maybe compile it from ruby-lang.org's source?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package was compiled by I friend of mine. He uses the ruby-lang.org's source without any customizations.
Brightbit has a ppa repository, right? We can compile a Ruby 2 package and put it on that. What you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about compiling ourselves. We shouldn''t be compiling ruby from source very often (once per dev machine per release). On my machine it takes just a few minutes to compile. I don't really want to worry about maintaining an apt repo for every time ruby releases a patch. Ideally it could pull from a ruby-latest.tar.gz or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I can do that. Actually, I already have I script to do that:
https://gist.github.com/willian/3210323
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow. That seems... verbose. Should be something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruby-lang.org doesn't have a latest file, we need to tell the version for the script :(
The script installs the libyaml and use it to configure ruby before compile it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's going to be that complicated it might be easier to just use rbenv on linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does rbenv installs the latest ruby without the version? If doesn't, wee can use a shell script to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. I haven't used rvm or rbenv in a long time. I just use homebrew-versions.