Skip to content

Commit 801396a

Browse files
authored
Merge pull request #65 from wurstbrot/fix/local
Usage of Migrations.py locally
2 parents 5f4d2ca + 035dac4 commit 801396a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ RUN composer install \
1010

1111
FROM python:3 AS parser
1212
RUN mkdir /app/data -p
13-
ADD data-new/ /app/
14-
ADD scripts/merge-dimensions.py /app/
13+
ADD data-new/ /app/data-new
14+
ADD scripts/merge-dimensions.py /app/scripts/merge-dimensions.py
1515
WORKDIR /app
1616
RUN pip install pyyaml
17-
RUN python3 ./merge-dimensions.py
17+
RUN python3 ./scripts/merge-dimensions.py
1818

1919
FROM php:7.2-apache
2020
RUN apt-get update && apt-get -y install apt-utils libyaml-dev
2121
RUN docker-php-ext-install gettext
2222
RUN pecl channel-update pecl.php.net && pecl install yaml-2.0.0 && docker-php-ext-enable yaml
2323
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
2424
COPY . /var/www/html/
25+
RUN chmod 777 /var/www/html/selectedData.csv
2526
COPY --from=vendor /app/vendor/ /var/www/html/vendor/
2627
COPY --from=parser /app/data/dimensions.yaml /var/www/html/data/dimensions.yaml
2728

scripts/merge-dimensions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ def dict_merge(*args, add_keys=True):
3838
if __name__ == "__main__":
3939
ret = {}
4040

41-
for f in glob("*/*"):
42-
dimension = f.split("/")[0]
41+
for f in glob("data-new/*/*"):
42+
dimension = f.split("/")[1]
4343
if dimension not in ret:
4444
ret[dimension] = {}
45+
print ("Found " + dimension)
4546
ret[dimension] = dict_merge(ret[dimension], yaml_load(Path(f).read_text()))
4647

4748
Path("data/dimensions.yaml").write_text(yaml_dump(ret))

0 commit comments

Comments
 (0)