Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #32 from 5GEVE/fix-pipenv-usage
Browse files Browse the repository at this point in the history
Fix pipenv usage
  • Loading branch information
TheWall89 authored May 30, 2020
2 parents aaf9a75 + 197d6f3 commit beb27cb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@ RUN ["pip3", "install", "pipenv"]
ENV PIPENV_VENV_IN_PROJECT 1
WORKDIR /usr/src/app
# copy only pipfiles to install dependencies
COPY ./adaptation_layer/Pipfile .
COPY ./adaptation_layer/Pipfile.lock .
RUN ["pipenv", "install"]
COPY ./adaptation_layer/Pipfile* ./
RUN ["pipenv", "install", "--system", "--ignore-pipfile", "--deploy"]
COPY ./adaptation_layer .
# setup env variables to initialize database
ARG DB_SEED_NFVO
ENV DB_SEED_NFVO $DB_SEED_NFVO
ARG DB_SEED_NFVO_CRED
ENV DB_SEED_NFVO_CRED $DB_SEED_NFVO_CRED
RUN ["rm", "-f", "data/mso-lo.db"]
RUN ["pipenv", "run", "flask", "db", "upgrade"]
RUN ["pipenv", "run", "python", "manage.py", "seed"]

FROM base as test
COPY ./openapi ./openapi
RUN ["flask", "db", "upgrade"]
RUN ["python", "manage.py", "seed"]

FROM base as prod
COPY ./uWSGI/app.ini .
CMD ["pipenv", "run", "uwsgi", "--ini", "app.ini"]
CMD ["uwsgi", "--ini", "app.ini"]

FROM base as test
COPY ./openapi ./openapi

9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ edit [docker-compose.yaml](docker-compose.yml) and change the environment variab
```yaml
SITEINV: 'true'
SITEINV_HOST: '192.168.17.20'
SITEINV_PORT: '8087'
SITEINV_PORT: '8087'
SITEINV_INTERVAL: '300'
```

Expand Down Expand Up @@ -140,13 +140,16 @@ celery -A tasks worker -B --loglevel=info

---

Please, always use `pipenv` to add dependencies:
Please, always use `pipenv` to add/remove dependencies:

```shell script
pipenv install <package-name>
pipenv uninstall <package-name>
```

After that, please commit `Pipfile` and `Pipfile.lock`.
If everything works with the new dependencies, run `pipenv lock` and commit
both `Pipfile` and `Pipfile.lock`.

### Add a new NFVO driver

Expand Down
6 changes: 3 additions & 3 deletions adaptation_layer/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docker-compose.test-nfvo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ services:
environment:
TESTING: "True"
OPENAPI_PATH: ./openapi/MSO-LO-swagger-resolved.yaml
command: ["pipenv", "run", "pytest", "-v", "tests/test_nfvo.py"]
command: ["pytest", "-v", "tests/test_nfvo.py"]

2 changes: 1 addition & 1 deletion docker-compose.test-onap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
TESTING: "True"
PRISM_ALIAS: prism-onap
OPENAPI_PATH: ./openapi/MSO-LO-swagger-resolved.yaml
command: ["./tests/wait-for-it.sh", "prism-onap:9999", "--", "pipenv", "run", "pytest", "-v", "tests/test_onap.py"]
command: ["./tests/wait-for-it.sh", "prism-onap:9999", "--", "pytest", "-v", "tests/test_onap.py"]
networks:
mso-lo-net:
aliases:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.test-osm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
TESTING: "True"
PRISM_ALIAS: prism-osm
OPENAPI_PATH: ./openapi/MSO-LO-swagger-resolved.yaml
command: ["./tests/wait-for-it.sh", "prism-osm:9999", "--", "pipenv", "run", "pytest", "-v", "tests/test_osm.py"]
command: ["./tests/wait-for-it.sh", "prism-osm:9999", "--", "pytest", "-v", "tests/test_osm.py"]
networks:
mso-lo-net:
aliases:
Expand Down

0 comments on commit beb27cb

Please sign in to comment.