Skip to content

Commit

Permalink
Merge pull request #126 from dtcarls/develop
Browse files Browse the repository at this point in the history
major reorg and refactor
  • Loading branch information
dtcarls authored Oct 24, 2022
2 parents 2c9c734 + f48459a commit a829418
Show file tree
Hide file tree
Showing 23 changed files with 881 additions and 748 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
tags: ${{ env.TEST_TAG }}

- name: Run image against tests
run: docker run ${{ env.TEST_TAG }} python /usr/src/ff_bot/setup.py test
run: docker run ${{ env.TEST_TAG }} python /usr/src/gamedaybot/setup.py test
16 changes: 8 additions & 8 deletions .github/workflows/publish_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ on:
- master
- main
release:
types:
types:
- published

jobs:
push-image:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
Expand All @@ -33,18 +33,18 @@ jobs:

- name: Set tag name for commits
if: ${{ github.event_name == 'push' }}
run: echo "TAG=ghcr.io/${GITHUB_REPOSITORY,,}:${{ github.sha }}" >>${GITHUB_ENV}
run: echo "TAG=ghcr.io/${GITHUB_REPOSITORY,,}:${{ github.sha }}" >>${GITHUB_ENV}

- name: Build image
uses: docker/build-push-action@v2
with:
load: true
push: false
tags: ${{ env.TAG }}

- name: Test image
run: docker run ${{ env.TAG }} python /usr/src/ff_bot/setup.py test
run: docker run ${{ env.TAG }} python /usr/src/gamedaybot/setup.py test

- name: Push image to registry
uses: docker/build-push-action@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,6 @@ dmypy.json
#misc.
.vscode/*

ff_bot/ids.txt
gamedaybot/ids.txt
*.sh
*.ipynb
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM python:3.9.9-slim-bullseye

# Install app
ADD . /usr/src/ff_bot
WORKDIR /usr/src/ff_bot
ADD . /usr/src/gamedaybot
WORKDIR /usr/src/gamedaybot
RUN python3 setup.py install

# Launch app
CMD ["python3", "ff_bot/ff_bot.py"]
CMD ["python3", "gamedaybot/espn/espn_bot.py"]
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
worker: python3 ff_bot/ff_bot.py
worker: python3 gamedaybot/espn/espn_bot.py
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ You should see something like below. Click the pencil on the right and toggle th

You're done! You now have a fully featured GroupMe/Slack/Discord chat bot for ESPN leagues! If you have an INIT_MSG you will see it exclaimed in your GroupMe, Discord, or Slack chat room.

Unfortunately to do auto deploys of the latest version you need admin access to the repository on git. You can check for updates on the github page (https://github.com/dtcarls/ff_bot/commits/master) and click the deploy button again; however, this will deploy a new instance and the variables will need to be edited again.
Unfortunately to do auto deploys of the latest version you need admin access to the repository on git. You can check for updates on the github page (https://github.com/dtcarls/fantasy_football_chat_bot/commits/master) and click the deploy button again; however, this will deploy a new instance and the variables will need to be edited again.

#### Private Leagues

Expand Down Expand Up @@ -252,19 +252,19 @@ on your local machine for development and testing purposes.
### Installing for development
With Docker:
```bash
git clone https://github.com/dtcarls/ff_bot
git clone https://github.com/dtcarls/fantasy_football_chat_bot

cd ff_bot
cd fantasy_football_chat_bot

docker build -t ff_bot .
docker build -t fantasy_football_chat_bot .
```

Without Docker:

```bash
git clone https://github.com/dtcarls/ff_bot
git clone https://github.com/dtcarls/fantasy_football_chat_bot

cd ff_bot
cd fantasy_football_chat_bot

python3 setup.py install
```
Expand Down Expand Up @@ -297,12 +297,12 @@ Use BOT_ID if using Groupme, DISCORD_WEBHOOK_URL if using Discord, and SLACK_WEB
>>> export WEBHOOK_URL=[enter your Webhook URL]
>>> export LEAGUE_ID=[enter ESPN league ID]
>>> export LEAGUE_YEAR=[enter league year]
>>> cd ff_bot
>>> cd fantasy_football_chat_bot
>>> docker run --rm=True \
-e BOT_ID=$BOT_ID \
-e LEAGUE_ID=$LEAGUE_ID \
-e LEAGUE_YEAR=$LEAGUE_YEAR \
ff_bot
fantasy_football_chat_bot
```

### Running without Docker
Expand All @@ -314,14 +314,14 @@ Use BOT_ID if using Groupme, DISCORD_WEBHOOK_URL if using Discord, and SLACK_WEB
>>> export WEBHOOK_URL=[enter your Webhook URL]
>>> export LEAGUE_ID=[enter ESPN league ID]
>>> export LEAGUE_YEAR=[enter league year]
>>> cd ff_bot
>>> python3 ff_bot/ff_bot.py
>>> cd gamedaybot
>>> python3 gamedaybot/espn/espn_bot.py
```

### Running the tests

Automated tests for this package are included in the `tests` directory. After installation,
you can run these tests by changing the directory to the `ff_bot` directory and running the following:
you can run these tests by changing the directory to the `gamedaybot` directory and running the following:

```python3
python3 setup.py test
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.7"

services:
ff_bot:
gamedaybot:
build:
context: .
restart: always
Expand Down
Empty file removed ff_bot/__init__.py
Empty file.
Loading

0 comments on commit a829418

Please sign in to comment.