Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'benchmark'
- require 'git'
- module DeployToServers
- def get_data_center_list
- Git.clone('git@github.csc.zw.corp:ncux/instances.git', 'data-centers.git')
- server_list_final = []
- Dir.chdir("data-centers.git") do |dir|
- # search for files with rb extension and save in array
- server_list = Dir.glob("app*.rb").map do |file|
- #remove extension from name
- file.sub(/.rb/, '')
- end
- server_list = server_list.select { |n| n.length < 7 && n.count("0-9") > 0 }
- server_list_final = server_list
- end
- server_list_final.map { |n| ':' + n }
- end
- PROD_SERVERS = get_data_center_list # how do I get this to work?
- ######################################################
- # bucnh of other code in this module...
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement