aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2016-04-26 12:54:47 +0200
committerAlban Peignier2016-04-26 12:54:47 +0200
commitdbb15e8272f921ceaa14ffbd913d0d1ab8beb7eb (patch)
tree5704d5a7aed035e0e5131068756c8588b85a65d5
parent835621d1c9a295623571d76a7579be9745e71aeb (diff)
downloadchouette-core-dbb15e8272f921ceaa14ffbd913d0d1ab8beb7eb.tar.bz2
Add basic ci tasks. Refs #802
-rw-r--r--config/database/jenkins.yml8
-rw-r--r--lib/tasks/ci.rake21
2 files changed, 23 insertions, 6 deletions
diff --git a/config/database/jenkins.yml b/config/database/jenkins.yml
new file mode 100644
index 000000000..8b7a8ef2f
--- /dev/null
+++ b/config/database/jenkins.yml
@@ -0,0 +1,8 @@
+test:
+ adapter: postgis
+ encoding: unicode
+ schema_search_path: 'public,shared_extensions'
+ postgis_schema: 'shared_extensions'
+ username: <%= ENV['POSTGRESQL_ENV_POSTGRES_USER'] || 'jenkins' %>
+ password: <%= ENV['POSTGRESQL_ENV_POSTGRES_PASSWORD'] %>
+ database: stif_boiv_test
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake
index 092a4619f..b198a374a 100644
--- a/lib/tasks/ci.rake
+++ b/lib/tasks/ci.rake
@@ -1,11 +1,20 @@
namespace :ci do
- task :db_travis_config do
- cp "config/database.yml.travis", "config/database.yml"
+ desc "Prepare CI build"
+ task :setup do
+ cp "config/database/jenkins.yml", "config/database.yml"
+ sh "RAILS_ENV=test rake db:migrate"
end
-
+
+ desc "Deploy after CI"
task :deploy do
- cp "chouette2.war", "/var/lib/tomcat6/webapps/"
- end
- task :build => [ "war", "ci:deploy"]
+ sh "cap dev deploy"
+ end
+
+ desc "Clean test files"
+ task :clean do
+ sh "rm -rf log/test.log"
+ end
end
+desc "Run continuous integration tasks (spec, ...)"
+task :ci => ["ci:setup", "spec", "ci:deploy", "ci:clean"]