diff options
| author | Florent Peyraud | 2017-07-06 12:41:19 +0200 | 
|---|---|---|
| committer | Florent Peyraud | 2017-07-06 12:41:19 +0200 | 
| commit | 3c39ff76da22a410f1c81acabad626f15a63d800 (patch) | |
| tree | 3469c3198920ee0c0245b330afe1f7f8c2f8278c /install/deploy-helper.sh | |
| parent | baaab5943d7102a7f86c000b84644d2fdbabdac7 (diff) | |
| download | chouette-core-3c39ff76da22a410f1c81acabad626f15a63d800.tar.bz2 | |
Update install scripts to cope with the two roles front and worker
Diffstat (limited to 'install/deploy-helper.sh')
| -rwxr-xr-x | install/deploy-helper.sh | 22 | 
1 files changed, 21 insertions, 1 deletions
| diff --git a/install/deploy-helper.sh b/install/deploy-helper.sh index 487c4539c..5fa8efb9e 100755 --- a/install/deploy-helper.sh +++ b/install/deploy-helper.sh @@ -16,6 +16,8 @@ function setup() {      mkdir -p $BASEDIR/shared/config/environments +    mkdir -p $BASEDIR/shared/config/initializers +      mkdir -p $BASEDIR/shared/public      mkdir -p $BASEDIR/shared/public/uploads      mkdir -p $BASEDIR/shared/public/assets @@ -54,6 +56,24 @@ production:    password: $DATABASE_PASSWORD  EOF      fi + + +    if [ ! -f initializers/sidekiq.rb ]; then +        cat > initializers/sidekiq.rb <<EOF +Sidekiq.configure_server do |config| +  pendings = [ +    LineReferential.find_by(name: 'CodifLigne').line_referential_syncs.pending.take, +    StopAreaReferential.find_by(name: 'Reflex').stop_area_referential_syncs.pending.take +  ] +  pendings.compact.map{|sync| sync.failed({error: 'Failed by Sidekiq reboot', processing_time: 0})} +  config.redis = { url: '$SIDEKIQ_REDIS_URL' } +end + +Sidekiq.configure_client do |config| +  config.redis = { url: '$SIDEKIQ_REDIS_URL' } +end +EOF +    fi  }  function install() { @@ -85,7 +105,7 @@ function install() {          ln -s $local_directory $release_directory      done -    for file in secrets.yml database.yml environments/production.rb; do +    for file in secrets.yml database.yml environments/production.rb initializers/sidekiq.rb; do          local_file=$BASEDIR/shared/config/$file          release_file=config/$file | 
