Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (34 sloc) 1.263 kB
b473243 @croaky [#1] Import codebase from thoughtbot
croaky authored
1 namespace :copycopter do
2 task :regenerate_project_caches => :environment do
3 Project.regenerate_caches
4 end
b66b162 [#11] Removing create project button and form and replacing with rake…
Kareem authored
5
0022c84 @patricksrobertson [#57] Add rake task for removing projects.
patricksrobertson authored
6 desc 'Add a project to Copycopter'
9987038 @croaky [#35] Improve instructions
croaky authored
7 task :project => :environment do
b66b162 [#11] Removing create project button and form and replacing with rake…
Kareem authored
8 project = Project.new(:name => ENV['NAME'], :password => ENV['PASSWORD'], :username => ENV['USERNAME'])
9
10 if project.save
11 puts "Project #{project.name} created!"
12 else
13 puts "There were errors creating the project: #{project.errors.full_messages}"
14 end
15 end
0022c84 @patricksrobertson [#57] Add rake task for removing projects.
patricksrobertson authored
16
17 desc 'Remove the project from Copycopter'
18 task :remove_project => :environment do
19 project = Project.where(:name => ENV['NAME']).first
20
21 if project.destroy
22 puts "Project #{project.name} removed!"
23 else
24 puts "There were errors removing the project: #{project.errors.full_messages}"
25 end
26 end
295605d @patricksrobertson [#55] Add rake task to change project password.
patricksrobertson authored
27
28 desc 'Change the password of a Copycopter Project account'
29 task :change_project_password => :environment do
30 project = Project.where(:name => ENV['NAME']).first
31 old_password = project.password
32
33 project.password = ENV['NEW']
34
35 if ENV['OLD'] == old_password && project.save
36 puts "Project #{project.name} password has been updated!"
37 else
38 puts "You must know the old password to the project to update to the new password."
39 end
40 end
b473243 @croaky [#1] Import codebase from thoughtbot
croaky authored
41 end
Something went wrong with that request. Please try again.