Commit 3fb185fb by Calen Pennington

Merge branch 'master' into anonymous_user

Conflicts:
	rakefile
parents 4ff31d1b 9c42c904
...@@ -11,7 +11,7 @@ PACKAGE_NAME = "mitx" ...@@ -11,7 +11,7 @@ PACKAGE_NAME = "mitx"
LINK_PATH = "/opt/wwc/mitx" LINK_PATH = "/opt/wwc/mitx"
VERSION = "0.1" VERSION = "0.1"
COMMIT = (ENV["GIT_COMMIT"] || `git rev-parse HEAD`).chomp()[0, 10] COMMIT = (ENV["GIT_COMMIT"] || `git rev-parse HEAD`).chomp()[0, 10]
BRANCH = (ENV["GIT_BRANCH"] || `git symbolic-ref -q HEAD`).chomp().gsub('refs/heads/', '').gsub('origin/', '').gsub('/', '_').downcase() BRANCH = (ENV["GIT_BRANCH"] || `git symbolic-ref -q HEAD`).chomp().gsub('refs/heads/', '').gsub('origin/', '')
BUILD_NUMBER = (ENV["BUILD_NUMBER"] || "dev").chomp() BUILD_NUMBER = (ENV["BUILD_NUMBER"] || "dev").chomp()
if BRANCH == "master" if BRANCH == "master"
...@@ -19,9 +19,10 @@ if BRANCH == "master" ...@@ -19,9 +19,10 @@ if BRANCH == "master"
else else
DEPLOY_NAME = "#{PACKAGE_NAME}-#{BRANCH}-#{BUILD_NUMBER}-#{COMMIT}" DEPLOY_NAME = "#{PACKAGE_NAME}-#{BRANCH}-#{BUILD_NUMBER}-#{COMMIT}"
end end
INSTALL_DIR_PATH = File.join(DEPLOY_DIR, DEPLOY_NAME)
PACKAGE_REPO = "packages@gp.mitx.mit.edu:/opt/pkgrepo.incoming" PACKAGE_REPO = "packages@gp.mitx.mit.edu:/opt/pkgrepo.incoming"
NORMALIZED_DEPLOY_NAME = DEPLOY_NAME.downcase().gsub(/[_\/]/, '-')
INSTALL_DIR_PATH = File.join(DEPLOY_DIR, NORMALIZED_DEPLOY_NAME)
# Set up the clean and clobber tasks # Set up the clean and clobber tasks
CLOBBER.include('build') CLOBBER.include('build')
...@@ -62,7 +63,7 @@ task :package do ...@@ -62,7 +63,7 @@ task :package do
"--exclude=**/*.pyc", "--exclude=**/*.pyc",
"-C", "#{REPO_ROOT}", "-C", "#{REPO_ROOT}",
"--provides=#{PACKAGE_NAME}", "--provides=#{PACKAGE_NAME}",
"--name=#{DEPLOY_NAME}", "--name=#{NORMALIZED_DEPLOY_NAME}",
"--version=#{VERSION}", "--version=#{VERSION}",
"-a", "all", "-a", "all",
"."] "."]
...@@ -71,5 +72,5 @@ task :package do ...@@ -71,5 +72,5 @@ task :package do
end end
task :publish => :package do task :publish => :package do
sh("scp #{BUILD_DIR}/#{DEPLOY_NAME}_#{VERSION}*.deb #{PACKAGE_REPO}") sh("scp #{BUILD_DIR}/#{NORMALIZED_DEPLOY_NAME}_#{VERSION}*.deb #{PACKAGE_REPO}")
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment