Skip to content

Commit

Permalink
merge conflict solved
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 committed Oct 10, 2023
2 parents 66261ea + 874b226 commit b1a1881
Show file tree
Hide file tree
Showing 77 changed files with 17,221 additions and 23,476 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
needs: [extract-vars]
with:
context: src/backend
dockerfile: src/backend/Dockerfile
build_target: prod
image_tags: |
"ghcr.io/hotosm/fmtm/backend:${{ needs.extract-vars.outputs.api_version }}-${{ github.ref_name }}"
Expand All @@ -48,15 +47,14 @@ jobs:
needs: [extract-vars]
with:
context: src/frontend
dockerfile: src/frontend/prod.dockerfile
dockerfile: prod.dockerfile
build_target: prod
image_tags: |
"ghcr.io/hotosm/fmtm/frontend:${{ needs.extract-vars.outputs.frontend_main_version }}-${{ github.ref_name }}"
"ghcr.io/hotosm/fmtm/frontend:latest"
build_args: |
APP_VERSION=${{ needs.extract-vars.outputs.frontend_main_version }}
API_URL=${{ needs.extract-vars.outputs.api_url }}
FRONTEND_MAIN_URL=${{ needs.extract-vars.outputs.frontend_main_url }}
VITE_API_URL=${{ needs.extract-vars.outputs.api_url }}
smoke-test-backend:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -100,7 +98,6 @@ jobs:
# docker run --rm -d \
# --network=fmtm \
# -p 8080:8080 \
# -e FRONTEND_MAIN_URL="http://test.com" \
# -e OSM_CLIENT_ID="test" \
# -e OSM_CLIENT_SECRET="test" \
# -e OSM_SECRET_KEY="test" \
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_ci_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
needs: [extract-vars]
with:
context: src/backend
dockerfile: src/backend/Dockerfile
build_target: ci
image_tags: |
"ghcr.io/hotosm/fmtm/backend:${{ needs.extract-vars.outputs.api_version }}-ci-${{ github.ref_name }}"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_odk_imgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@main
with:
context: odkcentral/api
dockerfile: odkcentral/api/Dockerfile
image_tags: |
"ghcr.io/hotosm/fmtm/odkcentral:${{ vars.ODK_CENTRAL_VERSION }}"
"ghcr.io/hotosm/fmtm/odkcentral:latest"
Expand All @@ -27,7 +26,6 @@ jobs:
uses: hotosm/gh-workflows/.github/workflows/image_build.yml@main
with:
context: odkcentral/proxy
dockerfile: odkcentral/proxy/Dockerfile
image_tags: |
"ghcr.io/hotosm/fmtm/odkcentral-proxy:${{ vars.ODK_CENTRAL_VERSION }}"
"ghcr.io/hotosm/fmtm/odkcentral-proxy:latest"
10 changes: 2 additions & 8 deletions .github/workflows/r-extract_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ on:
api_url:
description: "URL to access the backend API."
value: ${{ jobs.extract-vars.outputs.api_url }}
frontend_main_url:
description: "URL to access the main frontend."
value: ${{ jobs.extract-vars.outputs.frontend_main_url }}

