Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Commit

Permalink
correct robot-environment configs and control scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dazza-codes committed Jul 6, 2017
1 parent d213725 commit c51f5b6
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 67 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -16,7 +16,7 @@ See the [Wiki](https://github.com/sul-dlss/robot-master/wiki) for general docume
- config
- certs : authentication certificates for workflow service
- deploy : host-level Capistrano configuration
- environments : configuration for dev,test,prod environments
- environments : configuration for dev,stage,prod environments
- workflows : workflow specific configuration - steps, dependencies. One directory per workflow.
- lib : ruby classes needed for your local robots
- sdrIngest : all of the robots for a particular workflow. One directory per workflow
Expand Down Expand Up @@ -70,9 +70,9 @@ See `bin/cron_jobs.txt` or `ssh` onto a deploy system and run `crontab -e`.
```
```ruby
# modify the defaults, e.g.
#ENV['SDR_HOST'] ||= 'sdr-staging1'
#ENV['SDR_HOST'] ||= 'sdr-stage1'
#ENV['SDR_USER'] ||= 'sdr_user'
#ENV['ROBOT_ENVIRONMENT'] = 'staging'
#ENV['ROBOT_ENVIRONMENT'] = 'stage'
# Note that the value of ROBOT_ENVIRONMENT entails the existence of two config files:
# config/environments/${ROBOT_ENVIRONMENT}.rb
# config/environments/robots_${ROBOT_ENVIRONMENT}.yml
Expand Down
6 changes: 3 additions & 3 deletions bin/environment.rb
Expand Up @@ -18,9 +18,9 @@
case `hostname -s`.chomp
when "sdr-services", "sul-sdr-services"
'production'
when "sdr-services-test"
'staging'
when "sul-sdr-services-dev"
when /sdr-services-test/
'stage'
when /sdr-services-dev/
'integration'
else
'development'
Expand Down
46 changes: 46 additions & 0 deletions bin/sdr-preservation-core_ctl.sh
@@ -0,0 +1,46 @@
#!/bin/bash

# The ROBOT_ENVIRONMENT values here should match the config/environment/* files in the shared configs at
# https://github.com/sul-dlss/shared_configs/tree/sdr-preservation-core_{stage} where
# {stage} is a capistrano stage, like 'dev|stage|prod'.

if hostname | egrep -q 'sdr-services-dev'; then
export ROBOT_ENVIRONMENT='integration'
fi

if hostname | egrep -q 'sdr-services-test'; then
export ROBOT_ENVIRONMENT='stage'
fi

if hostname | egrep -q 'sul-sdr-services.stanford.edu'; then
export ROBOT_ENVIRONMENT='production'
fi

echo "Using ROBOT_ENVIRONMENT=$ROBOT_ENVIRONMENT"

cd ~/sdr-preservation-core/current

case "$1" in
start)
bundle exec controller boot
;;

stop)
bundle exec controller stop
bundle exec controller quit
;;

status)
bundle exec controller status
;;

restart)
bundle exec controller stop
bundle exec controller quit
bundle exec controller boot
;;

*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
21 changes: 0 additions & 21 deletions bin/sdr-preservation-core_restart.sh

This file was deleted.

19 changes: 0 additions & 19 deletions bin/sdr-preservation-core_status.sh

This file was deleted.

20 changes: 0 additions & 20 deletions bin/sdr-preservation-core_stop.sh

This file was deleted.

2 changes: 1 addition & 1 deletion config/deploy/stage.rb
Expand Up @@ -4,7 +4,7 @@
# ROBOT_ENVIRONMENT implies remote :deploy_to contains
# config/environments/#{ROBOT_ENVIRONMENT}.rb
# config/environments/robots_#{ROBOT_ENVIRONMENT}.rb
'ROBOT_ENVIRONMENT' => 'test'
'ROBOT_ENVIRONMENT' => 'stage'
}

server 'sdr-services-test.stanford.edu', user: 'sdr2service', roles: %w{app}
Expand Down

0 comments on commit c51f5b6

Please sign in to comment.