Skip to content

Commit

Permalink
Cut out api directory (Amsterdam#1164)
Browse files Browse the repository at this point in the history
* Move README.md file into app directory

* Move everything from api directory to project root

* Place requirements in app directory

* Adjust docker ignore file

* Adjust the paths to the new situation

* Point the ci to the right location of the requirements.txt file

* Move media and static directories back to app directory

* Don't try to cd into api directory

* Don't cd into api directory

* Don't copy static and media directories during build
  • Loading branch information
4c0n authored Feb 17, 2023
1 parent f54f54e commit ff974f2
Show file tree
Hide file tree
Showing 1,089 changed files with 23 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.env
/api/static/
/api/media/
/api/app/signals/settings/local.py
app/static
app/media
app/signals/settings/local.py
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r api/requirements.txt
pip install -r app/requirements.txt
- name: Run tests
env:
DATABASE_HOST: localhost
run: |
cd api/app
cd app/
tox
- name: Upload coverage report
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/review_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Build and push image to ACR
run: |
cd api/
az acr build --image ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.RESOURCE_GROUP }} .
run: az acr build --image ${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }} --registry ${{ env.AZURE_CONTAINER_REGISTRY }} -g ${{ env.RESOURCE_GROUP }} .

deploy:
permissions:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ docker-compose.override.yml

# Django stuff:
*.log
api/app/signals/settings/local.py
api/media
api/static
app/signals/settings/local.py
app/media/
app/static/

# Sphinx documentation
docs/_build/
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WORKDIR /app

RUN useradd --no-create-home signals

COPY api/requirements.txt /requirements.txt
COPY app/requirements.txt /app/requirements.txt

RUN set -eux; \
apt-get update; \
Expand All @@ -41,18 +41,18 @@ RUN set -eux; \
gcc \
graphviz \
; \
pip install --no-cache -r /requirements.txt; \
pip install --no-cache -r /app/requirements.txt; \
apt-get purge -y gcc; \
rm -rf /var/lib/apt/lists/*

COPY api/app /app
COPY app /app

RUN set -eux; \
chgrp signals /app; \
chmod g+w /app; \
mkdir -p /static /media; \
chown signals /static; \
chown signals /media
mkdir -p /app/static /app/media; \
chown signals /app/static; \
chown signals /app/media

USER signals

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ff974f2

Please sign in to comment.