Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #69 from NuCivic/fix-circle-template
Browse files Browse the repository at this point in the history
Add back missing templating class.
  • Loading branch information
dharizza authored Jan 13, 2017
2 parents f1265b6 + 279645a commit be9ebe2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .ahoy/site/.scripts/circle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'erb'
require 'yaml'

template = File.open("assets/templates/circle.yml.erb", "r").read

class CircleCIConfig
attr_accessor :temp_dirs
attr_accessor :memory_limit

def initialize config
default_test_dirs = ["tests/features", "dkan/test/features", "config/tests/features"]
@test_dirs = config["default"]["test_dirs"] ? config["default"]["test_dirs"] : default_test_dirs
@memory_limit = config["default"]["memory_limit"] ? config["default"]["memory_limit"] : "256M"
end

def render(template)
ERB.new(template).result(binding)
end
end

config = YAML.load_file("config/config.yml")
circle_ci_config = CircleCIConfig.new(config)
puts circle_ci_config.render(template);
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies:
## Customize test commands
test:
override:
- BEHAT_FOLDER=$HOME/$CIRCLE_PROJECT_REPONAME/tests ruby dkan/.ahoy/.scripts/circle-behat.rb tests/features dkan/test/features config/test/features --tags='~@customizable&&~@fixme&&~@testBug':
- BEHAT_FOLDER=$HOME/$CIRCLE_PROJECT_REPONAME/tests ruby dkan/.ahoy/.scripts/circle-behat.rb tests/features dkan/test/features config/tests/features --tags='~@customizable&&~@fixme&&~@testBug':
timeout: 1200
parallel: true
post:
Expand Down

0 comments on commit be9ebe2

Please sign in to comment.