From bfc38ba21c69ae2ba5f45d5e4ffa4411cf698b2c Mon Sep 17 00:00:00 2001 From: Charles OuGuo Date: Thu, 13 Jun 2024 13:04:09 -0500 Subject: [PATCH] Clean up some bits of old fitbit-challenges workflow (#134) - **Delete unused parts of old fitbit challenges workflow** - **Delete API dockerfile, and point frontend to right dir** --- fitbit-challenges/.github/workflows/test.yaml | 47 ------------------- src/python/fitbit_challenges/api/Dockerfile | 32 ------------- .../fitbit_challenges/docker-compose.yaml | 2 +- 3 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 src/python/fitbit_challenges/api/Dockerfile diff --git a/fitbit-challenges/.github/workflows/test.yaml b/fitbit-challenges/.github/workflows/test.yaml index b427ee48..b2950055 100644 --- a/fitbit-challenges/.github/workflows/test.yaml +++ b/fitbit-challenges/.github/workflows/test.yaml @@ -19,53 +19,6 @@ jobs: working-directory: ./src/javascript/frontend - run: npm test working-directory: ./src/javascript/frontend - test-py: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: 'pip' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - working-directory: ./src/python - - run: pytest - working-directory: ./src/python - - run: mypy . - working-directory: ./src/python - build-api: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - needs: - - test-py - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: ./src/python - file: ./src/python/api/Dockerfile - push: true - tags: shaldengeki/fitbit-challenges-api:latest build-frontend: runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' diff --git a/src/python/fitbit_challenges/api/Dockerfile b/src/python/fitbit_challenges/api/Dockerfile deleted file mode 100644 index 9808768c..00000000 --- a/src/python/fitbit_challenges/api/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM python:3-alpine - -EXPOSE 5000/tcp - -RUN apk update && \ - apk add --virtual build-deps gcc git python3-dev musl-dev && \ - apk add postgresql-dev postgresql-client postgresql15-client - -WORKDIR /usr/src/app - -COPY requirements.txt ./ - -RUN pip install --no-cache-dir -r requirements.txt - -COPY . . - -ENV FLASK_APP=app.py -ENV FLASK_DEBUG=True -ENV API_PORT=5000 -ENV FRONTEND_PROTOCOL=http -ENV FRONTEND_HOST=frontend -ENV FRONTEND_PORT=5001 -ENV DB_HOST=pg -ENV DB_USERNAME=admin -ENV DB_PASSWORD=development -ENV DATABASE_NAME=api_development -ENV FITBIT_CLIENT_ID=testing -ENV FITBIT_CLIENT_SECRET=testing -ENV FITBIT_VERIFICATION_CODE=testing -ENV FLASK_SECRET_KEY=testing - -CMD ./scripts/wait-for-postgres.sh -- flask --app api run --host 0.0.0.0 --port $API_PORT diff --git a/src/python/fitbit_challenges/docker-compose.yaml b/src/python/fitbit_challenges/docker-compose.yaml index c722385b..a2cfd49f 100644 --- a/src/python/fitbit_challenges/docker-compose.yaml +++ b/src/python/fitbit_challenges/docker-compose.yaml @@ -23,7 +23,7 @@ services: - fitbit-challenges-pg:/var/lib/postgresql/data frontend: build: - context: ./src/javascript/frontend + context: ../../javascript/fitbit-challenges/frontend dockerfile: Dockerfile image: frontend env_file: