Permalink
Browse files

Remove Atmos.

Send both nightly and release builds to CDN.

Change version string to be v100p1-YYYYMMDD.HHMMSS.

Change-Id: I5b57613cef7d6962c896d243821b6227ebd3789a
  • Loading branch information...
1 parent ec55123 commit fab9ee16bcfe60a195174d7576d65779fd14ee5c @mmb mmb committed Oct 5, 2012
Showing with 16 additions and 73 deletions.
  1. +16 −73 build/capfile
View
@@ -1,9 +1,5 @@
-require 'base64'
require 'net/ftp'
-require 'openssl'
-require 'uri'
-require 'atmos'
require 'capistrano_colors'
# Capistrano recipe for building and testing Micro Cloud Foundry from Jenkins.
@@ -19,55 +15,12 @@ require 'capistrano_colors'
# -s normal_user= \
# -s normal_password= \
# -s http_proxy= \
-# -s atmos_url= \
-# -s atmos_uid= \
-# -s atmos_secret= \
# -s cdn_ftp_host= \
# -s cdn_ftp_user= \
# -s cdn_ftp_password=
# ENV['BUILD_SERVER'] and ENV['TEST_SERVER'] must also be set.
-module ShareableUrl
-
- def digest(input)
- OpenSSL::HMAC.digest('sha1', secret_decoded, input)
- end
-
- def secret_decoded
- Base64.strict_decode64 secret
- end
-
- def signature(path, expires)
- input = ['GET', path, uid, expires].join("\n")
-
- Base64.strict_encode64(digest(input))
- end
-
- def shareable_url(path, expires)
- path = "/#{path}" unless path[0] == '/'
- path = "/rest#{path}" unless path[%r{^/rest}]
-
- result = URI(uri.to_s)
- result.path = path
-
- result.query = URI.encode_www_form([
- [:uid, uid],
- [:expires, expires],
- [:signature, signature(path, expires)]
- ])
-
- result.to_s
- end
-
-end
-
-class Atmos::Store
- include ShareableUrl
-end
-
-Atmos::Parser::parser = Atmos::Parser::NOKOGIRI
-
load 'deploy'
role :build, ENV['BUILD_SERVER']
@@ -172,7 +125,6 @@ end
desc 'Describe the latest commit in cf-release on the build machine.'
task :desc_cf_release, :roles => :build do
output = capture('git --git-dir ~/cf-release/.git describe --tags').chomp
- output.gsub! /^v/, 'r'
output.gsub! /-(\d+)-[\da-z]+$/, 'p\\1'
output
end
@@ -206,32 +158,21 @@ task :bvt, :roles => :test do
run "#{sudo} cp #{resolv_conf_backup} /etc/resolv.conf"
end
-desc 'Upload a zip file to Atmos.'
-task :distribute do
- namespace = "nightly/#{zip_name}"
-
- p "sending #{zip_local_path} to Atmos #{namespace}"
+desc 'Distribute a nightly version of the Micro Cloud.'
+task :dist_nightly do
+ p "sending #{zip_local_path} to CDN #{cdn_ftp_host}/micro/nightly"
- store = Atmos::Store.new(
- :url => atmos_url,
- :uid => atmos_uid,
- :secret => atmos_secret)
-
- store.create(
- :mimetype => 'application/zip',
- :data => open(zip_local_path),
- :namespace => namespace
- )
-
- p store.shareable_url("/namespace/#{namespace}", Time.now.to_i + 604800)
+ ftp = Net::FTP.new(cdn_ftp_host, cdn_ftp_user, cdn_ftp_password)
+ p ftp.putbinaryfile(zip_local_path, "micro/nightly/#{zip_name}")
+ ftp.close
end
-desc 'Upload a zip file to the Akamai CDN.'
-task :release do
- p "sending #{zip_local_path} to CDN #{cdn_ftp_host}"
+desc 'Distribute a release version of the Micro Cloud.'
+task :dist_release do
+ p "sending #{zip_local_path} to CDN #{cdn_ftp_host}/micro/release"
ftp = Net::FTP.new(cdn_ftp_host, cdn_ftp_user, cdn_ftp_password)
- p ftp.putbinaryfile(zip_local_path)
+ p ftp.putbinaryfile(zip_local_path, "micro/release/#{zip_name}")
ftp.close
end
@@ -245,7 +186,7 @@ task :build, :roles => :build do
set :build_time, Time.now.strftime('%Y%m%d.%H%M%S')
release_desc = desc_cf_release
- set :version, "1.3_#{release_desc}_#{build_time}"
+ set :version, "#{release_desc}-#{build_time}"
run_commands([
'. ~/.bash_profile',
@@ -268,8 +209,6 @@ task :build, :roles => :build do
run_locally "scp #{zip_path} /tmp"
- distribute
-
puts run_locally "cd /tmp && unzip -o #{zip_name}"
vmx = '/tmp/micro/micro.vmx'
@@ -305,7 +244,11 @@ eos
bvt
- release unless version[/p/]
+ if version[/p/]
+ dist_nigthly
+ else
+ dist_release
+ end
# Archive build?

0 comments on commit fab9ee1

Please sign in to comment.