Permalink
Browse files

Merge pull request #9 from mmb/remove_capistrano

Remove old capistrano build scripts.
  • Loading branch information...
mmb committed Jun 12, 2013
2 parents d3043f1 + f3c02b2 commit b402e7b50e21367343f7cb92ebb7c9134c5e300c
Showing with 0 additions and 412 deletions.
  1. +0 −109 build/build.cap
  2. +0 −303 build/test.cap
View
@@ -1,109 +0,0 @@
-require 'capistrano_colors'
-
-load 'deploy'
-role :build, ENV['BUILD_SERVER']
-set :user, 'pivotal'
-set :ssh_options, {:forward_agent => true}
-set :bundle_install, "(bundle check || bundle install || true)"
-set :default_shell, 'bash -l'
-
-#ssh_options[:keys] = '/var/lib/jenkins/.ssh/id_rsa'
-
-def run_commands(commands)
- run commands.join(' && ')
-end
-
-desc "rsync code to build VM."
-task :rsync_code do
- run_commands([
- 'sudo rm -rf ~pivotal/workspace/bosh/mcf'
- ])
- run_locally "rsync -e ssh -az --delete '#{ENV['WORKSPACE']}/' pivotal@#{ENV['BUILD_SERVER']}:~/workspace/"
-end
-
-desc 'Clean up build debris.'
-task :clean, role: :build do
- # TODO add /tmp
- sudo "rm -rf /var/tmp/bosh/agent-*"
- sudo "rm -rf ~pivotal/workspace/bosh/agent/mcf/*"
-end
-
-desc 'Update the bosh_cli gem.'
-task :update_gems, role: :build do
- run_commands([
- '. "$HOME/.rvm/scripts/rvm"',
- "cd ~/workspace/micro/micro",
- bundle_install,
- 'bundle exec rake assets:precompile',
-
- "cd ~/workspace/bosh/bosh_agent",
- 'gem update bosh_cli',
- bundle_install
- ])
-end
-
-desc 'Install docs'
-task :install_docs, role: :build do
- # Packages all required gems to stage app without internet
- run_commands([
- '. "$HOME/.rvm/scripts/rvm"',
- 'cd ~/workspace/micro/micro',
- 'rm -rf cf-docs',
- 'git clone git://github.com/cloudfoundry/cf-docs.git cf-docs',
- 'cd cf-docs',
- 'bundle package',
- 'cd vendor/cache',
- 'gem fetch bundler -v 1.2.1',
- 'gem fetch cf-runtime -v 0.0.2'
- ])
-end
-
-desc 'Create Micro Cloud Foundry bosh release.'
-task :create_release, role: :build do
- commands = []
- commands << "cd ~/workspace/cf-release"
- if ENV["USE_NG"]
- commands << "cp jobs/micro/monit-ng.yml jobs/micro/monit.yml"
- end
- commands << 'bosh -n create release --force --with-tarball'
- run_commands(commands)
-end
-
-desc 'Build and download the stemcell'
-task :build_stemcell, role: :build do
- build_time = Time.now.strftime('%Y%m%d.%H%M%S')
- version = "v-#{build_time}"
-
- if ENV["USE_NG"]
- manifest = '~/workspace/micro/deploy/manifest-ng.yml'
- else
- manifest = '~/workspace/micro/deploy/manifest.yml'
- end
-
- run_commands([
- '. "$HOME/.rvm/scripts/rvm"',
- "export BUILD_TIME=#{build_time}",
- "export MCF_VERSION=#{version}",
- 'export UBUNTU_ISO=~/ubuntu-10.04.4-server-amd64.iso',
- 'export UBUNTU_MIRROR=http://localhost:9999/ubuntu',
- 'LATEST_RELEASE=`ls -t ~/workspace/cf-release/dev_releases/bosh-release-*-dev.tgz | head -1`',
- 'cd ~/workspace/bosh/bosh_agent',
- "bundle exec rake stemcell:mcf[vsphere,#{manifest},$LATEST_RELEASE]"
- ])
-
- build_host = find_servers_for_task(current_task)[0]
- zip_name = File.basename("/tmp/micro-#{version}.zip")
- zip_path = "pivotal@#{build_host}:~/workspace/bosh/mcf/#{build_time}/#{zip_name}"
- run_locally "scp #{zip_path} '#{ENV['WORKSPACE']}/micro.zip'"
-end
-
-desc 'Build'
-task :build do
- rsync_code
-
- clean
- update_gems
- install_docs
- create_release
- build_stemcell
-end
Oops, something went wrong.

0 comments on commit b402e7b

Please sign in to comment.