Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from hardyoyo/DS-1765-add-local-bootstrap-capa…
Browse files Browse the repository at this point in the history
…bility

Ds 1765 add local bootstrap capability
  • Loading branch information
Hardy Pottinger committed Nov 6, 2013
2 parents 52d4b59 + 98692b6 commit 6615b36
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ Vagrant.configure("2") do |config|
config.vm.provision :shell, :inline => "echo 'Saving local git email to VM...' && sudo -i -u vagrant git config --global user.email '#{git_email.chomp}'"
end


if File.exists?("config/local-bootstrap.sh")
config.vm.provision :shell, :path => "config/local-bootstrap.sh"
config.vm.provision :shell, :inline => "echo 'running config/local_bootstrap.sh'"
end

#############################################
# Customized provider settings for VirtualBox
# Many of these settings use VirtualBox's
Expand Down
1 change: 1 addition & 0 deletions config/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ignore any .yaml files except common.yaml
!common.yaml
*.yaml
local-bootstrap.sh
25 changes: 25 additions & 0 deletions config/local-bootstrap.sh.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# local-bootstrap.sh.example is an example of a local bootstrap shell povisioner for Vagrant-DSpace. If you copy this file to local-bootstrap.sh, and modify it to match your needs, it will be run whenever you run vagrant-up.

# local-bootstrap.sh is a hacky little solution to customizing your own DSpace clone from github. You can use it to do such things as set an upstream remote, configure fetching of pull requests from upstream, and much more

# it is also a handy stop-gap measure for providing needed functionality for Vagrant DSpace (such as AIP auto-loading) without having to do a lot of puppet scripting. This works.


# WORD of WARNING: don't forget this script will run as root, so be careful about files you create. Git config lines will need to be run as the vagrant user with sudo -i -u vagrant (example below).

## START OFF BY CUSTOMIZING THE GIT CLONE ##
cd /home/vagrant/dspace-src

# set git to allways rebase when we pull (using sudo to run as the vagrant user, since this script runs as root)
sudo -i -u vagrant git config --global --bool pull.rebase true

# add an upstream remote
git remote add upstream git@github.com:DSpace/DSpace.git

# enable fetching of pull requests from upstream (this may or may not be common practice, but it's handy, why not try it out?)
git config --add remote.upstream.fetch +refs/pull/*/head:refs/remotes/upstream/pr/*

## now add content ##
# not done yet, pitch in if you can, thanks!
25 changes: 25 additions & 0 deletions config/local.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# local.yaml.example, if you'd like to override the settings in common.yaml,
# this is how you do it. Just rename this file to local.yaml and you're in
# business.

# The file local.yaml is in .gitignore, so you won't accidentally commit it.

# First, you're probably going to want to work with your OWN fork of DSpace,
# not the official DSpace repository, so just change the git_repo to match your
# fork. The example below won't work until you edit it.
git_repo : 'git@github.com:yourgithubusername/DSpace.git'
git_branch : 'master'
mvn_params : '-Denv=vagrant'

# This is a hack, we'd like for there to be a better way to determine where the
# ant installer ends up after running mvn package, but, for now, we're hard
# coding it. See DS-1760, and pitch in if you have a solution.
ant_installer_dir : '/home/vagrant/dspace-src/dspace/target/dspace-4.0-rc2-SNAPSHOT-build'

admin_firstname : 'YourFirstName'
admin_lastname : 'YourLastName'
admin_email : 'youremail@your-institution.edu'
admin_passwd : 'changeme'
admin_language : 'en'

0 comments on commit 6615b36

Please sign in to comment.