jobs:
extract-vars:
Expand All @@ -30,23 +27,22 @@ jobs:
api_version: ${{ steps.extract_api_version.outputs.api_version }}
frontend_main_version: ${{ steps.extract_frontend_version.outputs.frontend_main_version }}
api_url: ${{ steps.get_env_vars.outputs.api_url }}
frontend_main_url: ${{ steps.get_env_vars.outputs.frontend_main_url }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract api version
id: extract_api_version
working-directory: src/backend
run: |
cd src/backend
API_VERSION=$(python -c 'from app.__version__ import __version__; print(__version__)')
echo "api_version=${API_VERSION}" >> $GITHUB_OUTPUT
- name: Extract frontend versions
id: extract_frontend_version
working-directory: src/frontend
run: |
cd src/frontend
FRONTEND_MAIN_VERSION=$(jq -r '.version' package.json)
echo "frontend_main_version=${FRONTEND_MAIN_VERSION}" >> $GITHUB_OUTPUT
Expand All @@ -55,5 +51,3 @@ jobs:
run: |
echo "api_url: ${{ vars.URL_SCHEME }}://${{ vars.API_URL }}"
echo "api_url=${{ vars.URL_SCHEME }}://${{ vars.API_URL }}" >> $GITHUB_OUTPUT
echo "frontend_main_url: ${{ vars.URL_SCHEME }}://${{ vars.FRONTEND_MAIN_URL }}"
echo "frontend_main_url=${{ vars.URL_SCHEME }}://${{ vars.FRONTEND_MAIN_URL }}" >> $GITHUB_OUTPUT
25 changes: 12 additions & 13 deletions .github/workflows/r-frontend_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: 18
cache: "pnpm"
cache-dependency-path: "src/frontend/pnpm-lock.yaml"

- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
src/frontend/node_modules
keys: node-modules-${{ env.cache_id }}
restore-keys: |
node-modules-
- name: Install dependencies
working-directory: src/frontend
run: pnpm install

- name: Test Frontend
run: |
cd src/frontend
npm ci --only-dev
npm run test
working-directory: src/frontend
run: pnpm run test
5 changes: 2 additions & 3 deletions .github/workflows/r-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,5 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run pytest
run: |
cd src/backend
pytest
working-directory: src/backend
run: pytest
10 changes: 4 additions & 6 deletions docker-compose.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ services:
- fmtm_tiles:/opt/tiles
depends_on:
- fmtm-db
- migrations
- traefik
env_file:
- .env
Expand All @@ -109,13 +110,12 @@ services:
image: "ghcr.io/hotosm/fmtm/backend:${API_VERSION}-${GIT_BRANCH}"
container_name: fmtm_migrations
depends_on:
- api
- fmtm-db
env_file:
- .env
networks:
- fmtm-net
entrypoint: ["/migrate-entrypoint.sh"]
command: ["alembic", "upgrade", "head"]
restart: "on-failure:3"

ui:
Expand All @@ -125,8 +125,7 @@ services:
dockerfile: prod.dockerfile
args:
APP_VERSION: ${FRONTEND_MAIN_VERSION}
API_URL: ${URL_SCHEME}://${API_URL}
FRONTEND_MAIN_URL: ${URL_SCHEME}://${FRONTEND_MAIN_URL}
VITE_API_URL: ${URL_SCHEME}://${API_URL}
container_name: fmtm
depends_on:
- api
Expand All @@ -135,8 +134,7 @@ services:
- fmtm-net
environment:
- BROTLI=true
- API_URL=${URL_SCHEME}://${API_URL}
- FRONTEND_MAIN_URL=${URL_SCHEME}://${FRONTEND_MAIN_URL}
- VITE_API_URL=${URL_SCHEME}://${API_URL}
restart: "unless-stopped"
labels:
- "traefik.enable=true"
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.noodk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
- ./src/backend/app:/opt/app
depends_on:
- fmtm-db
- migrations
env_file:
- .env
ports:
Expand All @@ -71,13 +72,12 @@ services:
image: "ghcr.io/hotosm/fmtm/backend:${API_VERSION}-${GIT_BRANCH}"
container_name: fmtm_migrations
depends_on:
- api
- fmtm-db
env_file:
- .env
networks:
- fmtm-net
entrypoint: ["/migrate-entrypoint.sh"]
command: ["alembic", "upgrade", "head"]
restart: "on-failure:3"

ui:
Expand All @@ -86,18 +86,18 @@ services:
context: src/frontend
dockerfile: debug.dockerfile
args:
APP_VERSION: ${FRONTEND_MAIN_VERSION}
API_URL: ${URL_SCHEME}://${API_URL}
FRONTEND_MAIN_URL: ${URL_SCHEME}://${FRONTEND_MAIN_URL}
VITE_API_URL: ${URL_SCHEME}://${API_URL}
container_name: fmtm
depends_on:
- api
volumes:
- ./src/frontend:/app
- /app/node_modules/
environment:
- API_URL=${URL_SCHEME}://${API_URL}
- FRONTEND_MAIN_URL=${URL_SCHEME}://${FRONTEND_MAIN_URL}
- VITE_API_URL=${URL_SCHEME}://${API_URL}
- VITE_ODK_CENTRAL_URL=${ODK_CENTRAL_URL}
- VITE_ODK_CENTRAL_USER=${ODK_CENTRAL_USER}
- VITE_ODK_CENTRAL_PASSWD=${ODK_CENTRAL_PASSWD}
ports:
- "8081:8081"
networks:
Expand Down
16 changes: 7 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ services:
# - ../osm-fieldwork/osm_fieldwork:/home/appuser/.local/lib/python3.10/site-packages/osm_fieldwork
depends_on:
- fmtm-db
- migrations
- central-proxy
env_file:
- .env
Expand All @@ -78,13 +79,12 @@ services:
image: "ghcr.io/hotosm/fmtm/backend:debug"
container_name: fmtm_migrations
depends_on:
- api
- fmtm-db
env_file:
- .env
networks:
- fmtm-dev
entrypoint: ["/migrate-entrypoint.sh"]
command: ["alembic", "upgrade", "head"]
restart: "on-failure:3"

ui:
Expand All @@ -93,20 +93,18 @@ services:
context: src/frontend
dockerfile: debug.dockerfile
args:
API_URL: ${URL_SCHEME}://${API_URL}
FRONTEND_MAIN_URL: ${URL_SCHEME}://${FRONTEND_MAIN_URL}
VITE_API_URL: ${URL_SCHEME}://${API_URL}
container_name: fmtm
depends_on:
- api
volumes:
- ./src/frontend:/app
- /app/node_modules/
environment:
- API_URL=${URL_SCHEME}://${API_URL}
- FRONTEND_MAIN_URL=${URL_SCHEME}://${FRONTEND_MAIN_URL}
- ODK_CENTRAL_URL=${ODK_CENTRAL_URL}
- ODK_CENTRAL_USER=${ODK_CENTRAL_USER}
- ODK_CENTRAL_PASSWD=${ODK_CENTRAL_PASSWD}
- VITE_API_URL=${URL_SCHEME}://${API_URL}
- VITE_ODK_CENTRAL_URL=${ODK_CENTRAL_URL}
- VITE_ODK_CENTRAL_USER=${ODK_CENTRAL_USER}
- VITE_ODK_CENTRAL_PASSWD=${ODK_CENTRAL_PASSWD}
ports:
- "8080:8080"
networks:
Expand Down
Loading

0 comments on commit b1a1881

Please sign in to comment.