Fix resource listing script (#97)
* fix resource listing script * code refined
This commit is contained in:
Родитель
e9faa422f2
Коммит
1559db6dec
4
Makefile
4
Makefile
|
@ -53,7 +53,7 @@ build-terraform:
|
|||
@if [ -z "$(RESOURCE)" ]; then \
|
||||
echo "==> Generating source code for terraform from resource list..."; \
|
||||
cd $(MMROOT) && \
|
||||
jq '.[]' $(ROOT)/resources.json | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e terraform -c azure -o $(TFROOT)/$(TFREPO)/; \
|
||||
sh $(ROOT)/list_resources.sh | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e terraform -c azure -o $(TFROOT)/$(TFREPO)/; \
|
||||
else \
|
||||
echo "==> Generating source code for terraform from given name..."; \
|
||||
cd $(MMROOT) && \
|
||||
|
@ -71,7 +71,7 @@ build-ansible:
|
|||
@if [ -z "$(RESOURCE)" ]; then \
|
||||
echo "==> Generating source code for ansible from resource list..."; \
|
||||
cd $(MMROOT) && \
|
||||
jq '.[]' $(ROOT)/resources.json | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e ansible -c azure -o $(GENROOT)/$(ASREPO)/; \
|
||||
sh $(ROOT)/list_resources.sh | xargs -I '{}' bundle exec compiler -d -p $(SPECROOT)/'{}' -e ansible -c azure -o $(GENROOT)/$(ASREPO)/; \
|
||||
else \
|
||||
echo "==> Generating source code for ansible from given name..."; \
|
||||
cd $(MMROOT) && \
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd `dirname $0`
|
||||
for file in `ls ./specs`; do
|
||||
work_dir=./specs/$file
|
||||
if [ -d $work_dir ]; then
|
||||
if [ -n "$(git status -s $work_dir)" ];
|
||||
then
|
||||
# remove the directory prefix './specs/'
|
||||
expr substr "$work_dir" 9 "${#work_dir}"
|
||||
fi
|
||||
fi
|
||||
done
|
Загрузка…
Ссылка в новой задаче