Rakefile 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. #
  2. # Copyright (c) 2008-2014 the Urho3D project.
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining a copy
  5. # of this software and associated documentation files (the "Software"), to deal
  6. # in the Software without restriction, including without limitation the rights
  7. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. # copies of the Software, and to permit persons to whom the Software is
  9. # furnished to do so, subject to the following conditions:
  10. #
  11. # The above copyright notice and this permission notice shall be included in
  12. # all copies or substantial portions of the Software.
  13. #
  14. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. # THE SOFTWARE.
  21. #
  22. require 'pathname'
  23. if ENV['XCODE']
  24. require 'xcodeproj'
  25. end
  26. # Usage: rake sync (only intended to be used in a fork with remote 'upstream' set to urho3d/Urho3D)
  27. desc 'Fetch and merge upstream urho3d/Urho3D to a Urho3D fork'
  28. task :sync do
  29. system "cwb=`git symbolic-ref -q --short HEAD || git rev-parse --short HEAD`; export cwb && git fetch upstream && git checkout master && git pull && git merge -m 'Sync at #{Time.now.localtime}.' upstream/master && git push && git checkout $cwb"
  30. end
  31. # Usage: rake scaffolding dir=/path/to/new/project/root
  32. desc 'Create a new project using Urho3D as external library'
  33. task :scaffolding do
  34. abort 'Usage: rake scaffolding dir=/path/to/new/project/root' unless ENV['dir']
  35. abs_path = ENV['dir'][0, 1] == '/' ? ENV['dir'] : "#{Dir.pwd}/#{ENV['dir']}"
  36. scaffolding abs_path
  37. abs_path = Pathname.new(abs_path).realpath
  38. puts "\nNew project created in #{abs_path}\n\n"
  39. puts "To build the new project, you may need to first define and export either 'URHO3D_HOME' or 'URHO3D_INSTALL_PREFIX' environment variable"
  40. puts "Please see http://urho3d.github.io/documentation/a00004.html for more detail. For example:\n\n"
  41. puts "$ URHO3D_HOME=#{Dir.pwd}; export URHO3D_HOME\n$ cd #{abs_path}\n$ ./cmake_gcc.sh -DENABLE_64BIT=1 -DENABLE_LUAJIT=1\n$ cd Build\n$ make\n\n"
  42. end
  43. # Usage: NOT intended to be used manually (if you insist then try: rake travis_ci)
  44. desc 'Configure, build, and test Urho3D project'
  45. task :travis_ci do
  46. if ENV['PACKAGE_UPLOAD']
  47. $configuration = 'Release'
  48. $testing = 0
  49. else
  50. $configuration = 'Debug'
  51. $testing = 1
  52. end
  53. if ENV['XCODE']
  54. # xctool or xcodebuild
  55. xcode_travis_ci
  56. else
  57. # GCC or Clang
  58. makefile_travis_ci
  59. end
  60. end
  61. # Usage: NOT intended to be used manually (if you insist then try: GIT_NAME=... GIT_EMAIL=... GH_TOKEN=... rake travis_ci_site_update)
  62. desc 'Update site documentation to GitHub Pages'
  63. task :travis_ci_site_update do
  64. # Pull or clone
  65. system 'cd doc-Build 2>/dev/null && git pull -q -r || git clone --depth=1 -q https://github.com/urho3d/urho3d.github.io.git doc-Build' or abort 'Failed to pull/clone'
  66. # Update credits from Readme.txt to about.md
  67. system "ruby -lne 'BEGIN { credits = false }; puts $_ if credits; credits = true if /bugfixes by:/; credits = false if /^$/' Readme.txt |ruby -i -le 'credits = STDIN.read; puts ARGF.read.gsub(/(?<=bugfixes by\n).*?(?=##)/m, credits)' doc-Build/about.md" or abort 'Failed to update credits'
  68. # Setup doxygen to use minimal theme
  69. system "ruby -i -pe 'BEGIN { a = {%q{HTML_HEADER} => %q{minimal-header.html}, %q{HTML_FOOTER} => %q{minimal-footer.html}, %q{HTML_STYLESHEET} => %q{minimal-doxygen.css}, %q{HTML_COLORSTYLE_HUE} => 200, %q{HTML_COLORSTYLE_SAT} => 0, %q{HTML_COLORSTYLE_GAMMA} => 20, %q{DOT_IMAGE_FORMAT} => %q{svg}, %q{INTERACTIVE_SVG} => %q{YES}} }; a.each {|k, v| gsub(/\#{k}\s*?=.*?\n/, %Q{\#{k} = \#{v}\n}) }' Docs/Doxyfile" or abort 'Failed to setup doxygen configuration file'
  70. system 'cp doc-Build/_includes/Doxygen/minimal-* Docs' or abort 'Failed to copy minimal-themed template'
  71. # Generate and sync doxygen pages
  72. system 'cd Build && make doc >/dev/null 2>&1 && rsync -a --delete ../Docs/html/ ../doc-Build/documentation' or abort 'Failed to generate/rsync doxygen pages'
  73. # Supply GIT credentials and push site documentation to urho3d/urho3d.github.io.git
  74. system "cd doc-Build && pwd && git config user.name '#{ENV['GIT_NAME']}' && git config user.email '#{ENV['GIT_EMAIL']}' && git remote set-url --push origin https://#{ENV['GH_TOKEN']}@github.com/urho3d/urho3d.github.io.git && git add -A . && ( git commit -q -m \"Travis CI: site documentation update at #{Time.now.utc}.\n\nCommit: https://github.com/urho3d/Urho3D/commit/$TRAVIS_COMMIT\n\nMessage: $COMMIT_MESSAGE\" || true) && git push -q >/dev/null 2>&1" or abort 'Failed to update site'
  75. # Automatically give instruction to do packaging when API has changed, unless the instruction is already given in this commit
  76. if ENV['PACKAGE_UPLOAD']
  77. instruction = 'skip'
  78. else
  79. instruction = 'package'
  80. end
  81. # Supply GIT credentials and push API documentation to urho3d/Urho3D.git (the push may not be successful if detached HEAD is not a fast forward of remote master)
  82. system "pwd && git config user.name '#{ENV['GIT_NAME']}' && git config user.email '#{ENV['GIT_EMAIL']}' && git remote set-url --push origin https://#{ENV['GH_TOKEN']}@github.com/urho3d/Urho3D.git && git add Docs/*API* && ( git commit -q -m 'Travis CI: API documentation update at #{Time.now.utc}.\n[ci #{instruction}]' || true ) && git push origin HEAD:master -q >/dev/null 2>&1" or abort 'Failed to update API documentation, most likely due to remote master has diverged, the API documentation update will be performed again in the subsequent CI build'
  83. end
  84. # Usage: NOT intended to be used manually (if you insist then try: GIT_NAME=... GIT_EMAIL=... GH_TOKEN=... rake travis_ci_rebase)
  85. desc 'Rebase OSX-CI mirror branch'
  86. task :travis_ci_rebase do
  87. system "git config user.name '#{ENV['GIT_NAME']}' && git config user.email '#{ENV['GIT_EMAIL']}' && git remote set-url --push origin https://#{ENV['GH_TOKEN']}@github.com/#{ENV['TRAVIS_REPO_SLUG']}.git && git fetch origin OSX-CI:OSX-CI && git rebase origin/master OSX-CI && git push -qf -u origin OSX-CI >/dev/null 2>&1" or abort 'Failed to rebase OSX-CI mirror branch'
  88. end
  89. # Usage: NOT intended to be used manually (if you insist then try: rake travis_ci_package_upload)
  90. desc 'Make binary package and upload it to a designated central hosting server'
  91. task :travis_ci_package_upload do
  92. if ENV['XCODE']
  93. $configuration = 'Release'
  94. $testing = 0
  95. end
  96. if ENV['ANDROID']
  97. platform_prefix = 'android-'
  98. elsif ENV['WINDOWS']
  99. platform_prefix = 'mingw-'
  100. elsif ENV['IOS']
  101. platform_prefix = 'ios-'
  102. else
  103. platform_prefix = ''
  104. end
  105. # Generate the documentation if necessary
  106. unless ENV['SITE_UPDATE']
  107. system 'echo Generate documentation'
  108. if ENV['XCODE']
  109. xcode_build(ENV['IOS'], "#{platform_prefix}Build/Urho3D.xcodeproj", 'doc', false, '>/dev/null') or abort 'Failed to generate documentation'
  110. else
  111. system "cd #{platform_prefix}Build && make doc >/dev/null" or abort 'Failed to generate documentation'
  112. end
  113. end
  114. # Make the package
  115. if ENV['IOS']
  116. # Build Mach-O universal binary consisting of iphoneos (universal ARM archs including 'arm64' if 64-bit is enabled) and iphonesimulator (i386 arch and also x86_64 arch if 64-bit is enabled)
  117. system 'echo Rebuild Urho3D library as Mach-O universal binary'
  118. xcode_build(0, "#{platform_prefix}Build/Urho3D.xcodeproj", 'Urho3D_universal', false) or abort 'Failed to build Mach-O universal binary'
  119. # There is a bug in CMake/CPack that causes the 'package' scheme failed to build for IOS platform, workaround by calling cpack directly
  120. system "cd #{platform_prefix}Build && cpack -G TGZ 2>/dev/null" or abort 'Failed to make binary package'
  121. elsif ENV['XCODE']
  122. xcode_build(ENV['IOS'], "#{platform_prefix}Build/Urho3D.xcodeproj", 'package', false) or abort 'Failed to make binary package'
  123. else
  124. system "cd #{platform_prefix}Build && make package" or abort 'Failed to make binary package'
  125. end
  126. # Determine the upload location
  127. setup_digital_keys
  128. if ENV['RELEASE_TAG'].empty?
  129. upload_dir = '/home/frs/project/urho3d/Urho3D/Snapshots'
  130. # Only keep the snapshots from the last +/- 30 revisions
  131. if ENV['SITE_UPDATE']
  132. # The package revisions and their creation time may not always be in perfect chronological order due to Travis-CI build latency, so sort the final result one more time in order to get a unique revision removal list
  133. system "for v in $(sftp [email protected] <<EOF |tr ' ' '\n' |grep Urho3D- |cut -d '-' -f1,2 |uniq |tail -n +31 |sort |uniq
  134. cd #{upload_dir}
  135. ls -1t
  136. bye
  137. EOF
  138. ); do echo rm #{upload_dir}/${v}*; done |sftp -b - [email protected]" or abort 'Failed to housekeep snapshots'
  139. end
  140. else
  141. upload_dir = "/home/frs/project/urho3d/Urho3D/#{ENV['RELEASE_TAG']}"
  142. # Make sure the release directory exists remotely
  143. system "sftp [email protected] <<EOF >/dev/null 2>&1
  144. mkdir #{upload_dir}
  145. bye
  146. EOF" or abort 'Failed to create release directory remotely'
  147. end
  148. # Upload the package
  149. system "scp #{platform_prefix}Build/Urho3D-* [email protected]:#{upload_dir}" or abort 'Failed to upload binary package'
  150. # Sync readme and license files, just in case they are updated in the repo
  151. if ENV['SITE_UPDATE']
  152. system 'for f in Readme.txt License.txt; do mtime=$(git log --format=%ai -n1 $f); touch -d "$mtime" $f; done' or abort 'Failed to acquire file modified time'
  153. system 'rsync -e ssh -az Readme.txt License.txt [email protected]:/home/frs/project/urho3d/Urho3D' or abort 'Failed to sync readme and license files'
  154. end
  155. end
  156. def scaffolding(dir)
  157. system "bash -c \"mkdir -p #{dir}/{Source,Bin} && cp Source/Tools/Urho3DPlayer/Urho3DPlayer.* #{dir}/Source && for f in {.,}*.sh; do ln -sf `pwd`/\\$f #{dir}; done && ln -sf `pwd`/Bin/{Core,}Data #{dir}/Bin\" && cat <<EOF >#{dir}/Source/CMakeLists.txt
  158. # Set project name
  159. project (Scaffolding)
  160. # Set minimum version
  161. cmake_minimum_required (VERSION 2.8.6)
  162. if (COMMAND cmake_policy)
  163. cmake_policy (SET CMP0003 NEW)
  164. endif ()
  165. # Set CMake modules search path
  166. set (CMAKE_MODULE_PATH
  167. \\$ENV{URHO3D_HOME}/Source/CMake/Modules
  168. \\$ENV{URHO3D_INSTALL_PREFIX}/share/Urho3D/CMake/Modules
  169. \\${CMAKE_INSTALL_PREFIX}/share/Urho3D/CMake/Modules
  170. CACHE PATH \"Path to Urho3D-specific CMake modules\")
  171. # Include Urho3D Cmake common module
  172. include (Urho3D-CMake-common)
  173. # Find Urho3D library
  174. find_package (Urho3D REQUIRED)
  175. include_directories (\\${URHO3D_INCLUDE_DIRS})
  176. # Define target name
  177. set (TARGET_NAME Main)
  178. # Define source files
  179. define_source_files ()
  180. # Setup target with resource copying
  181. setup_main_executable ()
  182. # Setup test cases
  183. add_test (NAME ExternalLibAS COMMAND \\${TARGET_NAME} Data/Scripts/12_PhysicsStressTest.as -w -timeout \\${TEST_TIME_OUT})
  184. add_test (NAME ExternalLibLua COMMAND \\${TARGET_NAME} Data/LuaScripts/12_PhysicsStressTest.lua -w -timeout \\${TEST_TIME_OUT})
  185. EOF" or abort 'Failed to create new project using Urho3D as external library'
  186. end
  187. def makefile_travis_ci
  188. if ENV['WINDOWS']
  189. # LuaJIT on MinGW build is not possible on Ubuntu 12.04 LTS as its GCC cross-compiler version is too old. Fallback to use Lua library instead.
  190. jit = ''
  191. amalg = ''
  192. # Lua on MinGW build requires tolua++ tool to be built natively first
  193. system 'MINGW_PREFIX= ./cmake_gcc.sh -DURHO3D_LIB_TYPE=$URHO3D_LIB_TYPE -DENABLE_64BIT=$ENABLE_64BIT -DENABLE_LUA=1 -DENABLE_TOOLS=0' or abort 'Failed to configure native build for tolua++ target'
  194. system 'cd Build/ThirdParty/toluapp/src/bin && make' or abort 'Failed to build tolua++ tool'
  195. ENV['SKIP_NATIVE'] = '1'
  196. else
  197. jit = 'JIT'
  198. amalg = '-DENABLE_LUAJIT_AMALG=1'
  199. end
  200. system "./cmake_gcc.sh -DURHO3D_LIB_TYPE=$URHO3D_LIB_TYPE -DENABLE_64BIT=$ENABLE_64BIT -DENABLE_LUA#{jit}=1 #{amalg} -DENABLE_SAMPLES=1 -DENABLE_TOOLS=1 -DENABLE_EXTRAS=1 -DENABLE_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration}" or abort 'Failed to configure Urho3D library build'
  201. if ENV['ANDROID']
  202. # LuaJIT on Android build requires tolua++ and buildvm-android tools to be built natively first
  203. system 'cd Build/ThirdParty/toluapp/src/bin && make' or abort 'Failed to build tolua++ tool'
  204. system 'cd Build/ThirdParty/LuaJIT/generated/buildvm-android && make' or abort 'Failed to build buildvm-android tool'
  205. # Reconfigure Android build one more time now that we have the tools built
  206. ENV['SKIP_NATIVE'] = '1'
  207. system './cmake_gcc.sh' or abort 'Failed to reconfigure Urho3D library for Android build'
  208. platform_prefix = 'android-'
  209. elsif ENV['WINDOWS']
  210. platform_prefix = 'mingw-'
  211. else
  212. platform_prefix = ''
  213. end
  214. # Only 64-bit Linux environment with virtual framebuffer X server support and not MinGW build; or OSX build environment are capable to run tests
  215. if $testing == 1 and (ENV['ENABLE_64BIT'] and ENV['WINDOWS'].to_i != 1 or ENV['OSX'])
  216. test = '&& make test'
  217. else
  218. test = ''
  219. end
  220. system "cd #{platform_prefix}Build && make #{test}" or abort 'Failed to build or test Urho3D library'
  221. # Create a new project on the fly that uses newly built Urho3D library
  222. scaffolding "#{platform_prefix}Build/generated/externallib"
  223. system "URHO3D_HOME=`pwd`; export URHO3D_HOME && cd #{platform_prefix}Build/generated/externallib && echo '\nUsing Urho3D as external library in external project' && ./cmake_gcc.sh -DENABLE_64BIT=$ENABLE_64BIT -DENABLE_LUA#{jit}=1 -DENABLE_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration} && cd #{platform_prefix}Build && make #{test}" or abort 'Failed to configure/build/test temporary project using Urho3D as external library'
  224. end
  225. def xcode_travis_ci
  226. if ENV['IOS']
  227. # IOS platform does not support LuaJIT
  228. jit = ''
  229. amalg = ''
  230. platform_prefix = 'ios-'
  231. # Lua on IOS build requires tolua++ tool to be built natively first
  232. system "./cmake_macosx.sh -DURHO3D_LIB_TYPE=$URHO3D_LIB_TYPE -DENABLE_64BIT=$ENABLE_64BIT -DENABLE_LUA=1 -DENABLE_TOOLS=0" or abort 'Failed to configure native build for tolua++ target'
  233. xcode_build(0, 'Build/Urho3D.xcodeproj', 'tolua++') or abort 'Failed to build tolua++ tool'
  234. else
  235. jit = 'JIT'
  236. amalg = '-DENABLE_LUAJIT_AMALG=1'
  237. platform_prefix = ''
  238. end
  239. system "./cmake_macosx.sh -DIOS=$IOS -DURHO3D_LIB_TYPE=$URHO3D_LIB_TYPE -DENABLE_64BIT=$ENABLE_64BIT -DENABLE_LUA#{jit}=1 #{amalg} -DENABLE_SAMPLES=1 -DENABLE_TOOLS=1 -DENABLE_EXTRAS=1 -DENABLE_TESTING=#{$testing}" or abort 'Failed to configure Urho3D library build'
  240. xcode_build(ENV['IOS'], "#{platform_prefix}Build/Urho3D.xcodeproj") or abort 'Failed to build or test Urho3D library'
  241. # Create a new project on the fly that uses newly built Urho3D library
  242. scaffolding "#{platform_prefix}Build/generated/externallib"
  243. system "URHO3D_HOME=`pwd`; export URHO3D_HOME && cd #{platform_prefix}Build/generated/externallib && echo '\nUsing Urho3D as external library in external project' && ./cmake_macosx.sh -DIOS=$IOS -DENABLE_64BIT=$ENABLE_64BIT -DENABLE_LUA#{jit}=1 -DENABLE_TESTING=#{$testing}" or abort 'Failed to configure temporary project using Urho3D as external library'
  244. xcode_build(ENV['IOS'], "#{platform_prefix}Build/generated/externallib/#{platform_prefix}Build/Scaffolding.xcodeproj") or abort 'Failed to configure/build/test temporary project using Urho3D as external library'
  245. end
  246. def xcode_build(ios, project, scheme = 'ALL_BUILD', autosave = true, extras = '')
  247. if autosave
  248. # Save auto-created schemes from Xcode project file
  249. system "ruby -i -pe 'gsub(/refType = 0; /, %q{})' #{project}/project.pbxproj" or 'Failed to remove legacy refType attributes from the generated Xcode project file'
  250. system "ruby -i -e 'puts ARGF.read.gsub(/buildSettings = \\{\n\s*?\\};\n\s*?buildStyles = \(.*?\);/m, %q{})' #{project}/project.pbxproj" or 'Failed to remove unsupported PBXProject attributes from the generated Xcode project file'
  251. xcproj = Xcodeproj::Project.open(project)
  252. xcproj.recreate_user_schemes
  253. xcproj.save # There is a bug in this gem, it does not appear to exit with proper exit status (assume always success for now)
  254. end
  255. sdk = ios.to_i == 1 ? '-sdk iphonesimulator' : ''
  256. # Use xctool when building as its output is nicer
  257. system "xctool -project #{project} -scheme #{scheme} -configuration #{$configuration} #{sdk} #{extras}" or return 1
  258. if $testing == 1 and ios.to_i != 1 and scheme == 'ALL_BUILD' # Disable testing for IOS as we don't have unit tests for IOS platform yet
  259. # Use xcodebuild when testing as its output is instantaneous (ensure Travis-CI does not kill the process during testing)
  260. system "xcodebuild -project #{project} -scheme RUN_TESTS -configuration #{$configuration} #{sdk} #{extras}" or return 1
  261. end
  262. return 0
  263. end
  264. def setup_digital_keys
  265. system 'mkdir -p ~/.ssh && chmod 700 ~/.ssh' or abort 'Failed to create ~/.ssh directory'
  266. system "cat <<EOF >>~/.ssh/known_hosts
  267. frs.sourceforge.net,216.34.181.57 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2uifHZbNexw6cXbyg1JnzDitL5VhYs0E65Hk/tLAPmcmm5GuiGeUoI/B0eUSNFsbqzwgwrttjnzKMKiGLN5CWVmlN1IXGGAfLYsQwK6wAu7kYFzkqP4jcwc5Jr9UPRpJdYIK733tSEmzab4qc5Oq8izKQKIaxXNe7FgmL15HjSpatFt9w/ot/CHS78FUAr3j3RwekHCm/jhPeqhlMAgC+jUgNJbFt3DlhDaRMa0NYamVzmX8D47rtmBbEDU3ld6AezWBPUR5Lh7ODOwlfVI58NAf/aYNlmvl2TZiauBCTa7OPYSyXJnIPbQXg6YQlDknNCr0K769EjeIlAfY87Z4tw==
  268. EOF" or abort 'Failed to append frs.sourceforge.net server public key to known_hosts'
  269. # Workaround travis encryption key size limitation. Rather than using the solution in their FAQ (using AES to encrypt/decrypt the file and check in the encrypted file into repo), our solution is more pragmatic. The private key below is incomplete. Only the missing portion is encrypted. Much less secure than the original 2048-bit RSA has to offer but good enough for our case.
  270. system "cat <<EOF >~/.ssh/id_rsa
  271. -----BEGIN RSA PRIVATE KEY-----
  272. MIIEpQIBAAKCAQEAnZGzFEypdXKY3KDT0Q3NLY4Bv74yKgJ4LIgbXothx8w4CfM0
  273. VeWBL/AE2iRISEWGB07LruM9y+U/wt58WlCVu001GuJuvXwWenlljsvH8qQlErYi
  274. oXlCwAeVVeanILGL8CPS7QlyzOwwnVF6NdcmfDJjTthBVFbvHrWGo5if86zcZyMR
  275. 2BB5QVEr5fU0yOPFp0+2p7J3cA6HQSKwjUiDtJ+lM62UQp7InCCT3qeh5KYHQcYb
  276. KVJTyj5iycVuBujHDwNAivLq82ojG7LcKjP+Ia8fblardCOQyFk6pSDM79NJJ2Dg
  277. 3ZbYIJeUmqSqFhRW/13Bro7Z1aNGrdh/XZkkHwIDAQABAoIBACHcBFJxYtzVIloO
  278. yVWcFKIcaO3OLjNu0monWVJIu1tW3BfvRijLJ6aoejJyJ4I4RmPdn9FWDZp6CeiT
  279. LL+vn21fWvELBWb8ekwZOCSmT7IpaboKn4h5aUmgl4udA/73iC2zVQkQxbWZb5zu
  280. vEdDk4aOwV5ZBDjecYX01hjjnEOdZHGJlF/H/Xs0hYX6WDG3/r9QCJJ0nfd1/Fk2
  281. zdbZRtAbyRz6ZHiYKnFQ441qRRaEbzunkvTBEwu9iqzlE0s/g49LJL0mKEp7rt/J
  282. 4iS3LZTQbJNx5J0ti8ZJKHhvoWb5RJxNimwKvVHC0XBZKTiLMrhnADmcpjLz53F8
  283. $SF_KEY
  284. sx27yCaeBeKXV0tFOeZmgK664VM9EgesjIX4sVOJ5mA3xBJBOtz9n66LjoIlIM58
  285. dvsAnJt7MUBdclL/RBHEjbUxgGBDcazfWSuJe0sGczhnXMN94ox4MSECgYEAx5cv
  286. cs/2KurjtWPanDGSz71LyGNdL/xQrAud0gi49H0tyYr0XmzNoe2CbZ/T5xGSZB92
  287. PBcz4rnHQ/oujo/qwjNpDD0xVLEU70Uy/XiY5/v2111TFC4clfE/syZPywKAztt3
  288. y2l5z+QdsNigRPDhKw+7CFYaAnYBEISxR6nabT8CgYEAqHrM8fdn2wsCNE6XvkZQ
  289. O7ZANHNIKVnaRqW/8HW7EFAWQrlQTgzFbtR4uNBIqAtPsvwSx8Pk652+OR1VKfSv
  290. ya3dtqY3rY/ErXWyX0nfPQEbYj/oh8LbS6zPw75yIorP3ACIwMw3GRNWIvkdAGTn
  291. BMUgpWHUDLWWpWRrSzNi90ECgYEAkxxzQ6vW5OFGv17/NdswO+BpqCTc/c5646SY
  292. ScRWFxbhFclOvv5xPqYiWYzRkmIYRaYO7tGnU7jdD9SqVjfrsAJWrke4QZVYOdgG
  293. cl9eTLchxLGr15b5SOeNrQ1TCO4qZM3M6Wgv+bRI0h2JW+c0ABpTIBzehOvXcwZq
  294. 6MhgD98CgYEAtOPqc4aoIRUy+1oijpWs+wU7vAc8fe4sBHv5fsv7naHuPqZgyQYY
  295. 32a54xZxlsBw8T5P4BDy40OR7fu+6miUfL+WxUdII4fD3grlIPw6bpNE0bCDykv5
  296. RLq28S11hDrKf/ZetXNuIprfTlhl6ISBy+oWQibhXmFZSxEiXNV6hCQ=
  297. -----END RSA PRIVATE KEY-----
  298. EOF" or abort 'Failed to create user private key to id_rsa'
  299. system 'chmod 600 ~/.ssh/id_rsa' or abort 'Failed to change id_rsa file permission'
  300. end