summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml53
-rw-r--r--db/migrate/20150601043227_migrate_jobs_to_yaml.rb4
2 files changed, 18 insertions, 39 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9f69dd9..db1cda4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,37 +1,16 @@
-jobs:
-- script: |
- export PATH=~/bin:/usr/local/bin:/usr/bin:/bin
- export RAILS_ENV=test
- ruby -v
- gem install bundler --no-ri --no-rdoc
- cp config/database.yml.mysql config/database.yml
- cp config/application.yml.example config/application.yml
- sed "s/username\:.*$/username\: runner/" -i config/database.yml
- sed "s/password\:.*$/password\: 'password'/" -i config/database.yml
- bundle --without postgres --jobs $(($(nproc) + 1))
- bundle exec rake db:setup
- SIMPLECOV=true RAILS_ENV=test bundle exec rake spec
- name: Specs
- branches: true
- tags: false
- runner:
-- script: |
- export PATH=~/bin:/usr/local/bin:/usr/bin:/bin
- ruby -v
- gem install bundler
- bundle --without postgres
- bundle exec rubocop
- name: Rubocop
- branches: true
- runner:
-- script: |
- export PATH=~/bin:/usr/local/bin:/usr/bin:/bin
- ruby -v
- gem install bundler
- bundle --without postgres
- bundle exec brakeman
- name: Brakeman
- branches: true
- runner:
-deploy_jobs: []
-skip_refs: ''
+before_script:
+ - export PATH=~/bin:/usr/local/bin:/usr/bin:/bin
+ - ruby -v
+ - gem install bundler
+ - cp config/database.yml.mysql config/database.yml
+ - cp config/application.yml.example config/application.yml
+ - 'sed "s/username\:.*$/username\: runner/" -i config/database.yml'
+ - 'sed "s/password\:.*$/password\: ''password''/" -i config/database.yml'
+ - bundle --without postgres
+ - RAILS_ENV=test bundle exec rake db:setup
+specs:
+ script: SIMPLECOV=true RAILS_ENV=test bundle exec rake spec
+rubocop:
+ script: bundle exec rubocop
+brakeman:
+ script: bundle exec brakeman \ No newline at end of file
diff --git a/db/migrate/20150601043227_migrate_jobs_to_yaml.rb b/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
index 32338dc..e7cdf2b 100644
--- a/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
+++ b/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
@@ -26,7 +26,7 @@ class MigrateJobsToYaml < ActiveRecord::Migration
select_all(sql).each do |job|
config[job["name"].to_s] = {
script: job["commands"] && job["commands"].split("\n").map(&:strip),
- tags: job["tags"].split(",").map(&:strip)
+ tags: job["tags"] && job["tags"].split(",").map(&:strip)
}
except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))
@@ -41,7 +41,7 @@ class MigrateJobsToYaml < ActiveRecord::Migration
config[job["name"].to_s] = {
script: job["commands"] && job["commands"].split("\n").map(&:strip),
type: "deploy",
- tags: job["tags"].split(",").map(&:strip)
+ tags: job["tags"] && job["tags"].split(",").map(&:strip)
}
except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))