Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Migrate Ruby cache dirs
Browse files Browse the repository at this point in the history
- Consolidate blessed_gems to one dir

- Cache gems by specific version number to support
multiple Ruby 1.8 and 1.9 versions

- Bump stager
git shortlog 5ddfddd..73c5d919
Jennifer Hickey and Matthew Kocher (1):
      Bump vcap-staging

Change-Id: I4859d5ccd26c9455fcda6d1059412b7d37d9ff25
  • Loading branch information
Jennifer Hickey committed Nov 26, 2012
1 parent cbc7e98 commit 7cf5897
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion jobs/stager/templates/stager_ctl
Expand Up @@ -60,8 +60,35 @@ case $1 in
/var/vcap/packages/syslog_aggregator/setup_syslog_forwarder.sh $JOB_DIR/config
<% end %>

# Migrate blessed gems to their new home
mkdir -p $GEM_CACHE_DIR/blessed_gems
if [ -d $GEM_CACHE_DIR/1.8/blessed_gems ]; then
mv -n $GEM_CACHE_DIR/1.8/blessed_gems/* $GEM_CACHE_DIR/blessed_gems
fi
if [ -d $GEM_CACHE_DIR/1.9.1/blessed_gems ]; then
mv -n $GEM_CACHE_DIR/1.9.1/blessed_gems/* $GEM_CACHE_DIR/blessed_gems
fi
rm -rf $GEM_CACHE_DIR/1.8/blessed_gems
rm -rf $GEM_CACHE_DIR/1.9.1/blessed_gems

# Migrate cached gems to their new home
mkdir -p $GEM_CACHE_DIR/1.8.7p357
if [ -d $GEM_CACHE_DIR/1.8 ]; then
mv -n $GEM_CACHE_DIR/1.8/* $GEM_CACHE_DIR/1.8.7p357
fi
mkdir -p $GEM_CACHE_DIR/1.9.2p180
if [ -d $GEM_CACHE_DIR/1.9.1 ]; then
mv -n $GEM_CACHE_DIR/1.9.1/* $GEM_CACHE_DIR/1.9.2p180
fi
rm -rf $GEM_CACHE_DIR/1.8
rm -rf $GEM_CACHE_DIR/1.9.1

# Seed the staging cache
cp -an /var/vcap/packages/dea_seed/gem_cache/* $GEM_CACHE_DIR
# TODO make dea_seed use a single blessed_gems dir and correct version numbers for easier copy
cp -an /var/vcap/packages/dea_seed/gem_cache/1.8/gem_cache/* $GEM_CACHE_DIR/1.8.7p357/gem_cache
cp -an /var/vcap/packages/dea_seed/gem_cache/1.9.1/gem_cache/* $GEM_CACHE_DIR/1.9.2p180/gem_cache
cp -an /var/vcap/packages/dea_seed/gem_cache/1.9.1/blessed_gems/* $GEM_CACHE_DIR/blessed_gems

chown -R vcap:vcap $GEM_CACHE_DIR

/var/vcap/packages/ruby/bin/ruby /var/vcap/packages/stager/bin/create_secure_users.rb
Expand Down
2 changes: 1 addition & 1 deletion src/stager

0 comments on commit 7cf5897

Please sign in to comment.