🎉 First commit, from couchbase generator, basic changes
not tested / updated yet
This commit is contained in:
13
scripts/discard-dev-files.sh
Normal file
13
scripts/discard-dev-files.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
rm -rf \{\{cookiecutter.project_slug\}\}/.git
|
||||
rm -rf \{\{cookiecutter.project_slug\}\}/frontend/node_modules
|
||||
rm -rf \{\{cookiecutter.project_slug\}\}/frontend/dist
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/README.md
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/.gitlab-ci.yml
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/cookiecutter-config-file.yml
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/docker-compose.deploy.networks.yml
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/env-backend.env
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/env-couchbase.env
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/env-flower.env
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/.env
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/frontend/.env
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/env-sync-gateway.env
|
20
scripts/generate_cookiecutter_config.py
Normal file
20
scripts/generate_cookiecutter_config.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import json
|
||||
from collections import OrderedDict
|
||||
import oyaml as yaml
|
||||
from pathlib import Path
|
||||
cookie_path = Path('./cookiecutter.json')
|
||||
out_path = Path('./{{cookiecutter.project_slug}}/cookiecutter-config-file.yml')
|
||||
|
||||
with open(cookie_path) as f:
|
||||
cookie_config = json.load(f)
|
||||
config_out = OrderedDict()
|
||||
|
||||
for key, value in cookie_config.items():
|
||||
if key.startswith('_'):
|
||||
config_out[key] = value
|
||||
else:
|
||||
config_out[key] = '{{ cookiecutter.' + key + ' }}'
|
||||
config_out['_template'] = './'
|
||||
|
||||
with open(out_path, 'w') as out_f:
|
||||
out_f.write(yaml.dump({'default_context': config_out}, line_break=None, width=200))
|
Reference in New Issue
Block a user