diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 6819074..394004e 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -15,7 +15,7 @@ jobs: secrets: inherit build: - # needs: ci-checks + needs: ci-checks uses: ./.github/workflows/build.yml secrets: inherit diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 35ddc0f..0c2f197 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -25,7 +25,7 @@ jobs: uses: mattzcarey/code-review-gpt@v0.1.4-alpha with: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - MODEL: 'gpt-4' + MODEL: 'gpt-3.5-turbo' GITHUB_TOKEN: ${{ github.token }} build: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 2da7352..e65c376 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -15,7 +15,7 @@ jobs: secrets: inherit build: - # needs: ci-checks + needs: ci-checks uses: ./.github/workflows/build.yml secrets: inherit diff --git a/docker-scripts.sh b/docker-scripts.sh index bb7b24b..2c14551 100755 --- a/docker-scripts.sh +++ b/docker-scripts.sh @@ -29,4 +29,38 @@ down() { docker compose -f docker-compose.testing.yml down } +dump() { + # Define service name and dump directory name + SERVICE_NAME="db" + DUMP_NAME="mongodump-$(date --iso).archive" + CONTAINER_ID=$(docker compose ps -q $SERVICE_NAME) + + # Fetch credentials from Docker environment variables + MONGO_URL=$(docker compose exec -T backend printenv MONGO_URL) + echo mongo uri: $MONGO_URL + + # Dump MongoDB data using credentials + docker compose exec -T $SERVICE_NAME sh -c "mongodump --gzip --archive=/tmp/$DUMP_NAME -d odyssey-test" && + + # Copy the dump from the container to the host + # Note: You will need to know the exact container name for this step + docker cp ${CONTAINER_ID}:/tmp/$DUMP_NAME . && + + echo "MongoDB data dumped successfully." +} + +restore() { + # Define service name and dump directory name + SERVICE_NAME="db" + DUMP_NAME=$1 + CONTAINER_ID=$(docker compose ps -q $SERVICE_NAME) + + # Copy the dump from the host to the container + docker cp $DUMP_NAME ${CONTAINER_ID}:/tmp && + + # Dump MongoDB data using credentials + docker compose exec -T $SERVICE_NAME sh -c "mongorestore --gzip --archive=/tmp/$DUMP_NAME" && + + echo "MongoDB data dumped successfully." +} $@ \ No newline at end of file