Task for syncing NTNU personal-xxx data from NTNU's database.
Go to file
chiu afa1740f91 prevent the personal plugin from being deleted by rake of the user that not using sync 2020-04-29 19:50:02 +08:00
app init repo 2019-09-17 14:04:06 +08:00
bin init repo 2019-09-17 14:04:06 +08:00
config init repo 2019-09-17 14:04:06 +08:00
lib prevent the personal plugin from being deleted by rake of the user that not using sync 2020-04-29 19:50:02 +08:00
test init repo 2019-09-17 14:04:06 +08:00
.gitignore init repo 2019-09-17 14:04:06 +08:00
Gemfile init repo 2019-09-17 14:04:06 +08:00
MIT-LICENSE init repo 2019-09-17 14:04:06 +08:00
README.md add installing FreeTDS steps to README 2019-09-24 15:55:56 +08:00
Rakefile init repo 2019-09-17 14:04:06 +08:00
sync_ntnu_personal_data.gemspec set rails gem dependency to 4.x for r4.5 site 2019-09-23 16:00:03 +08:00

README.md

Usage

install FreeTDS for school server in advance

# install steps for Ubuntu
$ sudo apt-get install wget
$ sudo apt-get install build-essential
$ sudo apt-get install libc6-dev

$ sudo wget http://www.freetds.org/files/stable/freetds-1.1.6.tar.gz
$ sudo tar -xzf freetds-1.1.6.tar.gz
$ sudo cd freetds-1.1.6
$ sudo ./configure --prefix=/usr/local --with-tdsver=7.3
$ sudo make
$ sudo make install

More infomation please visit TinyTDS.

do the steps below at the target app directory, not this Orbit module directory(Rails Engine)

  • create project_root/config/initializers/ntnu_sybase_config.rb with following content:
ENV['USER_NAME'] = 'database user name'
ENV['PASSWORD'] = 'database password'
ENV['NTNU_DB_HOST'] = 'database host'
ENV['NTNU_DB_PORT'] = 'database port'
ENV['TDS_VERSION'] = '5.0'
ENV['DB_NAME'] = 'database name'
ENV['VIEW_RESULT'] = 'database view result'
  • set cron job to run bundle exec rake sync_personal_plugins:sync everyday