Skip to content
Snippets Groups Projects
Commit fa0778bb authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

docfix

parent 811a7a9c
No related branches found
No related tags found
No related merge requests found
Pipeline #642 passed with stage
in 2 seconds
# example # example
Example box. Not compiled. Keep four lines in same order. This is description of the box. It will be copied. Keep it short and single-line. Don't remove the line break before.
Version: 1.0 Version: 1.0
This section will be automatically replaced by `python make.py` with auto-generated Write what this box consists of and how it behaves.
content of Vagrantfile that will refer to this box. First four lines have a special meaning - dont move them around. Change only version number, not the word.
--- ---
Usage in Vagrantfile: This section will be automatically replaced by `python make.py` with auto-generated
``` content of Vagrantfile that will refer to this box.
config.vm.box = "henrietta/example"
config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/example.box"
```
...@@ -36,7 +36,7 @@ def writefile(content, path, prefix=None, lines=False): ...@@ -36,7 +36,7 @@ def writefile(content, path, prefix=None, lines=False):
with open(path, 'w' if lines else 'wb') as f: with open(path, 'w' if lines else 'wb') as f:
if lines: if lines:
f.writelines([q+'\n' for q in content]) f.writelines([q+os.linesep for q in content])
else: else:
if not isinstance(content, list): if not isinstance(content, list):
content = [content] content = [content]
...@@ -99,7 +99,7 @@ build_$BOX: ...@@ -99,7 +99,7 @@ build_$BOX:
after_script: after_script:
- vagrant destroy -f - vagrant destroy -f
- cd .. - cd ..
'''.replace('$BOX', box).replace('$PREFIX', PREFIX)) '''.replace('$BOX', box).replace('$PREFIX', PREFIX).replace('\n', os.linesep))
if len(gitlabci) == 0: if len(gitlabci) == 0:
gitlabci = ['''check_validity: gitlabci = ['''check_validity:
...@@ -111,7 +111,7 @@ build_$BOX: ...@@ -111,7 +111,7 @@ build_$BOX:
- grep "1.0" metadata.json - grep "1.0" metadata.json
- grep "test" metadata.json - grep "test" metadata.json
- cd .. - cd ..
'''] '''.replace('\n', os.linesep)]
writefile(gitlabci, '.gitlab-ci.yml') writefile(gitlabci, '.gitlab-ci.yml')
...@@ -164,7 +164,7 @@ First four lines have a special meaning - dont move them around. Change only ver ...@@ -164,7 +164,7 @@ First four lines have a special meaning - dont move them around. Change only ver
This section will be automatically replaced by `python make.py` with auto-generated This section will be automatically replaced by `python make.py` with auto-generated
content of Vagrantfile that will refer to this box. content of Vagrantfile that will refer to this box.
'''.replace('$BOX', box).replace('$PREFIX', PREFIX), 'README.md', box) '''.replace('$BOX', box).replace('$PREFIX', PREFIX).replace('\n', os.linesep), 'README.md', box)
writefile('''#!/bin/bash writefile('''#!/bin/bash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment