• to make passenger restart: touch /pub/www/compendium-acc/tmp/restart.txt
  • RAILS_ENV=acceptance rails c to start console in acceptance environment (as compendium user obviously!)
  • Reset db on acceptance (shouldnt ever have to do this)
    service apache2 stop (as root)
    RAILS_ENV=acceptance rake db:migrate:resetdb:seed (as compendium user)
    service apache2 start (as root)

molotov.terena.org

acceptance and integration

 

import legacy compendia

Parse legacy HTML pages.

Visit a legacy compendium, go to all the sections and click on edit and save the file to /lib/legacy/<year>/file.html

Also create a folder in /db/legacy/<year>

run: rake legacy:convert:questions_2010 to import the questions to the new compendium.

Import legacy db

Make an .sql dump of the legacy compendium

Locally create a new database and import the legacy data in it (note that you have to run this import as compendium user)

$ psql -h localhost -U compendium postgres

postgres=> create database compendium2010;

$ psql -h localhost -U compendium compendium2010 < compendium2010.sql

(You might want to remove all the GRANT calls from the .sql file first!)

Create a /lib/legacy/2010/schema.rb with the custom table 'translations' and add the new database environment to config/database.yml

Now import the legacy database to the new compendium:

$ rake legacy:convert:answers_2010

This will create /db/legacy/2010/answers.yml

Running the seed

To prevent everything from being seeded, comment out the imports you do NOT want

$ rake db:migrate:reset db:seed

if this fails, you should run them as separate rake tasks: rake db:migrate:reset && rake db:seed

Add a new user

The process is very similar to EventR.

  • Send user to the url: https://compendiumdatabase.geant.org/request_access
  • User has to sign in using federated authentication
  • After sign in, user gets redirected back to the page where they have to select their NREN and enter their email address
  • After successful completion of the form, an email gets sent to: compendium-admin@lists.geant.org
  • Please follow instructions in said email to approve account (You have to a Compendium admin in order to approve other users)
  • On the 'NREN users' page, next to the respective user tick the approve checkbox and hit 'update NREN'
  • User automatically gets a notification email

    To make the user Admin, please follow these instructions:
  • ssh rykov.terena.org (not yet migrated)

sudo su - compendium

cd /pub/www/compendium/

RAILS_ENV=production rails console

User.find_by(tal_id: xxx).update(roles: ["ADMIN", "PANEL"])

  • Inform user that they now have super powers!

  • No labels

2 Comments

  1.     1  sudo -u www-data -i bash
        2  nano ~/.bash_profile
        3  source ~/.bash_profile
        4  nano ~/.bash_profile
        5  source ~/.bash_profile
        6  mv ~/.profile .bashrc
        7  ls
        8  ls -al
        9  mv .profile .bashrc
       10  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       11  sudo -u compendium whoami
       12  rvm info
       13  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       14  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       15  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       16  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       17  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       18  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       19  sudo -u compendium -i bash
       20  sudo -u compendium
       21  bash -i -l
       22  sudo -u compendium bash -i -l
       23  man sudo
       24  sudo -u compendium -i
       25  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       26  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       27  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       28  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       29  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       30  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       31  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       32  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       33  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       34  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       35  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       36  nano /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       37  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       38  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       39  ps xa | grep postgres: | grep compenidum_int | grep -v grep | awk '{print \$1}'
       40  ps xa | grep postgres: | grep compenidum_int | grep -v grep | awk '{print $1}'
       41  sudo -u compendium ps xa | grep postgres: | grep compenidum_int | grep -v grep | awk '{print $1}'
       42  sudo -u compendium ps xa | grep postgres: | grep compenidum_int | grep -v grep | awk '{print $1}' | xargs -r sudo -u postgres kill
       43  sudo -u compendium 'ps xa | grep postgres: | grep compenidum_int | grep -v grep | awk '{print $1}' | xargs -r sudo -u postgres kill'
       44  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       45  pwd
       46  vi /var/lib/gitolite/repositories/compendium-acc.git/hooks/post-receive
       47  vi /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       48  cd /var/lib/gitolite/repositories/compendium-int.git/hooks/
       49  vi post-receive
       50  vi /var/lib/gitolite/.bashrc
       51  source ~/.bashrc
       52  npm -v
       53  echo $NODE_PATH
       54  echo $PATH
       55  cd
       56  mkdir -p ~/local
       57  mkdir -p ~/tmp
       58  cd tmp/
       59  curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
       60  ./configure --prefix=~/local
       61  make install
       62  node -v
       63  cd /var/lib/gitolite/repositories/compendium-int.git/hooks/
       64  ls -al
       65  ./post-receive
       66  vi post-receive
       67  sudo -u compendium bash -l
       68  sudo -u compendium bash -l
       69  sudo -u compendium bash -l
       70  sudo -u compendium bash -i
       71  vi /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       72  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       73  vi /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       74  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       75  vi /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       76  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       77  vi /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       78  /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       79  vi /var/lib/gitolite/repositories/compendium-acc.git/hooks/post-receive
       80  vi /var/lib/gitolite/repositories/compendium-int.git/hooks/post-receive
       81  cd /tmp/
       82  git clone ~/repositories/gitolite-admin.git
       83  cd gitolite-admin/keydir/
       84  vi admin.pub
       85  git commit -am "fixed admin key"
       86  git status
       87  git log
       88  cd ~/.gitolite/
       89  ls
       90  cd src/
       91  ls
       92  ls -al
       93  locate gl-admin-push
       94  cd -
       95  cd /tmp/gitolite-admin/
       96  /usr/share/gitolite/gl-admin-push

  2. How does it work with testing on int/acc if we don't use Jenkins?