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

Commit

Permalink
Change Docfile to YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
dshevtsov committed Apr 17, 2019
1 parent b2880cd commit 6114e1b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
5 changes: 0 additions & 5 deletions Docfile

This file was deleted.

26 changes: 26 additions & 0 deletions Docfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
content_map:
-
directory: guides/v2.0
repository: magento/devdocs
branch: 2.0
filter: false
-
directory: guides/m1x
repository: magento/devdocs-m1
branch: master
filter: false
-
directory: mbi
repository: magento/devdocs-mbi
branch: master
filter: true
-
directory: mftf
repository: magento/magento2-functional-testing-framework
branch: develop
filter: true
-
directory: page-builder
repository: magento-devdocs/magento2-page-builder
branch: develop
filter: true
18 changes: 4 additions & 14 deletions rakelib/lib/doc-config.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
# Read Docfile file and get configuration data for adding subrepositories
class DocConfig
attr_reader :config
def initialize(config_file = 'Docfile')
@config_data = File.readlines(config_file)
@config = []
parse_file
def initialize(config_file = 'Docfile.yml')
@config = YAML.load_file(config_file)
end

def parse_file
@config =
@config_data.map do |string|
{
'directory' => string[/(?<=")[^"]+(?="\sdirectory)/],
'repository' => string[/(?<=")[^"]+(?="\srepository)/],
'branch' => string[/(?<=")[^"]+(?="\sbranch)/],
'filter' => string.match?(/(?<=")[^"]+(?="\scontent)/)
}
end
def content_map
@config['content_map']
end
end
4 changes: 2 additions & 2 deletions rakelib/multirepo.rake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace :multirepo do
ssh
end

config = DocConfig.new.config
config.each do |subrepo|
content_map = DocConfig.new.content_map
content_map.each do |subrepo|
sh "./scripts/docs-from-code.sh #{subrepo['directory']} #{protocol}#{subrepo['repository']}.git #{subrepo['branch']} #{subrepo['filter']}"
end
end
Expand Down

0 comments on commit 6114e1b

Please sign in to comment.