Commit 291e772c by Calen Pennington

Clean up cruft from rakefile

parent 346aee88
......@@ -21,15 +21,6 @@ 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/', '')
BUILD_NUMBER = (ENV["BUILD_NUMBER"] || "dev").chomp()
if BRANCH == "master"
DEPLOY_NAME = "#{PACKAGE_NAME}-#{BUILD_NUMBER}-#{COMMIT}"
else
DEPLOY_NAME = "#{PACKAGE_NAME}-#{BRANCH}-#{BUILD_NUMBER}-#{COMMIT}"
end
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
CLOBBER.include(BUILD_DIR, REPORT_DIR, 'test_root/*_repo', 'test_root/staticfiles')
CLEAN.include("#{BUILD_DIR}/*.deb", "#{BUILD_DIR}/util")
......@@ -360,51 +351,6 @@ task :set_staff, [:user, :system, :env] do |t, args|
sh(django_admin(args.system, args.env, 'set_staff', args.user))
end
task :package do
FileUtils.mkdir_p(BUILD_DIR)
Dir.chdir(BUILD_DIR) do
afterremove = Tempfile.new('afterremove')
afterremove.write <<-AFTERREMOVE.gsub(/^\s*/, '')
#! /bin/bash
set -e
set -x
# to be a little safer this rm is executed
# as the makeitso user
if [[ -d "#{INSTALL_DIR_PATH}" ]]; then
sudo rm -rf "#{INSTALL_DIR_PATH}"
fi
AFTERREMOVE
afterremove.close()
FileUtils.chmod(0755, afterremove.path)
args = ["fakeroot", "fpm", "-s", "dir", "-t", "deb",
"--after-remove=#{afterremove.path}",
"--prefix=#{INSTALL_DIR_PATH}",
"--exclude=**/build/**",
"--exclude=**/rakefile",
"--exclude=**/.git/**",
"--exclude=**/*.pyc",
"--exclude=**/reports/**",
"--exclude=**/test_root/**",
"--exclude=**/.coverage/**",
"-C", "#{REPO_ROOT}",
"--provides=#{PACKAGE_NAME}",
"--name=#{NORMALIZED_DEPLOY_NAME}",
"--version=#{PKG_VERSION}",
"-a", "all",
"."]
system(*args) || raise("fpm failed to build the .deb")
end
end
task :publish => :package do
sh("scp #{BUILD_DIR}/#{NORMALIZED_DEPLOY_NAME}_#{PKG_VERSION}*.deb #{PACKAGE_REPO}")
end
namespace :cms do
desc "Clone existing MongoDB based course"
task :clone do
......@@ -415,9 +361,7 @@ namespace :cms do
raise "You must pass in a SOURCE_LOC and DEST_LOC parameters"
end
end
end
namespace :cms do
desc "Delete existing MongoDB based course"
task :delete_course do
......@@ -429,9 +373,7 @@ namespace :cms do
raise "You must pass in a LOC parameter"
end
end
end
namespace :cms do
desc "Import course data within the given DATA_DIR variable"
task :import do
if ENV['DATA_DIR'] and ENV['COURSE_DIR']
......@@ -443,16 +385,12 @@ namespace :cms do
"Example: \`rake cms:import DATA_DIR=../data\`"
end
end
end
namespace :cms do
desc "Imports all the templates from the code pack"
task :update_templates do
sh(django_admin(:cms, :dev, :update_templates))
end
end
namespace :cms do
desc "Import course data within the given DATA_DIR variable"
task :xlint do
if ENV['DATA_DIR'] and ENV['COURSE_DIR']
......@@ -464,9 +402,7 @@ namespace :cms do
"Example: \`rake cms:import DATA_DIR=../data\`"
end
end
end
namespace :cms do
desc "Export course data to a tar.gz file"
task :export do
if ENV['COURSE_ID'] and ENV['OUTPUT_PATH']
......
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