-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the drs-sufia-app wiki!
-
Hydra Access Controls -
hydra-access-controls/lib/hydra/datastream
-
Custom Validations. We'll need these for all of our data streams, probably.
-
Creating a noid -
@batch_noid = Sufia::Noid.noidify(Sufia::IdService.mint)
-
Use this to write a basic pre-push hook that will only allow you to push your changes if you've got a fully passing test suite: http://lostechies.com/jasonmeridth/2009/09/10/git-local-pre-commit-hook/ Note that you'll need Git 1.8.2 or later to use this. You may also want to change the last line from 'rake' to 'rake smoke_test', as this will run a considerably snappier custom subset of tests over the items most likely to change. If you fiddle with jobs remember to actually test those changes.
-
There is now a rake task to do a smoke_test and push to github and repositorydev - it is 'rake push_all'
- To use this, you'll want to undo the pre-push hook. The advantage is that you only test once, and if it passes, will it push to github and repositorydev. (Saving time, and safer than 'git push all develop' which pushes regardless of the exit code, due to some quirk I've yet to figure out)
Loading development environment (Rails 3.2.13)
irb(main):001:0> a = Department.new(pid: 'neu:1', identifier: 'neu:1', title: 'Root Department')
=> #<Department pid:"neu:1", nu_title:["Root Department"], nu_description:[""], nu_identifier:["neu:1"], depositor:nil>
irb(main):002:0> a.rightsMetadata.permissions({group: 'public'}, 'read')
=> "read"
irb(main):003:0> a.rightsMetadata.permissions({person: "dev_email_account_here"}, 'edit')
=> "edit"
irb(main):004:0> a.save!
=> true
repositorydev.neu.edu has now been setup so that it contains a remote git location, just like how we use GitHub. This is beneficial for two reasons.
- No more worrying when GitHub goes down.
- It has been setup so that when you push to the server (to which I will refer to colloquially as repdev) it then updates repositorydev.neu.edu. Currently, all it does is cd into the working copy and do a git pull. Any changes that require a restart of the rails server will need to be done manually.
To utilize this, some changes need to made to your local git config.
To add repdev by itself:
git remote add repdev ssh://[email protected]/home/drs/drs.git
To make a new remote called 'all' so as to only run through tests once (saving time) and to keep GitHub and RepDev in sync, add this to .git/config
[remote "all"]
url = [email protected]:nu-lts/drs.git
url = ssh://[email protected]/home/drs/drs.git
An example push after these changes
git push all develop
N.B. You may notice that the url for the repdev git connection is done with ssh. This means you will be prompted to put in the drs user password. This is super easy to fix! This one liner adds your public key to the server.
ssh-copy-id [email protected]